How to call a MQL4 indicator with any timeframe

 

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.

 

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.


 
angevoyageur:

ENUM_TIMEFRAMES


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

 
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 ?
 
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 
 
Thanks Raptor. It will be my workaround for tomorrow...
Reason: