Questions tagged [backtesting]

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

Filter by
Sorted by
Tagged with
0
votes
0answers
30 views

What should the look-back period be when calculating Cointegration?

So I am confused as to what the look-back period should be when calculating Cointegration. By this I mean when running for example a Johansen or ADF test, should my look-back period be 6 months?...
0
votes
1answer
28 views

Calculate daily account value & returns on trading system backtest

Quick question, I'm having a brain freeze. I've done a simple system to practice array based backtesting. I was able to calculate my PnL by subtracting the "close" from the "buyPrice&...
0
votes
1answer
23 views

When backtesting Nikkei225 futures with market orders, how many points to account for eventual slippage and trading costs?

I want to backtest a strategy based on Nikkei 225 futures (preferable at the Singapore exchange). I am using market orders for entry and exit. Although I now that theoretically market orders for a ...
0
votes
0answers
12 views

VaR Back testing using Christoffersen and negative likelihood ratio (Excel file attached)

In order to backtest a VaR using the independence test of Christoffersen (1998) I calculate the following likelihood ratio (LR): My problem is that I land on a negative LR and: I don't know why this ...
1
vote
1answer
74 views

modelling FX with crosses: USD conversion on entry and exit, or just exit?

I am backtesting a model that trades currency crosses (i.e. EurGbp) at a fixed $1 mln per trade and was curious if I need to a) account for my currency exposure to GBP on both ends of the trade or b) ...
0
votes
0answers
55 views

Quantifying Bollinger Band squeeze

I'm interested in experimenting with Bollinger Band squeezes to see if a strategy can come of it. A simple definition is a narrowing of the bands like the example below. Really, only the standard ...
0
votes
1answer
65 views

What is the formula for calculating adjusted closing price after a rights issue?

I know how to calculate adjusted closing prices in case of splits, dividends, etc but I'm not able to figure out how it's done in case of a rights issue.
0
votes
0answers
28 views

Backtesting VaR estimates

I'm going to perform a backtest on some VaR estimates (a huge sample) for a personal project. I'm wondering if the tests which are commonly used to evaluate VaR (Christoffersen, Kupiec) are in some ...
1
vote
2answers
44 views

SEC Rule 611 Trade Through (OHLC Data Distortions) - with visual example

Has anyone ever quantified or understand the impact of distortions to the High/Low of the day based on SEC Rule 611 pass through trades? These are trades that happen outside NBBO (national best bid ...
0
votes
0answers
20 views

Testing VaR accuracy on a large series of data

I'm going to perform a backtest on two VaR models on a very large dataset (+50.000 values). Normally, I would use the Christoffersen LR test but in my case, due to the very large number of observation,...
3
votes
1answer
144 views

Are momentum returns negatively skewed?

In the academic literature, I found that momentum returns are negatively skewed (e.g. Daniel and Moskowitz, 2002). As far as I understand, this usually happens when the "past losers" rebound ...
0
votes
0answers
155 views

Easiest possible way to backtest a semi dynamic options strategy

I have a few options strategies Id like to backtest and I have some familiarity with Python. In particular Id like to backtest a "semi-dynamic" long vol. strategy putting on $0$ cost ...
0
votes
1answer
37 views

Comprehending Corr heatmap from multiple trials of investment strategy (Paper)

Can someone please explain the heatmap of Corr from backtests in this research paper ? A Data Science Solution to the Multiple-Testing Crisis in Financial Research - Lopez De Prado (2019) - (Exhibit #...
1
vote
1answer
51 views

How to combine different strategies in a backtest (and IRL)

I am trying to combine long and short strategies into an L/S strategy in my backtesting program. The way I have my backtester set up is it takes a signals object (...
2
votes
1answer
113 views

Backtesting short-selling strategy using pandas dataframe

I would like to make a simple backtest for one of my short-selling strategies. I am using pandas dataframes. So I have a dataframe like the following, that indicates how many positions to open/close ...
0
votes
1answer
69 views

Do I use the bid or ask time series to build a model to predict forex and for a backtester

In my tick feed I get real-time bid and ask prices like below from oanda. My question is this. Lets assume I build a time series model to buy eur/usd in the Oanda UI manually. If I were to build ...
1
vote
0answers
25 views

Multivariate combinatorial purged cross-validation

Combinatorial purged cross-validation (CPCV) is a technique for backtesting strategies while purging and embargoing observations in a time series. CPCV improves upon classical k-fold and walk-forward ...
0
votes
1answer
119 views

How to test signifcance of a sharpe ratio

Let say you have measured a Sharpe Ratio of $S^*$. What is the simplest way (ie no fancy distributions) to do a hypothesis that this is different from $0$? So $H_0: \text{ The sharpe ratio is equal ...
0
votes
1answer
92 views

What’s the best Backtest Software/method? [closed]

I have a CSV which looks like this. Ticker | Buy Date | Sell date AAPL | 2018-01-03 | 2019-03-30 TSLA | 2019-03-01| 2019-04-05 What’s the best way to backtest this CSV performance given that ...
1
vote
3answers
193 views

CAPM and Beta: problem with regression (Beta is too low yet statistically significant?)

I have two time series of daily return calculated as $\frac{Price_{t}}{Price_{t-1}} -1$. One is the daily returns of a portfolio, the other the daily returns of the index (MSCI World). Period is 2020 ...
0
votes
0answers
33 views

Backtesting conditional VaR

I'm writing a thesis about conditional VaR of Standard & Poor's 500 index. I have fitted my log-returns with GARCH(1,1)-proces and then made some conditional VaR-forecast (500 observations) with ...
0
votes
1answer
91 views

Which metric is most predictive: Mean, Sharpe, Calmar, …?

Suppose you have created a new trading algorithm: by varying the params of the algorithm, you get a large number of similar trading strategies (e.g. slightly different trigger thresholds, stop loss ...
0
votes
2answers
96 views

How to deal with missing returns?

I'm backtesting a strategy that forms stock portfolios on a monthly basis. It sometimes happen that a stock chosen on month t does not have return data on month t+1, so I can't correctly calculate ...
0
votes
1answer
77 views

backtest VIX term structure strategy [closed]

I'm trying to implement a few simple VIX strategies (1/0/-1-signals based on MA crossover, term structure, hvol vs ivol) in Python. I am new to quant and volatility, but looking at the VIX properties ...
2
votes
4answers
192 views

Identifying “logical” segments on trading charts

The chart below is the 15-minute EURUSD from earlier today. The blue lines represent dividers between three subjective but reasonable segments that can easily be made out by the eye. I would ...
0
votes
0answers
59 views

What are the best metrics to evaluate an ML algo backtest, other than the nominal returns?

I have designed an algorithm that uses Support Vector Machines to classify the next day's price movement for several prominent cryptocurrencies on a ...
1
vote
0answers
23 views

Is C(P)CV similar to boostrap?

I am writing to ask if the Combinatorial (Purged) Cross-Validation" method of Marcos Lopez de Prado's "Advances in Financial Machine Learning" book is similar to the idea of bootstrap. If not, what is ...
0
votes
1answer
122 views

Accurate model but execution in backtesting is losing money

I have a binary classification model that predicts BUY (1) and SELL (-1) with an out of sample F1 score of 71% (precision is 65% and recall is 80%). The model's output is a probability of a BUY label ...
2
votes
1answer
69 views

Backtesting with a walkforward approach

I am setting up a backtesting using a walkforward optimization model to find out if a trading strategy performs well or not and I would like to clarify some doubts: First of all what is the correct ...
0
votes
2answers
316 views

Hedge backtesting: ex-ante Beta vs observed Beta (is this even possible?)

A global equity portfolio has for objective to outperform a benchmark (MSCI World). I hedge the sensitivity of the portfolio to MSCI World (the beta) so that only the alpha remains unhedged. The ex-...
1
vote
1answer
67 views

Most profitable PUT strike price in these times of high volatility?

At close 3/13/20 SPY was at 270.2, by close 3/16 it dropped to 239.41 ~ 8.8% drop... I'm looking at how to capitalize on these big swings with options. I'm backtesting option strategies and plotted ...
0
votes
1answer
47 views

TS Database performance issue

I've just found out about this forum while searching for answers for an InfluxDB performance "issue". I'm using it to store financial tick data (7 fields per row), query it and process it into candles....
9
votes
2answers
552 views

Suppose that we are wrong about the relevant class of distributions for financial economics and econometrics. Now what?

I read a very interesting paper by Harris (2017) where he points out some interesting link between market microstructure and the distribution of returns on equity. You can make a good case that the ...
0
votes
0answers
20 views

Grade system for backtesting key figures

I want to backtest my trading algorithm. The algorithm trades on a low timeframe with 400 “unique” trades. With unique I mean that it can place 1 or more of those 400 trades given different market ...
1
vote
0answers
313 views

Kupiec Test Backtesting VaR

I am currently analyzing the Kupiec test used for backtesting $VaR$. Suppose that I backtest a $VaR$ system for $n$ days (for example 250), with a confidence interval of $1-\alpha$ (for example a $1-\...
0
votes
0answers
38 views

Look-Ahead Bias in determining rebalancing periods for a momentum strategy

Let's say I have an investment universe consisting of equities in SP500 at time t, and that the universe changes at each t+1. I.e. at time t you can only invest in an equity that is in the SP500 at ...
5
votes
4answers
691 views

Backtest overfitting - in-sample vs out-of-sample

Recently, I read a great paper by De Prado et al. on backtest overfitting problem in Quantitative Finance titled Pseudo-Mathematics and Financial Charlatanism: the Effects of Backtest Overfitting on ...
3
votes
0answers
92 views

Realistic Modeling of Capacity in Backtesting a trading strategy

Typically the backtest of a quantitative trading strategy assumes a fixed period and fixed capital at the start to backtest a strategy. However, each strategy has a capacity (due to non-linear trading ...
0
votes
0answers
37 views

How to calculate RSI if the available data has missing values in between?

I have to calculate RSI for a dataset which consists of the Open-High-Low-Close Prices of 2-second candlestick of an instrument for a period of 5 days.It contain some missing values in between.how ...
0
votes
0answers
29 views

Adjusting backtest results for number of parameter sets tested

One can test a moving average crossover system that is long the asset when the N-day moving average is above the M-day moving average and short otherwise. If N and M are both allowed to be integers in ...
0
votes
1answer
79 views

Dealing with delisting during backtesting

I tried to do simulation as accurate as possible because my life will depend on it. I looked at backtesting results and I found that there were situations that the program bought stocks but it ...
1
vote
1answer
482 views

Difference between cross-validation, backtesting, historical simulation, Monte Carlo simulation, bootstrap replication?

To determine if a strategy is better than others, or to optimize the parameters of a model, the following statistical techniques are often employed, often one over the others instead of altogether. ...
0
votes
1answer
139 views

How to validate trading strategy performance

I'm backtesting some algorithmic trading strategy based on the buy/sell signals: To validate the strategy performance I compare it against the buy-and-hold strategy of the same asset and calculate ...
1
vote
1answer
126 views

Proper Data Partitioning For Building a Forecasting Model

Goal: A team and I are looking to build a model that performs a predictive action for the state of the market on day T + n, using the data at hand on day ...
0
votes
0answers
63 views

Testing Option Strategy

I have a long only momentum system that has back tested well and live results have been ok. I would like to see if I can use these signals to sell Puts to see if it improves results. Not looking for ...
2
votes
4answers
218 views

Survival bias when backtesting

I have been doing backtesting, and I am seeking to see if there are any flaws in my program, as it seems to be too good to be true. Based on stocks with market capitalization of > 10B, go back in ...
1
vote
2answers
191 views

Live trading strategies developed on daily data

This is a very simple perhaps naive question. Let's say I have a stock price prediction model trained on daily closing prices of that stock. So when I use this model for live trading, I'll have ...
0
votes
1answer
98 views

Adjusting volatility while constructing portfolio

I am trying to construct a portfolio based on a macro momentum strategy for backtesting purposes as outlined in https://www.aqr.com/-/media/AQR/Documents/Insights/White-Papers/A-Half-Century-of-Macro-...
2
votes
0answers
84 views

How to backtest algorithms in parallel?

I want to backtest a large number of algorithms on the same dataset, one stock ticker. The algorithms are actually variations of one algorithm with various combinations of parameters, amounting to ...
-1
votes
1answer
97 views

Backtesting a stock scoring model

I'm working on a simple stock scoring model consisiting of 3 factors: 1.market cap 2.liquidity of the stock 3.the value at risk we defined 3 intervals for each factor and we assigned the ...

1
2 3 4 5 6