Download MetaTrader 5

How to call a MQL4 indicator with any timeframe

To add comments, please log in or register
gadget
100
gadget  

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
31184
Alain Verleyen  

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  
angevoyageur:

ENUM_TIMEFRAMES


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

Alain Verleyen
Moderator
31184
Alain Verleyen  
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
18003
Simon Gniadkowski  
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  
Thanks Raptor. It will be my workaround for tomorrow...
To add comments, please log in or register