Questions tagged [backtesting]

The process of evaluating a strategy, theory, or model by applying it to historical data.

Filter by
Sorted by
Tagged with
1 vote
1 answer
56 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 ...
user avatar
0 votes
1 answer
53 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 ...
user avatar
  • 47
2 votes
1 answer
74 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 ...
user avatar
2 votes
0 answers
30 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 ...
user avatar
  • 21
0 votes
0 answers
76 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 ...
user avatar
3 votes
1 answer
388 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, ...
user avatar
  • 31
0 votes
0 answers
37 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 ...
user avatar
2 votes
1 answer
128 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? ...
user avatar
0 votes
0 answers
51 views

Backtesting Conditional Versus Unconditional forecast horizon with lag 2

Assume that we have a 10 year dataset from Tesla (toy example): ...
user avatar
1 vote
2 answers
223 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 ...
user avatar
  • 13
1 vote
2 answers
143 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 ...
user avatar
  • 136
1 vote
0 answers
90 views

Backtesting Strategy in R for simple empirical value at risk

I am new in backtesting methodology and I want for start to keep things simple.Say that I have the following data: ...
user avatar
0 votes
0 answers
72 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 ...
user avatar
2 votes
3 answers
204 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 ...
user avatar
0 votes
0 answers
59 views

Where to get Historical Intraday data from S&P500 with delisted stocks for free?

I am under 18 and do not have a credit card to purchase this data to test my investment strategy. So what should I do?
user avatar
  • 1
0 votes
0 answers
55 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 ...
user avatar
  • 101
0 votes
1 answer
60 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 ...
user avatar
  • 1
0 votes
1 answer
161 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$ ...
user avatar
1 vote
0 answers
68 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 ...
user avatar
1 vote
1 answer
292 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 ...
user avatar
  • 11
0 votes
0 answers
44 views

Train, validation and test sets for strategy without machine learning

Let's say we have a simple strategy where we buy / sell one stock depending on the value of a rolling mean on the x last days. So the only parameter is the number of days. Would it make sense to do ...
user avatar
  • 395
0 votes
0 answers
27 views

fulfilling the condition for backtesting scalping technique

I am backtesting scalping technique with the 3 sma, in aligator indicator. One of the conditions for scalping long, would be to see alll the three ema's are radiating out from one another as in the ...
user avatar
  • 105
-3 votes
1 answer
138 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 ...
user avatar
  • 105
1 vote
0 answers
81 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) ...
user avatar
0 votes
0 answers
43 views

Backtesting Hedged Equity Portfolio with Options

I am trying to find some papers and methodologies on backtesting an Equity portfolio with broad-based index options as hedge. For example, take SPY and systematically hedge it with 9 months 30 delta ...
user avatar
  • 1,708
0 votes
1 answer
89 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 ...
user avatar
2 votes
1 answer
267 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/ ...
user avatar
0 votes
1 answer
95 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 ...
user avatar
  • 1
0 votes
1 answer
161 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 ...
user avatar
  • 1,598
0 votes
0 answers
86 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 ...
user avatar
2 votes
1 answer
424 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 ...
user avatar
  • 81
1 vote
1 answer
161 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 ...
user avatar
0 votes
1 answer
496 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 ...
user avatar
0 votes
0 answers
78 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....
user avatar
  • 1
0 votes
0 answers
44 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 ...
user avatar
  • 101
8 votes
1 answer
298 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 ...
user avatar
  • 491
0 votes
1 answer
259 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 ...
user avatar
0 votes
0 answers
132 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 ...
user avatar
5 votes
1 answer
441 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 ...
user avatar
3 votes
0 answers
97 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 ...
user avatar
0 votes
0 answers
319 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, ...
user avatar
  • 1
0 votes
0 answers
142 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
user avatar
  • 63
0 votes
1 answer
135 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 ...
user avatar
0 votes
3 answers
511 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 ...
user avatar
2 votes
0 answers
66 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 ...
user avatar
1 vote
1 answer
185 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 ...
user avatar
1 vote
0 answers
130 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 ...
user avatar
0 votes
0 answers
42 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 ...
user avatar
1 vote
0 answers
63 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 ...
user avatar
  • 111
4 votes
0 answers
130 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 ...
user avatar
  • 26.9k

1
2 3 4 5
7