indicators within EA

 
I use indicator functions within EA code. They return 0 value when timeframe parameter greater then M1.
Actually I try iMACD() and iMA() functions, but seems other indicators behavior the same.

Something that I missing?

Thanks
 
You're keeping back the fact that the EA is run on M1 too. Why?

Apparently there is no other timeframe data available for your EA unless you're messing with the indicator properties.
 
Thank you for an answer.

Should not be data retreived from the server, and MA recalculated?
How to calculate an indicator wthin EA for specified timeframe?

Example: A function
iMA( string symbol, int timeframe, int period, int ma_shift, int ma_method, int applied_price, int shift)
returns a reasonable value for timeframe= 0 or timeframe=OBJ_PERIOD_M1,
but always returns 0 when timeframe=OBJ_PERIOD_M5, M15 etc

Thanks
 
Again,

Indicator function returns 0 if there is no data available for the chosen symbol and timeframe.
Should not be data retreived from the server, and MA recalculated?

It should perhaps, but there are some restrictions too, symbol is not in the symbol list for example. Although I can't remember exactly, sorry.
How to calculate an indicator wthin EA for specified timeframe?

To make sure the data you're building the indicator on is available and accessible.
Look for it in the history center (F2) or just open a chart with that symbol and timeframe to see if there are needed bars in it.
 
Please do not mix constants OBJ_PERIOD_M1 and PERIOD_M1!!!
Reason: