Download MetaTrader 5
To add comments, please log in or register
Write articles, help other developers and make money
Mohammad Ali
18090
Mohammad Ali 2014.08.04 11:21 

Dear guys

I create a button. it work on very well. but it is not work on backtest. I don't know why. can anyone tell me how button work on backtest on visual mode. 

Thanks 

d4v3
28
d4v3 2014.08.04 12:08  
Buttons do not work in a visual back test - it's a limitaton of the MQL code.
Mohammad Ali
18090
Mohammad Ali 2014.08.04 13:01  
d4v3:
Buttons do not work in a visual back test - it's a limitaton of the MQL code.


But i download this product : https://www.mql5.com/en/market/product/XXXX

it work button on visual back testing. How it work? 

d4v3
28
d4v3 2014.08.04 13:35  
It probably uses MT4GUI which does work in visual back tests.
Mohammad Ali
18090
Mohammad Ali 2014.08.04 13:43  
d4v3:
It probably uses MT4GUI which does work in visual back tests.


no this product not use any plugin. Because it don't download any plugin file.  Here the file i download from market and test on visual backtests, button also work on back tests. 

 

 

qjol
3243
qjol 2014.08.04 14:06  

regardless to your issue

martingale is a very dangerous strategy it can wipe you out 

d4v3
28
d4v3 2014.08.04 14:23  
In that case it probably uses OBJ_RECTANGLE_LABEL instead of OBJ_BUTTON - I can not find the place where I read that Buttons do not work when back testing, but maybe the Rectangle Label does.
Alain Verleyen
Moderator
28536
Alain Verleyen 2014.08.04 14:25  
d4v3:
Buttons do not work in a visual back test - it's a limitaton of the MQL code.
Buttons are working in visual backtest. It's chartevent event handler which is not working.
Alain Verleyen
Moderator
28536
Alain Verleyen 2014.08.04 14:27  
capilta:

Dear guys

I create a button. it work on very well. but it is not work on backtest. I don't know why. can anyone tell me how button work on backtest on visual mode. 

Thanks 

 

You have to  check the button state :

ObjectGetInteger(chart,objname,OBJPROP_STATE);

Which can only be done in OnTick() with the Strategy Tester, as other events (OnTimer, OnChartEvent) are not working.

d4v3
28
d4v3 2014.08.04 14:39  
angevoyageur:
Buttons are working in visual backtest. It's chartevent event handler which is not working.

Thanks for the clarification. Do you know whether this is something that MQL are going to fix?


I've been putting off converting all my Buttons from MT4GUI to the new MQL code for this very reason (as well as the lack of ENUM_BORDER_TYPE for Buttons), and I'm still not sure whether it is worth creating the code for OnTick and OnChartEvent so that they will also work when back testing.

/
To add comments, please log in or register