backtesting vs real time test

Created at 06 Dec 2015, 03:05
How’s your experience with the cTrader Platform?
Your feedback is crucial to cTrader's development. Please take a few seconds to share your opinion and help us improve your trading experience. Thanks!
MI

mioulianou

Joined 14.11.2015

backtesting vs real time test
06 Dec 2015, 03:05


hi! I am testing my algo for 2 weeks in real time testing mode. However when i try this 2 week in backtesting mode i do not get the same results. Why? 

thnks


@mioulianou
Replies

trend_meanreversion
06 Dec 2015, 10:12

RE:

mioulianou said:

hi! I am testing my algo for 2 weeks in real time testing mode. However when i try this 2 week in backtesting mode i do not get the same results. Why? 

thnks

my 2 cents on the issue you are facing ( as i have faced similar issue before )

There are a couple of reasons why one might (and most likely) have different results in backtesting vs real-time results

It depends on your algorithm but if you have backtested using 1-min or any other time frame testing assuming candlestick OHLC to be sufficient for backtesting then i am almost 100% sure that you will have different results . You should backtest using 'tick' data and that should be "closest" to what you should expect in real-time. For example : you might have takeProfit and StopLoss in your algo and in real time you will get the tick based price while in backtesting you will have candlestick OHLC to get the triggers to simulate your SL/TP. This could lead to significant difference ( and in most cases very poor ) in results. 


@trend_meanreversion

mioulianou
07 Dec 2015, 01:18

Thanks for the response,

my algo is based in tick data movement of price and all i do is from tick data (backtest and real time test) . However i still have different results!


@mioulianou

trend_meanreversion
07 Dec 2015, 03:31

RE:

mioulianou said:

Thanks for the response,

my algo is based in tick data movement of price and all i do is from tick data (backtest and real time test) . However i still have different results!

Well in that case, it really depends on the algorithm but i can think of 2 possible causes:

1) Tick backtesting would assume that you get the same tick(or probably next tick) while execution but in real-time there will delay between OnTick calculation and 'real' execution tick which can be a couple of milliseconds away. This could cause serious impact to strategies that rely on StopOrders or work during high volatility regime.

2) Tick data(assuming your strategy works on FX) is basically top line liquidity of broker (with volume) but not 'necessarily' valid trading quote. So you might be hitting the market order on next Tick in back-testing which could give you the price but in real-time you might not get that fill but probably the next one which is worse than expected. ( I think you probably know about it ..look at 'Last Look' feature in FX pricing )

I feel the first reason is more probable than second for reliable brokers. Also, i am assuming you have put in proper commissions value while back testing in tick mode.

 

 

 


@trend_meanreversion