Skip to main content

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
0 answers
61 views

What does it mean when a systematic strategy yields significantly different backtesting results with minimal changes to the backtesting starting date?

I am testing a simple systematic strategy: I buy a certain product once every five business days and sell it after three business days from the buy date. In the backtest, this is how I define my ...
revelc's user avatar
  • 1
0 votes
1 answer
42 views

Proper Use of CPCV for Hyperparameter Tuning and Backtesting in a Trading Strategy

I'm working on a binary classification model for a month-end trading strategy with 6 months of data. Initially, I split the data by using the last month for evaluation and backtesting, but this left ...
June's user avatar
  • 1
0 votes
0 answers
44 views

Now that Zipline is no longer being maintained. What back testing alternative would you recommend

I am building a self hosted stack so there has been a lot of trial and error in order to head off a headache or two I thought I would reach out for a group opinion. I am evaluating back testers and I ...
John Zirnkilton's user avatar
1 vote
2 answers
185 views

fast backtesting library in R

I’m looking for a fast library for backtest in R that supports limit orders, stop-losses, and take-profits. The library should be optimized for repeated historical testing and ideally ported from fast ...
mr.T's user avatar
  • 125
0 votes
0 answers
70 views

Test Formula for Cross-Currency Basis by Using S, F and Rates. What Rates to Use?

I am trying to recreate the charts on slide 6 on the below. Basically "test" the formula for the cross-currency basis for EURUSD. I am using as target EUXOQQ1 BGN Crncy, which is the ESTRON ...
RickRiederFan's user avatar
3 votes
1 answer
218 views

Understanding the calibration of High-frequency trading in a limit order book

I am trying understand and replicate this thesis, which is based on, High-frequency trading in a limit order book by (Avellaneda and Stoikov, 2008) and Optimal market making, by Olivier Gueant, 2017, ...
ayamathss1's user avatar
0 votes
1 answer
68 views

Marginal effect of asset in a strategy

Im trying to develop a stastical arbitrage strategy that depends on a universe of assets and in a brief way, they replicate some factor(s), index(s), etf(s), etc, and then trade residuals. So, after ...
NICOLÁS ZANNI's user avatar
4 votes
1 answer
192 views

Backtesting of VaR estimates

Regulators want to backtesting VaR estimates based on both Risk theoretical PnL and ...
Bogaso's user avatar
  • 838
0 votes
0 answers
123 views

Futures Backtest

Trying to get my head around a simple futures backtest, namely trend. What I am struggling with is after back-adjusting (Panama canal) 10 year bond futures, I'm left with negative prices in the series....
flexington's user avatar
1 vote
1 answer
352 views

How does one calibrate lambda in a Avellaneda-Stoikov market making problem leading to Gueant-Lehalle-Tapia model?

The title is similar to that of the question I was referred to here which has been answered by Lehalle himself! I'm trying to implement the Gueant-Lehalle-Tapia model which is how I got to this answer ...
Jay's user avatar
  • 13
0 votes
0 answers
60 views

Adjusting the p-value of a strategy for number of parameters

Let's say I have some metric and I'm trying to evaluate whether it's predictive with respect to returns. I plan to only take trades where the value of the metric is above a certain threshold, such ...
SuperCodeBrah's user avatar
0 votes
0 answers
76 views

Backtesting: choosing the "sample split" between in-sample and out-of-sample data

Aims: Given approximately 11 years of historical time-series data, to determine how much of this data should be reserved for in-sample and ...
p.luck's user avatar
  • 131
0 votes
0 answers
80 views

OLS estimation for ornstein uhlenbeck process

I am reading the following paper. In particular, in section 4 - numerical determination of OTRs, it mentions applying Ordinary Least Square on Eq(5). However, what I don't know is whether ${P_{0,0}, ...
user1769197's user avatar
0 votes
0 answers
133 views

Backtesting One-Factor HJM model with selling European Receiver Swaption

I am attempting back test the performance of a model - namely the Musiela equation used to model instantaneous forward rates with constant time to maturity: $$r(t,x)=r(0,x)+\int_0^t\left(\frac{\...
user67245's user avatar
0 votes
0 answers
122 views

Pairs trading back-test in python

I've been working on this code for weeks now, and I'm still not convinced by the results. I think there's a problem with the computation of the profit and loss, but I'm not sure. I would love some ...
Raúl Pareja's user avatar
4 votes
2 answers
176 views

Is there an encyclopedia of peformance/risk measures for backtests of strategies?

Analysing a backtest of a strategy i.e., a series of returns of a defined period we can consider various metrics such as the Sharpe-ratio or more exotic ones like the Omega-ratio. What I was wondering:...
Richi Wa's user avatar
  • 13.7k
3 votes
0 answers
136 views

How to take into account transaction fee of a backtest from a list of returns?

I have a list of booleans that correspond to buy and sell signals that I would like to backtest. To achieve this, I calculated the return ret of a security and when ...
Florent's user avatar
  • 241
0 votes
1 answer
268 views

Using bid and ask prices with VectorBT library

I am creating a backtest using vectorbt library. This is my function for all the portfolio metrics: ...
arkon's user avatar
  • 1
5 votes
0 answers
309 views

PBO algorithm "The Probability of Backtest Overfitting" paper

In this article by Lopez de Prado et al., an algorithm was proposed for assessing the overfit of a trading strategy: The Probability of Backtest Overfitting There is also a package for R: pbo: ...
mr.T's user avatar
  • 125
1 vote
1 answer
343 views

what are the packages for effective backtesting in R

I need a fast package for backtesting in R. I'm going to optimize a lot so I'll be running my strategies many millions of times. I know about packages like ...
mr.T's user avatar
  • 125
0 votes
0 answers
106 views

Any document about general backtesting algorithm and data structure

(Note there are similar questions, with different focuses at this forum, but my focus is more on the general concept, if any, about backtesting (for stocks) and sources of information where I can go ...
Dino Hsu's user avatar
-2 votes
1 answer
687 views

Is C++ suitable for writing backtests

I'm looking for a library like BackTrader or platform that is written in C++ for backtesting. Is C++ a good choice to write a backtester and are any available?
okayflame's user avatar
1 vote
1 answer
275 views

Figuring out how TradingView calculates the Sharpe ratio [closed]

This is the simplest backtest I've come up with, yet I can't figure out how TradingView has calculated the Sharpe ratio to be 0.577. I've set the risk_free_rate=0. Is it possible to extract the ...
asmani's user avatar
  • 141
2 votes
1 answer
112 views

Fatigue with Historic Backtesting - Alternatives?

It seems to me like historic backtesting is the best of bad options out there for me to test my systematic strategies - even ones that are more macro-level trend spotting. I can't test enough ...
keon6's user avatar
  • 61
4 votes
1 answer
448 views

Proper way to backtest strategy using bootstrap method

Should I back-test in a single (original) price series and bootstrap the strategy returns to get statistics of interest? Or should I create bootstrapped price series using bootstrapped returns from ...
Arun Lama's user avatar
1 vote
2 answers
205 views

VaR backtesting. Reasons for over- and underestimation of value at risk estimates?

I use an ARMA-GARCH model for univariate distributions and a copula model for the multivariate distribution. For the value at risk (VaR) estimation, I do a Monte Carlo simulation. I'm looking for some ...
daxson's user avatar
  • 11
2 votes
2 answers
254 views

Detrending price series for back testing

If I am testing a trend-following strategy, should I detrend the data before applying the rules or should I generate signals based on the original price series but use detrended data for performance ...
Arun Lama's user avatar
1 vote
0 answers
109 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 ...
RMA's user avatar
  • 11
0 votes
1 answer
135 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 ...
Carles Ferreres Vivero's user avatar
3 votes
1 answer
684 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 ...
user1769197's user avatar
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 ...
CLARA.19's user avatar
1 vote
1 answer
522 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 ...
Cairan Van Rooyen's user avatar
0 votes
1 answer
137 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 ...
geonhwa's user avatar
  • 57
4 votes
2 answers
326 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 ...
Anthony Moeller's user avatar
2 votes
0 answers
53 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 ...
leonnis's user avatar
  • 21
0 votes
0 answers
320 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 ...
Georgios Kourogiorgas's user avatar
3 votes
1 answer
421 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, ...
Alan's user avatar
  • 31
2 votes
1 answer
229 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? ...
ffff22222's user avatar
1 vote
2 answers
263 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 ...
aether's user avatar
  • 13
8 votes
4 answers
3k 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 ...
matt's user avatar
  • 208
0 votes
0 answers
88 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 ...
mathguy_666's user avatar
2 votes
3 answers
823 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 ...
benjabee10's user avatar
0 votes
0 answers
106 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 ...
Matan's user avatar
  • 101
0 votes
1 answer
130 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 ...
danabo's user avatar
  • 1
0 votes
1 answer
229 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$ ...
AbateFaria's user avatar
1 vote
0 answers
149 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 ...
user2330237's user avatar
1 vote
1 answer
1k 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 ...
Dumberc's user avatar
  • 11
-2 votes
1 answer
431 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 ...
isnvi23h4's user avatar
  • 125
1 vote
0 answers
119 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) ...
Metod Jazbec's user avatar
0 votes
1 answer
122 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 ...
Jonathan Bechtel's user avatar

1
2 3 4 5
8