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
25 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
1answer
89 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 ...
0
votes
0answers
62 views

Backtesting 130/30 Long-Short Equity Portfolio

I am wanting to test how a 130/30 long/short strategy would perform over a 10 year period using the Nasdaq 100 as my benchmark to select long and short positions from. I want to rank the Nasdaq 100 on ...
1
vote
1answer
126 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 ...
0
votes
0answers
47 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
0answers
41 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
0answers
40 views

Free Software for plotting OHLC data

I have OHLC data in the following format from 2011 onwards : Instrument Date Time Open High Low Close NIFTY 20080101 9:55 6138.6 6154.6 6138.6 6148.9 NIFTY 20080101 9:56 6149.75 6149.75 6132.8 6132....
0
votes
0answers
42 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 ...
7
votes
1answer
265 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
1answer
86 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
0answers
34 views

Backtrader plotting in jupyter lab

folks. I'm learning how to work with Backtrader library and ran into a problem: I've parsed OHLCV data with Date as index and as I see it works ok, but the problem is that I can't plot it, it just ...
0
votes
0answers
67 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 ...
0
votes
0answers
64 views

Backtesting Value-At-Risk (20-days)

I calculate the 20-day returns of (rolling window) of historical stock prices of 2 years. Are there any problems (like autocorrelation) when I want to backtest the VaR (Value-at-Risk) model?
5
votes
1answer
367 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
79 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
72 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
111 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
122 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
3answers
193 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
45 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
82 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
67 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
37 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
31 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
113 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
79 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
53 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
39 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
133 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
438 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
23 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
54 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
25 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
46 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
21 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
19 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
103 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
44 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
66 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 ...
2
votes
3answers
365 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
60 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
204 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
43 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
49 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
174 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
61 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
198 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
146 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
68 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&...

1
2 3 4 5
7