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
20 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 ...
4
votes
4answers
157 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 ...
2
votes
0answers
68 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
26 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
23 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
69 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
229 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
107 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
89 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
56 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
180 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
144 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
85 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
72 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
18 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
82 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
74 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
67 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
77 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
1answer
183 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
66 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
226 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 ...
0
votes
0answers
16 views

Walk-Forward Analysis: Sensitivity of Result w.r.t. shift in train/testing windows

I currently test numerous Trend-Following/Momentum and Mean Reversion trading strategies for cryptographic assets with granularities ranging from daily to 3 hourly spaced data points. The general set-...
0
votes
0answers
39 views

How to backtest a sample of trades to optimize stop loss on losing trades and profit targets on winning trades?

I have a history of hundreds of executed trades. Given those trades, I want to know if there's a tool or framework that can help me figuring out: What would have been the most cost efficient stop ...
2
votes
2answers
77 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
48 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 ...
0
votes
0answers
32 views

Entry price to consider while doing a forward/backtest test?

1 min timeframe signal generation. Thing I have considered: 1 - Close price can be predictive in nature Counter: shifted the ...
0
votes
0answers
55 views

What are your favourite benchmarks for signal (pre-trading strategy) backtesting?

In some situations, e.g testing the value of individual signals to be built into an ensemble method, it can be a bit too early to implement trading logic for the strategy needed to do a standard ...
1
vote
2answers
207 views

Why do we need event-driven backtesters?

I am reading this article at quantstart regarding event-driven backtesters. It seems to me that the main advantage of using an event-driven backtesters is that it avoids look-ahead bias. Usually I ...
1
vote
1answer
76 views

In-sample and out-sample backtest performance, how to do this?

I have a strategy in development that I am backtesting to optimize for parameters, a total of N combinations. Trying my best not to overfit. I run the first backtest for the in-sample period and I ...
2
votes
0answers
62 views

Mean directional accuracy and zero

I'm trying to use mean directional accuracy to evaluate my directional predictions in back-test, but it can't deal with realised directions which are 0, due to the comparison of the signs of ...
2
votes
0answers
123 views

In sample and out of sample in Mean Variance Optimization

Hello to everyone and thanks again for your help, i have find this forum really helpful while working on my final dissertation. However I'm here again because I have loads of doubts regarding the in-...
2
votes
0answers
107 views

how to avoid building a strategy that depends on very long trends

When I construct a strategy, it is easy to make subtle dependencies on trends that have existed for a long time. Sometimes it is legit to explicitly take advantage of the trends. For example, it has ...
1
vote
2answers
87 views

Lower MSE results in less profit when using Machine Learning

When using Machine Learning for predicting stocks, can a lower Mean Squared Error result in less profit after Backtesting or is there a mistake in the experiment?
0
votes
1answer
65 views

DATA for Backtest [duplicate]

I am a retail trader and i am looking for a data set that comprehends all us equities, ETF's, ADR's and indices going back at least to January 1st 2007. Data would need to be split + dividend ...
1
vote
1answer
80 views

Backtesting model results, but backtesting output sampled at different frequency than model output

So, I'm trying to backtest a model that computes P&L. This model pulls sensitivities on a weekly basis and applies market shocks to these sensitivities to project quarterly P&L. I want to ...
0
votes
1answer
206 views

stress testing zero coupon yield curve

i'm currently trying to stress test the zero coupon yield curve using daily observations from 2003 to 2019. Each Zero coupon yield curve originate from an actuarial curve with 37 tenors that range ...
3
votes
2answers
108 views

Compare two distributions for forecasting returns

Let's imagine that we have two separate models, both used to forecast the return for the next period. Both models are estimated everyday, and both models outputs a probability distribution. How can we ...
1
vote
1answer
122 views

Which data provider do you recommend? [duplicate]

i need to run optimization models and backtests on developed market equities. I have access to Refinitivs Eikon, but it doesnt have a backtest tool and downloading the data is a challenge on his own. ...
1
vote
1answer
146 views

How to take back-tested code and convert it to forward-testing code? (in Python)

How do you take back-tested code written using the zipline API and convert that into forward-testing code using the IB API (or better yet ib-insync API)? It seems like you would have to completely re-...
1
vote
1answer
331 views

Is studying R quantstrat worth the effort for an individual trader? [closed]

I see at least two problems. The R package quantstrat is poorly documented. And one must have dividends adjusted data. Otherwise the test results will be irrelevant.
1
vote
0answers
342 views

Why “profit factor” is used to compare trading strategies?

A lot of books/articles/trading forums mention that "profit factor" is probably the most important measure and should be used to compare different trading strategies. They define profit factor as ...
0
votes
1answer
217 views

R: backtesting with path dependencies

I have a historical PMwR journal of trades (one for each side of position open/close) in R. I wish to backtest trade sizing algorithms, one of the inputs to which calculation will be, on-the-day ...
2
votes
2answers
202 views

Cumulative Return on Futures

In my current backtesting, I am using log returns as a proxy for simple returns via the relationship $\ln(1 + r) \approx r$ for small enough r. This gives me wonderful properties like time additivity, ...
3
votes
1answer
406 views

Option Strategy: Python Implementation Advice

I've been tasked to create and backtest an option strategy. The strategy, in vague terms, is to essentially write call options on securities in a universe, i.e., selling insurance. I have an idea of ...
1
vote
0answers
39 views

forex backtesting spread cost modeling

For professional level forex trading, what is a reasonable estimate of roundtrip transaction costs (I am talking about major pairs, like EUR/USD).
1
vote
3answers
1k views

Is there a python library to generate performance metrics from returns of the strategy?

I am backtesting a strategy and have data generated from the returns of the strategy. Now I need performance metrics like maximum drawdown, Sharpe ratio, Treynor measure etc., I am writing functions ...
2
votes
1answer
99 views

Assessing goodness of a Technical Trading Rule using a ROC model

I am testing various technical trading rules (TTR) on the cryptocurrency market. I have already setup some significance tests, to compare the returns and volatilities. I would now like to test it ...
2
votes
4answers
561 views

Backtesting Fundamental Equity Strategies in Python

I am trying to run a local backtest using Python and Zipline seems to be the most popular package out there. Does any one have isnight on ingesting fundamental data for the backtest? The documentation ...
1
vote
0answers
118 views

Modelling VIX futures backwardation

I have VIX futures trading algorithm and would like to perform Monte-Carlo simulation of VIX and understand how my algorithm performs on each simulation. In this case, not only VIX should be modeled, ...

1 2 3 4 5 6