OnBar() or OnBarClosed() for backtesting
Created at 25 Oct 2024, 07:53
OnBar() or OnBarClosed() for backtesting
25 Oct 2024, 07:53
Hi there;
In the bot I wrote; If I use OnBarClosed() instead of OnBar() and close the preview while doing a backtest, the bot gives an error and does not test. The log record says: "01/01/2024 23:01:00.673 | Error | CBot instance [CBot, XAUUSD, m1] crashed with error #ED2F94F3."
I cannot optimize it in the same way. If I write OnBar(), there is no problem. However; I want to use OnBarClosed() to be consistent. How can I solve this problem?
Thanks
PanagiotisCharalampous
25 Oct 2024, 11:52
Hi there,
Please share your cBot code let us know your broker and which version of cTrader you use so that we can reproduce this issue.
Best regards,
Panagiotis
@PanagiotisCharalampous