Backtesting start at a specific time.

Created at 06 Feb 2018, 13:33
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!
KU

kuba.pod@gmail.com

Joined 06.02.2018

Backtesting start at a specific time.
06 Feb 2018, 13:33


Hello everyone,

It may be a result of my small experience with cTrader/cAlgo/C# but I failed to backtest my 'hello world' bot at a specific time. 

From what I understand I can only select a date but not the exact time at which OnStart() will be fired.

What is the right way to achieve this? Currently I move my bot logic to OnBar() where if/else conditions check whether the time is right to start and go one with the code.

 

Best,

Kuba


@kuba.pod@gmail.com
Replies

PanagiotisCharalampous
06 Feb 2018, 14:19

Hi kuba.pod@gmail.com,

Thanks for posting in our forum. Currently there is no way to set a starting time for a cBot. Therefore, I think that your solution is the way to solve this issue. You can set the starting time as a parameter of the cBot and then make the relevant checks in the code.

Best Regards,

Panagiotis


@PanagiotisCharalampous