Questions tagged [backtesting]
The process of evaluating a strategy, theory, or model by applying it to historical data.
344
questions
0
votes
0
answers
60
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
53
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
30
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
189
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 ...
0
votes
0
answers
66
views
Backtest | Annualized Return
please excuse my ignorance - it has been a long time since I did something like this.
I am trying to calculate an annualized return for a backtested portfolio that I am rebalancing. In my mind, I have ...
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
264
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
78
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
176
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
39
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
185
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
407
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, ...
0
votes
0
answers
145
views
deribit Open Interest historical data
to fetch Deribit live Open Interest data, I can use their API or do so via ccxt.
However, if I want historical OI data, where's the best place to do this? This is for back testing purpose, with ...
2
votes
1
answer
144
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
237
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
1k
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
79
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
384
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
76
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
78
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
186
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
95
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
712
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
...
-3
votes
1
answer
225
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
99
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
99
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 ...
2
votes
1
answer
316
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
1
answer
279
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 ...
0
votes
1
answer
245
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
732
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
221
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
868
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 ...
0
votes
0
answers
47
views
increasing leverage does not increase MDD(maximal draw down) proportionally?
I thought increasing leverage by x times will increase mdd x times.
But it actually increases mdd by y which is smaller than x.
Is it always the case?
If so, because leverage increases compound ...
8
votes
1
answer
334
views
Why is it wrong to rank stocks by P/E ratio, sell the top quartile, and buy the bottom quartile?
I am reading Advances in Financial Machine Learning by Marcos López de Prado. In chapter 11 The Dangers of Backtesting, exercise 11.5 asks:
We download P/E ratios from Bloomberg, rank stocks every ...
0
votes
1
answer
337
views
Include Dollar Cost Averaging Strategy in BT python
I am using bt backtesting to test between an initial lump sum into 'ETH-USD' and a dollar cost average approach. I will then look into a different mix of equally weighted crypto.
What I like about bt ...
0
votes
0
answers
225
views
Calculating Rolling P&L of Trade Log
I have an extensive trade log of historical buy and sell orders and I am trying to calculate the running p&l of the trading results. Most rows represent partial fills where there is still a ...
5
votes
1
answer
511
views
why does Cross Validation *not* solve Backtest overfitting?
In this famous paper, Bailey and De Prado discard Cross Validation as tool to check for Backtest overfitting, on the ground that it is just an holdout method:
... If we apply the holdout method ...
3
votes
0
answers
149
views
How to backtest multilegged options strategies?
I have got historical data for the index options. Now I am looking at backtesting some of my strategies with this historical data. I would like to backtest strategies like selling a straddle and ...
0
votes
0
answers
925
views
Train/test: why 80:20 split performed better than 90:10 split?
Playing with Random Forest Classifier, I am wondering what could cause in a 80:20 split the test results to perform better than in a 90:10 split?
With 2000+ data points and:
with 80:20 split, ...
0
votes
0
answers
183
views
Historical ISM report on business?
Is there any place to download historical ISM ROB (report on business)? The website only shows current and previous month. ISM ROB
0
votes
1
answer
171
views
Understanding Look Back Period
When people say look back period of 6 months, how does that data look like? Are that 6 months of raw data or a weighted average of that data? I am a little confused on how you come up with beta values ...
0
votes
3
answers
786
views
Where can I find complete historical lists of companies on major US exchanges for backtesting?
I am backtesting a trading strategy on historical US stock data. I'm currently sourcing data from S&P's Capital IQ. I have no trouble getting stock price data for a specific company. I also have ...
2
votes
0
answers
75
views
Backtesting of outperformance of a benchmark using the Deflated Sharpe Ratio
I want to test whether, let's say, strategy A outperforms strategy B.
In Marcos López de Prado's book Advances in Financial Machine Learning he presents the following statistics:
The Probalistic ...
2
votes
1
answer
291
views
Algorithm / source to calculate historical expiry dates of futures
I can find several source on this site where to find expiry dates of coming futures contracts.
I am looking for a (e.g. Python) algorithm or a data source where I can find historical dates when a ...
1
vote
0
answers
187
views
How to backtest with fixed-income instruments
I'm running a backtest with the 5-yr and the 30-yr treasury bills going back to 1990, both with a weighting of 25%. How do I use their daily yields to adjust the portfolio through time?
I've thought ...
0
votes
0
answers
44
views
Where to find Historical price data (csv preferable) for global Gov bonds and markets. All dollar denominated?
I'm doing a lengthy backtest on a certain portfolio and i've managed to get FTSE 100 data going back to 05-30-1990, where could I find data for global Government bonds going back to that date?
A csv ...
1
vote
0
answers
93
views
Spread betting risk management in backtesting in Python
My background is in Spread Betting. I know how to calculate my position size based on how far away my stop is from my entry, I calculate the amount per pip so that I only ever risk a fixed percentage ...
4
votes
0
answers
142
views
Finding optimal calendar spreads and diagonals
I am looking for some pointers on risk/return profiles of calendar spreads and diagonals with different strikes and expiration dates, preferably based on historical backtests with SPY options.
Please ...
0
votes
0
answers
92
views
Starting out with back testing
I am new to quant, but have skirted around the various competencies required. I have a couple of engineering degrees; a masters in finance, and I also work as a relationship director in a commercial ...
0
votes
0
answers
78
views
Backtesting a permanent portfolio
I'm looking to backtest this portfolio: Global Bonds, gold, Global Stocks, short-term t-bills (1/4 each) from 1990 up to this year, rebalanced monthly. Then take a variety of statistics on the time ...