# Tagged Questions

The process of evaluating a strategy, theory, or model by applying it to historical data.

893 views

### Backtesting with Simulated Historical Data?

The trading strategies that are going to backtest well are the ones that pick the winners from the past. For example, if a trading strategy simply bought apple stock it would backtest extremely well. ...
427 views

### Is making a bid/ask offer a good way to lower the spreads?

I have written an algorithmic trading program which relies heavily on low spreads in the 0.1-0.3 PIP region. I was now wondering if it would be a good idea to place bid/ask offers instead of limit ...
552 views

Suppose you backtest the EUR/USD (or GBP/USD) forex pair with this system on the 1min timeframe: 1) Enter the market at any time n: go long if the "future" bar n+1 has a higher close as the close ...
74 views

### Selection of optimal backtesting parameters

Suppose I backtest some strategy on in-sample data while varying two parameters, say $X$ and $Y$. $X$ can take the values $\{3,6,9,12,15,18\}$ while $Y$ can take $\{10,15,20,25,30\}$. I want to select ...
69 views

### Historical index components (FIGIs) from bloomberg?

In order to run strategy simulations, I am trying to build a database of historical equity data using Bloomberg. I can pull the ticker symbols corresponding to the components of an index at any point ...
75 views

### importing columns of returns data into python from excel/csv [closed]

I'm fairly new to the quant finance space, and I was hoping to get some guidance. Say I have a csv/excel file with columns of daily returns data for various asset classes or securities (one column per ...
173 views

### Simulating Stock's close, high and low prices

I am testing a model in which I need to simulate closing, high and low prices (i.e. 3 dimensions of prices) of any given stock. Using the simple Geometric Brownion Motion equation I can easily ...
155 views

### Calculation of Returns and Risk Metrics for L/S Portfolio

I am trying to build a test for a long/short portfolio. I am aiming for market neutral and have put together a long portfolio as well as a short portfolio (see below). However, I am not sure if I am ...
405 views

### Analog - Pattern Recognition model using KNN

I'm building a pattern recognition model for my master thesis. The idea is to build a framework with some Macro variables (long/short term rates; rates differential; equity; fx; vix) in order to find ...
887 views

### How to fully replicate ADX + DI Indicators in Excel? [closed]

For black box testing, I was hoping that I could replicate the ADX + DI+ and DI- indicators that are provided in trading platforms such as ThinkOrSwim, ScottradeElite etc. However, I noticed that ...
553 views

### Machine Learning on matlab 2010

I am trying to develop a trading model. It uses certain technical and fundamental features and the model learns from the past. I have a 3-class output - bullish, neutral and bearish. On trying neural ...
121 views

### how to make a distribution model tolerable of trend?

I'm building an model on different loans' NPL rate. The problem is NPL rates are always affected by the market. When NPL rates move in trend, my model will fail the back-testing. Assuming $x(t)$ is a ...
43 views

We are working under complex enough distributed trading system where several components will run on different physical machines. Unfortunately, I'm stuck on part backtesting part. Originally we was ...
114 views

I apologize if this is way too basic a question, but I'm an absolute beginner to trading and am in the process of learning the fundamentals. Currently I'm trying to model a (10-day) SMA backtest in ...
59 views

### Backtesting Strategies - Sampling and returns types

I am back testing a strategy in R and I have some questions about testing design. I have a universe of around 500 stocks to test filtered based on liquidity. To test the trading strategy I have ...
99 views

### ES not elicitable

Expected Shortfall is not elicitable as some papers have pointed out. That simply means that there is no scoring function that elicits ES. My question is, does this imply that Expected Shortfall ...
32 views

### Significance testing of average returns from Sharpe ratio

I'm aware that one way to do significance testing on a strategy is based on the sampling distribution of its Sharpe (see, e.g., Lo, 2002 and Opdyke, 2008). However, it appears to me that there's ...
112 views

### R quantstrat backtest with dollar based position sizing

I am attempting to tweak a quantstrat based backtest but have run into an issue. The maxPos limits are share based, and I would rather use a fixed dollar amount instead. So I've tried generating a ...
177 views

### Are there any software libraries for backtesting FX algorithms against tick data?

I've read question, however it doesn't appear as if any of those libraries work for FX data. A Google search for python forex backtesting turns up this project, ...
73 views

### How to compare market values with model values after calibration?

After calibration the G2++ model for interest (with swaption volatilities), I want to statistically test the quality of the calibration by comparing market to model values. What is the best way to ...
81 views

I was asked this question in an interview and despite thinking about it for a while, I haven't been able to come up with a good answer. Suppose you have a strategy you are running where at certain ...
176 views

### What is the logic behind this backtesting code in R

I am new to R and I have found this simple backtesting code and can you explain me what is happening here. ...
111 views

### Daily or weekly data?

I am trying to test a strategy but do not know if I should use daily or weekly data? I have tried researching this & have found that daily data will bring " too much " noise compared to lower ...
99 views

### How do I take an unbiased, sector neutral sample from a stock index?

I am looking to take a cross sector subset of a larger stock index universe. What steps to I take to assure that sector representation is as equal as possible to help smooth out my variance(while ...
57 views

### Backtesting algorithms

Are there any books/papers/articles to describe how to develop a backtesting software? Something like backtest in quantopian website. How do they calculate the Cumulative performance?
40 views

I am backtesting a number of trading strategies using a feed of unadjusted data from Factset. Before I run the backtest my routines adjust the data for splits and for special dividends. One question ...
368 views

### Is there a good backtesting package in R?

My model exports a vector that have for each day b-buy s-sell or h- hold it's look like this: sig [1] b b s s b b b s s b s b s s b s b s s s s b b s s b b b b b b s b b b b b b b I want to ...
320 views

### Long/Short Backtesting Set up

I am going to be backtesting a Long/Short equity strategy and need some guidance on how best to deal with the short book. I was thinking that for each portfolio I would go long 50 equities and go ...
62 views

### Writing an Options Strategy Backtester

I've been doing some digging, and this question has been asked many times in various forms over the years - Backtesting Options Strategies in R Are there any good tools for backtesting options ...
21 views

### Relationship between in-sample and out-sample periods length

I have two general questions regarding "in-sample fitting vs. out-of-sample backtesting" kind of analyses. Is there any relationship between the length of the data collected for in-sample fitting ($a$)...
58 views

### How to backtest strategy in portfolio of stocks using SIT R?

I am creating and testing strategies in R code and using systemic investor toolbox(SIT) package as the backtesting tool. I copied a SIT backtesting code from a website and made small changes to make ...
59 views

### Backtesting Long/Short Market Neutral Z-Score Strategy with Custom Factors and Custom Stock Universe

So I've managed to backtest simple strategies, like MA, RSI and some fundamental ones (P/E ratios etc) but Im stuck at my last strategy. Here is some information: Tools: Excel and Python (also a ...
22 views

### Should the number of Markowitz Optimization steps be counted as backtest trials?

I'm backtesting a strategy that involves monthly investments in a few stocks out of a given set, that is, each month some of the stocks are shortlisted from an index and a long position is taken in ...
73 views

### Cointegration for forex using ARMA model to forecast the spread

I am working on an automatized quantitative strategy that use cointegration in Forex. I am backtesting this strategy in Python. Please see below the python file: https://drive.google.com/file/d/...
42 views

### Proper Definition of Backtesting Parameter

Currently I'm trying to test the efficacy of a tail-hedging strategy in which an investor goes long in an index and correspondingly buys 1-month OTM put options. For practical reasons, the options ...
23 views

### Making apriori Statements on VaR Backtests with a Garch Modelled VaR

so I want to find out, if its possible to find out for any backtest for the Value at Risk(Kupics POF or Christophersen's Markov Test), if it is possible to make apriori Statements on Testing results ( ...
161 views

### How to backtest Value at Risk Models using Conditional and Unconditional tests?

I am trying to carry out backtesting on a number of Value at Risk figures i obtained using var/covar, historical, and monte carlo simulation. The two methods im using are the Kupiec test (...
38 views

### how to choose a price adjustment, a roll date and a data center for my trading strategy?

I have many doubts about Which roll date and price adjustment should I use. I need to backtest like 50 diferents futures. 6 index(mini sp500, Nikkei 225â€¦), 10 Agriculture (soybean, Oat, Cornâ€¦.),3 ...
153 views

### How to estimate probable seeling pricegiven OHLC data for backtesting?

I'm relative new to this, so I might be asking something that doesn't make sense. Here is my scenario: I have intraday day at 1 minute intervals. This data has ohlc data and I want to compute for any ...
289 views

### Plot Evolution of portfolio weights over time in R [closed]

Is there any function for plotting the evolution of portfolio weights over time in r?. I have a matrix of portfolio weights from an equal weighting strategy at rebalancing times and want to plot ...
272 views

### Comparing Backtests of Value-at-Risk and Expected Shortfall

My goal is to test if ES (CVaR) empirically is a better risk measure than VaR for a set of given variables (assumed underlying distribution, confidence level, sample size) for different asset classes. ...
189 views

### Backtesting benchmark / control test design

I am designing a backtesting system to test an algorithm. I'd like to have a benchmark / control test results to compare to the results of a custom algorithm. A limited "set" of stocks is selected ...
168 views

### Sharpe Ratio and time spent in loss

Is it possible to express, given an annualized Sharpe Ratio value, what is an expected maximum/average time spent in a draw-down or something in this manner? E.g. with SR of 10, you'd expect to spend ...
130 views

### Backtesting software with custom data input

I was considering to develop a custom backtesting platform for myself. However, I see that it would require some significant time and effort, and the result might not be as initially expected. So I ...
314 views

### What data should be used for regression-based model backtesting?

I ran regressions using historical valuation data and now want to backtest the models I came up with. Are there any issues with using the same historical data set for the backtest that I need to be ...
47 views

### How to setup a back test step by step?

I would like to setup a back test for Indian equities, Kindly help out with step by step procedure, No need to go into details, outlining of procedure are enough in bullet point, I will research ...
552 views

### backtesting with open, close, high and low

I am quite notice at the business of backtesting for an automated strategy. I was wondering, can I/should I use High and Low for this purpose? On one hand, the algorithm will see these prices, but on ...
247 views

### How to backtest the VaR model?

I have a sorted historical P&L vector of 250 days and say, I want to calculate the 90% VaR on this distribution. I will look for the 225 element (90% * 250 = 225) and this will be my Value at Risk....
315 views

### adjusted close prices on SP500

When I look at the adjusted close prices of SP500, for example, I notice that the numbers are always significantly below the actual closing. In the explanation of what adjusted prices are, one gets ...
20 views

### Using the univariate regression coefficient to calculate cumulative return - does it make sense?

When testing a stand-alone signal usually one of the simple tests I do is a long-short equal-weight strategy to see how the wealth chart looks like. Going through my predecessor's code I see ...