Download MetaTrader 5

How to call a MQL4 indicator with any timeframe

To add comments, please log in or register
You can test an application before buying it. Find out how to do that!
gadget
100
gadget 2014.10.20 16:29 

Hi MQL community,

After manipulating one of my EA today, I noticed that the IMA function will always return 0 if it's not called with a 'standard' MT4 timeframe. For example, it returns 0 if doing: iMA(null,PERIOD_M20,[....]) or iMA(null,PERIOD_M10,[....])

The MQL doc for iMA says to use any of the enumarted timeframes (https://docs.mql4.com/constants/chartconstants/enum_timeframes).

Is it that the MQL doc is wrong?

Or that MT4 needs an offline chart working on the 'non-standard' timeframe I want to use?

Thanks in advance.

Alain Verleyen
Moderator
30752
Alain Verleyen 2014.10.20 16:45  

ENUM_TIMEFRAMES

Note

Timeframes, different from the standard timeframes of the client terminal (PERIOD_M1, PERIOD_M5, PERIOD_M15, PERIOD_M30, PERIOD_H1, PERIOD_H4, PERIOD_D1, PERIOD_MN1, PERIOD_W1) can be used when working with offline charts.


gadget
100
gadget 2014.10.20 17:18  
angevoyageur:

ENUM_TIMEFRAMES


That's the link I had put in the qº.

Alain Verleyen
Moderator
30752
Alain Verleyen 2014.10.20 17:42  
gadget:

That's the link I had put in the qº.

Yes, and the answer is in this page as I quoted, so what are you asking ?
Simon Gniadkowski
Moderator
18001
Simon Gniadkowski 2014.10.20 18:55  
gadget:


Or that MT4 needs an offline chart working on the 'non-standard' timeframe I want to use?

Yes, correct.  You need an offline chart if you want to use a timeframe other than M1, M5, M15, M30, H1, H4, D1, W1, MN1 
gadget
100
gadget 2014.10.21 21:06  
Thanks Raptor. It will be my workaround for tomorrow...
To add comments, please log in or register