Questions tagged [backtesting]
The process of evaluating a strategy, theory, or model by applying it to historical data.
362
questions
1
vote
1
answer
69
views
How does one calibrate lambda in a Avellaneda-Stoikov market making problem leading to Gueant-Lehalle-Tapia model?
The title is similar to that of the question I was referred to here which has been answered by Lehalle himself!
I'm trying to implement the Gueant-Lehalle-Tapia model which is how I got to this answer ...
0
votes
0
answers
49
views
Adjusting the p-value of a strategy for number of parameters
Let's say I have some metric and I'm trying to evaluate whether it's predictive with respect to returns. I plan to only take trades where the value of the metric is above a certain threshold, such ...
0
votes
0
answers
50
views
Backtesting: choosing the "sample split" between in-sample and out-of-sample data
Aims:
Given approximately 11 years of historical time-series data, to determine how much of this data should be reserved for in-sample and ...
0
votes
0
answers
50
views
OLS estimation for ornstein uhlenbeck process
I am reading the following paper. In particular, in section 4 - numerical determination of OTRs, it mentions applying Ordinary Least Square on Eq(5). However, what I don't know is whether ${P_{0,0}, ...
0
votes
0
answers
105
views
Backtesting One-Factor HJM model with selling European Receiver Swaption
I am attempting back test the performance of a model - namely the Musiela equation used to model instantaneous forward rates with constant time to maturity:
$$r(t,x)=r(0,x)+\int_0^t\left(\frac{\...
0
votes
0
answers
79
views
Pairs trading back-test in python
I've been working on this code for weeks now, and I'm still not convinced by the results. I think there's a problem with the computation of the profit and loss, but I'm not sure. I would love some ...
3
votes
1
answer
117
views
Is there an encyclopedia of peformance/risk measures for backtests of strategies?
Analysing a backtest of a strategy i.e., a series of returns of a defined period we can consider various metrics such as the Sharpe-ratio or more exotic ones like the Omega-ratio. What I was wondering:...
3
votes
0
answers
106
views
How to take into account transaction fee of a backtest from a list of returns?
I have a list of booleans that correspond to buy and sell signals that I would like to backtest. To achieve this, I calculated the return ret of a security and when ...
0
votes
1
answer
157
views
Using bid and ask prices with VectorBT library
I am creating a backtest using vectorbt library. This is my function for all the portfolio metrics:
...
3
votes
0
answers
175
views
PBO algorithm "The Probability of Backtest Overfitting" paper
In this article by Lopez de Prado et al., an algorithm was proposed for assessing the overfit of a trading strategy:
The Probability of Backtest Overfitting
There is also a package for R:
pbo: ...
1
vote
1
answer
201
views
what are the packages for effective backtesting in R
I need a fast package for backtesting in R. I'm going to optimize a lot so I'll be running my strategies many millions of times.
I know about packages like ...
0
votes
0
answers
80
views
Any document about general backtesting algorithm and data structure
(Note there are similar questions, with different focuses at this forum, but my focus is more on the general concept, if any, about backtesting (for stocks) and sources of information where I can go ...
-2
votes
1
answer
306
views
Is C++ suitable for writing backtests
I'm looking for a library like BackTrader or platform that is written in C++ for backtesting.
Is C++ a good choice to write a backtester and are any available?
1
vote
1
answer
149
views
Figuring out how TradingView calculates the Sharpe ratio [closed]
This is the simplest backtest I've come up with, yet I can't figure out how TradingView has calculated the Sharpe ratio to be 0.577. I've set the risk_free_rate=0. Is it possible to extract the ...
0
votes
0
answers
53
views
Does Backtrader and QuantConnect collect any data?
Building an API that integrates with backtrader and QuantConnect to run some backtests. I'm passing in machine generated data and I just want to make sure I'm not sending them too much stuff.
so what ...
2
votes
1
answer
109
views
Fatigue with Historic Backtesting - Alternatives?
It seems to me like historic backtesting is the best of bad options out there for me to test my systematic strategies - even ones that are more macro-level trend spotting. I can't test enough ...
3
votes
1
answer
259
views
Proper way to backtest strategy using bootstrap method
Should I back-test in a single (original) price series and bootstrap the strategy returns to get statistics of interest?
Or should I create bootstrapped price series using bootstrapped returns from ...
1
vote
2
answers
157
views
VaR backtesting. Reasons for over- and underestimation of value at risk estimates?
I use an ARMA-GARCH model for univariate distributions and a copula model for the multivariate distribution. For the value at risk (VaR) estimation, I do a Monte Carlo simulation. I'm looking for some ...
3
votes
2
answers
184
views
Detrending price series for back testing
If I am testing a trend-following strategy, should I detrend the data before applying the rules or should I generate signals based on the original price series but use detrended data for performance ...
0
votes
0
answers
33
views
Using different historical data from different brokers during backtesting
Since different brokers and data providers might apply their own additional offsets to the spreads of the same instruments, what are some concerns that might rise if we merge their data to create a ...
0
votes
0
answers
91
views
Comparing the performance of portfolio optimization methods
I am trying to compare the performance of the compositions of a single portfolio determined by unconstrained mean variance optimization, minimum variance optimization (expected returns equal to 0 in ...
1
vote
0
answers
85
views
Interest Rate Calibration and Backtesting under Fed's raising rates 2022-2023
With the Fed raising interest rates so fast and so drastically, classical interest rate models such as the Black Karasinski (BK), Hull-White (HW), etc., may have trouble calibrating to current rate ...
0
votes
1
answer
83
views
Validation set on Walk Forward Analysis
When backtesting a trading strategy using Walk Forward Analysis/Optimization, I see people split each window into training and testing sets.
Suppose you want to select the best combination of MAs for ...
3
votes
1
answer
382
views
Backtesting with limit orders using tick data
I have full order book data and I am writing a backtest for limit orders (to launch a new position not perofit taking or stop loss). I notice that this is actually a lot more difficult to write than a ...
2
votes
0
answers
71
views
Why is the expected shortfall not elicitable? [duplicate]
Can someone pls provide an intuitive explanation of why expected shortfall is not elicitable and thus why it is challenging to backtest it?
I have read the following clear definition of elicitable ...
1
vote
1
answer
388
views
Suggestions for backtesting machine learning 'model'/strategy in Python
I have coded a machine learning algo (sklearn) in Python, that uses different 'look back periods' for training a model, which is then used to predict future prices of a stock.
It has a 52% accuracy in ...
0
votes
1
answer
109
views
How to backtest a strategy with irregular in-out signal?
Hi I'm currently backtesting an event-driven strategies. Unlike factor strategy which has a regular rebalancing interval, event-driven strategy is conducted whenever there is an event.
Since we do not ...
4
votes
2
answers
246
views
Backtesting vs live trading data handling and abstraction
I'm an individual trying to build a trading system which will ideally be eventually scalable to 1-15 second resolution intraday trading strategies. I'm having some trouble understanding the difference ...
2
votes
0
answers
47
views
Do you roll back the maturities and schedules when backtesting VaR for portfolios of bonds, options or future contracts?
I want to backtest VaR models which are applied to portfolios of products which have maturities (options and futures) and even schedules (bonds). I have a question which never came up when backtesting ...
0
votes
0
answers
256
views
How to vectorize stop loss in backtest
I am building a custom vectorized backtester in python using pandas.
My problem is that the entry and exit signals are independent and can occur at the same time making it difficult to create a single ...
3
votes
1
answer
417
views
Paper on returns from perfect market timing?
I'm looking for a (free) paper I read which showed that even a "perfect" market timing strategy wasn't very good compared to buy-and-hold. There were some restrictions to the timing, ...
2
votes
1
answer
180
views
"Backtesting" from trading signals and historical prices not functioning properly
How does one go about properly backtesting and visualising their strategy using their trading signals and historical prices where the trading signals are 1 for long, 0 for no position -1 for short?
...
1
vote
2
answers
250
views
What was the lowest traded price of Paladin Energy on 2020.03.23? Every source disagrees, then it gets even weirder
I am looking at the stock PDN (Paladin Energy) on ASX (Australia Stock Exchange), and I am trying to determine the lowest price traded on the date 2020.03.23 (YYYY.MM.DD). Should not be such a ...
7
votes
4
answers
2k
views
Backtesting using microstructure (orderbook) data
I would like to use tick data (especially order book data; but also trade) to backtest my strategies, can anyone offer a recommendation? Personally, I've written my own backtesting scripts couple of ...
0
votes
0
answers
85
views
Theoretical returns are not matching empirical ones in my backtest
I'm trying to implement a Backtest for my quant strategy but the calculated theoretical returns are not matching the returns from my implementation. Here's the example:
On a given day I have 1 million ...
2
votes
3
answers
642
views
Backtesting Option Strategies with IV Data Only
I’ve tried to find a good answer for this but had no luck so I’m bringing it here: potentially beginner question, but how much accuracy would I be sacrificing by backtesting an options strategy with ...
0
votes
0
answers
97
views
how to adjust very old stock price correctly
lets say that i have a file stating a stock and the price which someone paid for it and the date.
for example: apple (AAPL) 422$ 15/11/2011.
now apple have gone through many splits and possibly public ...
0
votes
1
answer
102
views
Where can I find historical daily market prices for long term treasury bonds? [duplicate]
I want to backtest some portfolios that involve leveraged long term treasury bond funds like TMF, at least as far back as the 1970s. Since there does not seem to be any T-bond ETFs with history going ...
0
votes
1
answer
206
views
Workflow in algorithmic strategies
Sorry for the basic question, I'm trying to educate myself on algorithmic strategies.
Just to see how it works, my idea is to create a simple moving average strategy.
Let us suppose I have $N$ ...
1
vote
0
answers
125
views
Normalized statistical risk/reward measures to compare different quant trading strategy's returns, eg for backtesting
Want to select a metric or metrics to compare returns of different investment strategies, for quantitative backtesting, strategy selection, and forward measurement.
Been reading different approaches ...
1
vote
1
answer
961
views
Backtest: Fast Reconstruction of Order Book using Order Creation/Completion Data in Python
I am looking for a quick way to reconstruct the order book at the time of each new limit order creation.
The data I have is order creation and completion:
OrderID
time_created
time_completed
price
a
...
-2
votes
1
answer
346
views
How to calculate return on a series of long position for each price point
The return between two price points can be calculated as Price(present)/Price(previous) -1
Or, it can be expressed as ...
1
vote
0
answers
110
views
Backtesting - treatment of holidays for global (i.e. multi-market) portfolios
Assume a daily trading strategy where each day we rebalance our portfolio weights:
Situation A: all constituents of our portfolio are from the same market (e.g. a portfolio of S&P 500 stocks)
...
0
votes
1
answer
109
views
Out of Sample Results Decay Rapidly With Prediction Window or Embargo
So I am beginning to dabble my toe into quantitative finance and am trying to validate some model results and am having difficulty thinking about what they tell me.
Here's my situation: I'm trying to ...
3
votes
1
answer
408
views
backtesting guide for research
I am a master student in finance and I am working on my portfolio management thesis. Within my thesis I will have to backtest a portfolio strategy for a balanced portfolio.
I am looking for a guide/ ...
0
votes
2
answers
786
views
Continuous futures data roll adjustment
When I construct continuous futures data (Wheat futures for example), I get different results than barchart or tradingview. Examples below. The 1st image is my adjusted continuous data and the 2nd ...
1
vote
1
answer
349
views
Alternatives to RDBMS for options backtesting
I've assembled a large dataset (~2B+ records) of options price data in MySQL for backtesting purposes.
At a number of points, due to the sheer amount of data being retrieved and filtered, processing ...
2
votes
1
answer
1k
views
python library for backtesting buying and selling multiple cryptos
What is a good python backtesting library to use if I want to test buying and selling a list of different cryptocurrencies every day? Most libraries I find like backtesting.py and pyalgotrade are ...
1
vote
1
answer
343
views
How to conduct statistical test to see if certain factors impact trading streategy
Since the seminal paper by Fama and French(1993) that uses size, market, and value factors to explain extra market returns on the equity market, people have conducted tons of research on equity factor ...
0
votes
1
answer
1k
views
Is there a Python package that implements backtesting for VaR?
I would like to use the tests of Christoffersen (1998), Engle and Manganelli (2004) or Kupiec (1995) to evaluate how good are the VaRs that I have projected. Is there a library that implements these ...