Different backtesting results with 1m bars from server (open prices) when using OnTick() and OnBar()
Different backtesting results with 1m bars from server (open prices) when using OnTick() and OnBar()
22 Jun 2020, 16:05
So when running a piece of code, I speed up the testing by using 1m bars from server. When using OnTick() for this test I get a result which differs from the result if I change the OnTick() to OnBar() method instead. The code is the same as well as the 1m bars!
So my question is what don't I understand, the OnTick() and OnBar() should give the same result when using the 1m bars from the server, or?
BR
Replies
timo.kolthoff
22 Jun 2020, 16:30
RE:
PanagiotisCharalampous said:
Hi Timo,
Which timeframe do you use for backtesting? Can you share your code so that we can reproduce what you see?
Best Regards,
Panagiotis
Hi,
You can test this with "Sample RSI cBot", just default settings, 1h TimeFrame and 1m bars from server, 1 month of testing. Changing OnTick() to OnBar() gives different results!
BR
@timo.kolthoff
PanagiotisCharalampous
22 Jun 2020, 16:32
Hi Timo,
If you are backtesting on the hourly timeframe then of course it will. OnBar() is triggered on every hour and OnTick() on every minute.
Best Regards,
Panagiotis
@PanagiotisCharalampous
timo.kolthoff
22 Jun 2020, 16:36
RE:
PanagiotisCharalampous said:
Hi Timo,
If you are backtesting on the hourly timeframe then of course it will. OnBar() is triggered on every hour and OnTick() on every minute.
Best Regards,
Panagiotis
Thanks for pointing out the obvious, case closed!
@timo.kolthoff
PanagiotisCharalampous
22 Jun 2020, 16:09
Hi Timo,
Which timeframe do you use for backtesting? Can you share your code so that we can reproduce what you see?
Best Regards,
Panagiotis
Join us on Telegram
@PanagiotisCharalampous