m1 bars versus tick-level backtesting
m1 bars versus tick-level backtesting
24 Nov 2020, 05:05
My bot performs significantly better when using M1 bars instead of tick-level testing.
I believe this is because when backtesting with M1 bars, isn't not possible for stop-losses to be triggered when there's a brief wick below the stop-loss level during the period between a bar opening and closing. Is this correct? It would be good therefore, if there was a way to disable stoplosses for the period that exists between an M1 bar opening and closing and only allow the stoploss to be triggered at the beginning of a new M1 bar. Is there any way to achieve this?
Replies
john_7ko
29 Nov 2020, 10:23
RE:
PanagiotisCharalampous said:
Hi john_7ko,
Yes this is correct. To achieve this you will need to code your own stop loss logic that will run in OnBar() method.
Best Regards,
Panagiotis
Is there a way to easily disable all stop losses and then re-enable them while conserving stop loss levels every time Time.Seconds == 0?
@john_7ko
PanagiotisCharalampous
30 Nov 2020, 09:28
Hi john_7ko,
I am not sure what do you mean when you say "to easily disable". There is no built in method, you will need to program something yourself.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
24 Nov 2020, 08:29
Hi john_7ko,
Yes this is correct. To achieve this you will need to code your own stop loss logic that will run in OnBar() method.
Best Regards,
Panagiotis
Join us on Telegram
@PanagiotisCharalampous