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
100 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
0answers
72 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
0answers
56 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
0answers
106 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
1answer
72 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
1answer
39 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
0answers
31 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 ...
0
votes
1answer
56 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
0answers
51 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
0answers
35 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 ...
0
votes
0answers
29 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
0answers
109 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
0answers
76 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
0answers
50 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 ...
1
vote
0answers
35 views

Exchange order matching system/core for local testing

I am looking for a service that can be deployed locally or connected to it and would emulate the order matching system of exchange (a.k.a matching core). I remember, that I have seen on GitHub repo, ...
0
votes
3answers
82 views

Historical Ticker Symbols Data Source (for Creating Tradable Universe)

I would've guessed this question would have been answered somewhere on here before, but I have been going down rabbit holes for days trying to figure it out with no luck... I want to backtest ...
2
votes
4answers
199 views

Alternatives to Zipline backtester / Alternatives to futures data from Quandl

I intend to set up a fully automated system for trading equities and futures. As preparation for this project, I worked through a couple of books on the topic, e.g., "Trading Evolved" by ...
0
votes
0answers
22 views

Historical Economic Release Calendar

Does anyone know if any providers have a historical economic release calendar? For example, releases of things like ADP private employment, or ISM surveys? I ask because I would like to backtest a ...
0
votes
0answers
41 views

How to backtest using portfolio compositions in python using backtrader

I have a csv file / pandas dataframe which looks like this. It contains various portfolio compositions for different strategies. Mostly based on different optimisation methods, max sharpe, min VaR etc....
0
votes
0answers
24 views

Backtesting python libraries [duplicate]

Might there be any backtesting libraries in Python that computes the various statistics (Sharpe Ratio, Calmar Ratio, drawdown, win rate etc) given a dataframe of holdings and its holding duration (...
0
votes
0answers
40 views

Is there a way to predict backtest or walk-forward performance using linear regression results?

For the sake of example, say I regress S&P 500 returns (dependent variable) against small-minus-big market cap size (independent variable) and get a coefficient of 0.1 and an $R^2$ of 0.9. Is ...
0
votes
0answers
17 views

Backtesting multiple portfolio optimisation and trading strategies using number of stocks to purchase as input

I want to backtest a trading strategy + portfolio optimization but I have never used a backtesting program before. I am comfortable with python I think. My outputs from my trading logic (after ...
0
votes
0answers
17 views

As reported financial statements historical data [duplicate]

May I request for suggestions on data vendors for historical as reported fundamental data? For example as reported eps, as reported revenue, as reported depreciation and amortization expenses? I tried ...
0
votes
0answers
61 views

How to annualise hourly returns?

I have hourly open,high,low,close candles data for a particular asset. I wrote my own algo and some back testing code that replays the data from the past hourly candles to calculate the total return ...
0
votes
0answers
40 views

What does p-value adjustment under FWER do?

The background is I am predicting a time series with three strategies, the hypotheses is the strategies have a non-zero Sharpe ratio. I am reading Backtesting, by Campbell Harvey and Yan Liu paper in ...
1
vote
0answers
36 views

Controlling for factors that influence minimum variance optimization

I am trying to compare the performance of two minimum variance optimization (mvpo) methods applied on stocks Hierarchical risk parity (HRP) vs the analytical global minimum variance formula. I feel ...
0
votes
1answer
52 views

How to use 'purging' in predicting stock price tomorrow based on information today?

Q1. How to create an 'overlap' when we predict a stock price tomorrow based on information today? According to the book 'Advances in Financial Machine Learning' written by Marcos Lopez de Prado, the ...
1
vote
2answers
164 views

Python library for tick-based backtesting on cryptos

I saw and reviewed many python backtesting libraries - pyalgotrade, zipline, catalyst, backtrader, etc. It seems that none of the provide a straightforward way to perform "Tick-based or Multi-...
0
votes
0answers
55 views

What is a proper way to evaluate a backtested strategy if its trading asset has a strong trend?

I backtested a strategy that trades bitcoin, but I'm not sure if it's worth doing it because of the recent strong trend of bitcoin. The buy-and-hold has a better return, Sharpe ratio of the strategy ...
0
votes
2answers
191 views

Backtesting a portfolio strategy with several assets

I am aware that there exist several libraries and programs that allow to baktest a portfolio strategy by iterating through the OHLC dataframe of the stocks of interest (Backtrader, Backtesting, ...). ...
0
votes
0answers
40 views

Backtest/Capital Allocation

I am testing a series of signals in an event framework where each event is discrete with a [2] day window, for example a strategy that buys each IPO on T+1 and sells them on T+ 3..when looking at this ...
0
votes
0answers
46 views

Backtesting an algo versus testing an algo against live data, simulated data

I have a hypothesis that backtesting an algo against historic price data is not as reliable as testing against live data. My reasoning for this is based on the argument that markets are a 'random-walk....
1
vote
4answers
142 views

US Treasury - IEF vs ZN Cumulated Return Comparison

I have been trying to explore the possibility of replacing my IEF (10 years treasury ETF) positions with ZN (10 years treasury futures) for better leverage. Reading the posts here, I understand that ...
0
votes
0answers
60 views

Free Low-Resolution Backtesting

Basically, I want to start with something relatively simple: Create a total market free-float market cap portfolio in year X and check its performance over the years, where dividends are reinvested ...
1
vote
3answers
179 views

Backtesting Period Effect

I am backtesting a stock trading strategy. I tested it over two time periods: 2000-2020 and 2015-2020 and compared the results against a buy and hold strategy. To be clear, I only changed backtesting ...
2
votes
1answer
115 views

What should the look-back period be when calculating Cointegration?

So I am confused as to what the look-back period should be when calculating Cointegration. By this I mean when running for example a Johansen or ADF test, should my look-back period be 6 months?...
0
votes
1answer
58 views

Calculate daily account value & returns on trading system backtest

Quick question, I'm having a brain freeze. I've done a simple system to practice array based backtesting. I was able to calculate my PnL by subtracting the "close" from the "buyPrice&...
0
votes
1answer
37 views

When backtesting Nikkei225 futures with market orders, how many points to account for eventual slippage and trading costs?

I want to backtest a strategy based on Nikkei 225 futures (preferable at the Singapore exchange). I am using market orders for entry and exit. Although I now that theoretically market orders for a ...
0
votes
0answers
82 views

VaR Back testing using Christoffersen and negative likelihood ratio (Excel file attached)

In order to backtest a VaR using the independence test of Christoffersen (1998) I calculate the following likelihood ratio (LR): My problem is that I land on a negative LR and: I don't know why this ...
1
vote
1answer
78 views

modelling FX with crosses: USD conversion on entry and exit, or just exit?

I am backtesting a model that trades currency crosses (i.e. EurGbp) at a fixed $1 mln per trade and was curious if I need to a) account for my currency exposure to GBP on both ends of the trade or b) ...
0
votes
0answers
170 views

Quantifying Bollinger Band squeeze

I'm interested in experimenting with Bollinger Band squeezes to see if a strategy can come of it. A simple definition is a narrowing of the bands like the example below. Really, only the standard ...
0
votes
1answer
189 views

What is the formula for calculating adjusted closing price after a rights issue?

I know how to calculate adjusted closing prices in case of splits, dividends, etc but I'm not able to figure out how it's done in case of a rights issue.
0
votes
0answers
32 views

Backtesting VaR estimates

I'm going to perform a backtest on some VaR estimates (a huge sample) for a personal project. I'm wondering if the tests which are commonly used to evaluate VaR (Christoffersen, Kupiec) are in some ...
1
vote
3answers
81 views

SEC Rule 611 Trade Through (OHLC Data Distortions) - with visual example

Has anyone ever quantified or understand the impact of distortions to the High/Low of the day based on SEC Rule 611 pass through trades? These are trades that happen outside NBBO (national best bid ...
0
votes
0answers
24 views

Testing VaR accuracy on a large series of data

I'm going to perform a backtest on two VaR models on a very large dataset (+50.000 values). Normally, I would use the Christoffersen LR test but in my case, due to the very large number of observation,...
3
votes
1answer
197 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 ...
1
vote
0answers
299 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
38 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
100 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
151 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 ...

1
2 3 4 5
7