Button on Backtesting

 

Hello,

Does anyone know how to make the button work on backtesting?

Thank you.

 
rucope:

Hello,

Does anyone know how to make the button work on backtesting?

Thank you.

Umm, button does work in backtesting. At least in MT4. 

 
Ahmad Zuhairdi Noh:

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!!!!!!

 
Try in on freelance!
 

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

 
rucope:

Hello,

Does anyone know how to make the button work on backtesting?

Thank you.

MT4 or MT5
 
Fred7777:

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

Can you share the links?
 
Dmitriy Gizlyk:
MT4 or MT5

Both if possible!

Thank you so much!

 
rucope:

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):

if (button_state)
{
    // do action

    // restore prev. state
    ObjectSetInteger(ChartID(), button_name, OBJPROP_STATE, false);
}

In MT5 this is more complicated.