Download MetaTrader 5
To add comments, please log in or register
Find out the most discussed Forum topics. Have a look at the Wall section!
gxforex
24
gxforex 2016.09.25 16:55  

Hi jjc, thank you for your further explainations. Is there any way to report this bug to MetaTrader? It is really difficult to test an EA which invokes a multi-timeframe indicator...

Keith Watford
Moderator
8830
Keith Watford 2016.09.25 23:07  
jjc:

It depends on the indicators. An indicator which only uses the values passed in the buffers to OnCalculate() should be fine. An indicator which tries to get other data using the timeseries functions iBarShift, iTime, iClose etc will not work properly.

The problem is specifically with multi-timeframe indicators. 

(Much the same applies to offline charts. A multi-timeframe indicator on an offline chart sees the standard bar history, not the offline chart history.)

Thanks for your post, it has cleared something for me.

I have only just recently noticed this myself. While testing an EA in visual mode, the EA was taking trades that it apparently shouldn't as the MTF indicators weren't signalling trades. This was extremely puzzling as I couldn't find any fault in my code. Printing the iCustom values when conditions were found for a trade showed that the values did not relate to the indicator values in the data window at all.

Checking against a normal chart with the indicator showed that the iCustom calls were returning the correct values but the indicator in the visual mode chart was not displaying correctly.

JC
1399
JC 2016.09.26 07:25  
gxforex:

Hi jjc, thank you for your further explainations. Is there any way to report this bug to MetaTrader? It is really difficult to test an EA which invokes a multi-timeframe indicator...

You can try writing to the Service Desk, but this isn't a bug as such. I don't think it's ever been intended to work the way you want it to work.
Alain Verleyen
Moderator
29548
Alain Verleyen 2016.12.05 17:39  
JC:

It depends on the indicators. An indicator which only uses the values passed in the buffers to OnCalculate() should be fine. An indicator which tries to get other data using the timeseries functions iBarShift, iTime, iClose etc will not work properly.

The problem is specifically with multi-timeframe indicators

(Much the same applies to offline charts. A multi-timeframe indicator on an offline chart sees the standard bar history, not the offline chart history.)

To be clear, it's on MTF indicator and it only happens when you place an indicator on a backtest chart, not when you are using iCustom (as reported by Keith). Of course, this discrepancy between iCustom() values and visual can be annoying if you are not aware of it.
/ /12
To add comments, please log in or register