Does anyone know how to make the button work on backtesting?
Umm, button does work in backtesting. At least in MT4.
Thank for your answer.
However, I already saw an EA used button on backtest.
I think we can make it work.
But how to make it!!!!!!
Can you make the default Indicators work ? like the Default MA and the MACD ?
Thats the first thing to try. Can be a little complicated and theres some Youtbube videos to show you
Both if possible!
Thank you so much!
Objects placed on chart in visual backtesting MT4 don't raise events, but when you push button it will change its state. You can simply check its state in OnTick function:
bool button_state = ObjectGetInteger(ChartID(), button_name, OBJPROP_STATE);
and do proper action (the same as in OnChartEvent function):
// do action
// restore prev. state
ObjectSetInteger(ChartID(), button_name, OBJPROP_STATE, false);
In MT5 this is more complicated.