Questions tagged [backtesting]

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

Filter by
Sorted by
Tagged with
3
votes
1answer
119 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 ...
-2
votes
0answers
39 views

Real Commission Scheme - Backtrader

I built a Machine-Learning based trading strategy that consists in rebalancing the portfolio of S&P 500 stocks quarterly and I want to backtest my trading strategy using the Backtrader library in ...
0
votes
0answers
132 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
35 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
40 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
98 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
64 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 ...
0
votes
0answers
18 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
112 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
86 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
146 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
87 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
83 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
64 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
3answers
160 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
55 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
22 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
114 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
64 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
208 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
64 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
46 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
535 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
19 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
226 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
35 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
473 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
90 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
35 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
78 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
390 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
134 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
122 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
214 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
188 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
97 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
83 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 ...
0
votes
0answers
24 views

Zipline calendar spanning multiple days

I am trying to back test an algorithm using zipline and need to build a zipline calendar that maps to my brokers opening hours. My broker (FXCM) opens on Sunday at 17:00 and closes on Friday at 16:55. ...
-1
votes
1answer
95 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 ...
0
votes
0answers
135 views

Which Python or C# backtesting framework supports multi-asset?

Is there any backtesting framework written in C# or Python that supports multiple assets? I'm trying to backtest a pair trading strategy that requires to
1
vote
1answer
83 views

How to build a loop function for out-of-sample backtesting?

Many statistical libraries in R offer the possibility to fit a model and then use the results of optimization to predict values some periods ahead. However, many do not have the possibility to ...
0
votes
2answers
129 views

How do you simulate pseudo-realistic ask/bid quotes given a history of 1m OHLC candlesticks?

I'm currently backtesting and livetesting a RL-based system using the close of the last 1m bar as both ask and bid. While results are excellent, this is not a very realistic arrangement. In the ...
4
votes
3answers
304 views

What are the best free software for backtesting?

I am running a project to compare features of different backtesting software. A viewpoint to touch is on whether pricey software come with better characteristics/results thus justifying a higher ...
2
votes
2answers
71 views

How to estimate the probability of Clustering illusion in our backtest result?

Suppose I have a strategy, I run a backtest on it in only one symbol (suppose the historic data to backtest is 25000 candles). The results of that backtest is: Total Trades = 50 TakeProfit/...
5
votes
0answers
626 views

How to calculate average entry price for perpetual swap contracts?

I'm trying to calculate the average entry price for perpetual swap contracts for use in back-testing a trading strategy, as per Bitmex's documentation: A Perpetual Contract is a derivative product ...
2
votes
2answers
78 views

How does duplicate data affect backtesting?

Before developing a trading strategy, one should clean and preprocess his data set. It is very common that a data set contains huge number of duplicates. Question: How does duplicate data affect ...
0
votes
0answers
49 views

Calculating a trading profit rate

I wanted to chek my backtester engine, so I opened a tradingview account and I ran the same test. All buy and sell numbers, prices, dates, indicator calculation, etc were exactly same, but profit ...

1
2 3 4 5 6