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
1answer
46 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
16 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
106 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
71 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
129 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
29 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
82 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
75 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
51 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 ...
1
vote
1answer
112 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
50 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
19 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
96 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
61 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
85 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
62 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
43 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....
8
votes
2answers
501 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
116 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
29 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
300 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
84 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
33 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
77 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
331 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
125 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
103 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
207 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
181 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
94 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
77 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
23 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
92 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
122 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
80 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
107 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
210 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
70 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
520 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
17 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
41 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
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 ...
0
votes
0answers
35 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
59 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
435 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
82 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 ...

1
2 3 4 5 6