Buttons don't work during backtesting
-
Hi all,
I have a problem. I have created an EA with 2 buttons. The first to draw lines automatically and the second to delete them. In live all works. But not during backtests. How can I do to allow my buttons to work during backtests? Thanks a lot for your help!
-
Look at my code to understand. If someone can help me... Thanks guys!
-
Firstly, you can remove those 'pass' block. They are unnecessary. On the backtest problem, I think they cannot work there because of the way the backtest is executed on the platform. Sorry for not being very helpful.
-
@bagheria For backtests, there is a "If Testing" block. Unfortunately with the backtester, OnChart doesn't work with buttons, but OnTick does. So if you want to backtest with it, you need to have an If Testing block, connected to the rest of your logic OnTick.
i.e. This is a old example with just a simple buy button, which works in the backtester.
https://fxdreema.com/shared/jvHegkKHc