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
1 answer
71 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
52 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
200 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
69 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 ...
  • 57
3 votes
1 answer
116 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
35 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 ...
  • 21
0 votes
0 answers
156 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
397 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, ...
  • 31
0 votes
0 answers
114 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
137 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? ...
0 votes
0 answers
58 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
233 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 ...
  • 13
6 votes
4 answers
644 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 ...
  • 186
1 vote
0 answers
104 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
78 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
279 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

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?
  • 1
0 votes
0 answers
67 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 ...
  • 101
0 votes
1 answer
75 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 ...
  • 1
0 votes
1 answer
172 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
88 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
589 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 ...
  • 11
0 votes
0 answers
29 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 ...
  • 105
-3 votes
1 answer
192 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 ...
  • 105
1 vote
0 answers
90 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
97 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
292 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
187 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
0 votes
1 answer
208 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 ...
  • 1,598
2 votes
1 answer
600 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 ...
  • 81
1 vote
1 answer
198 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
685 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
46 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 ...
  • 101
8 votes
1 answer
323 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 ...
  • 511
0 votes
1 answer
313 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
188 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
484 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
144 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
731 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, ...
  • 1
0 votes
0 answers
174 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
  • 63
0 votes
1 answer
159 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
681 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
68 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 ...
1 vote
1 answer
242 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
161 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
43 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
81 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 ...
  • 111
4 votes
0 answers
137 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 ...
  • 27.1k
0 votes
0 answers
90 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 ...

1
2 3 4 5
7