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...
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.
To add comments, please log in or register