Download MetaTrader 5

Indicators: MultiMA

To add comments, please log in or register
Traders have already contributed more than 300 articles. Write your own one!
MetaQuotes Software Corp.
MetaQuotes Software Corp. 2008.08.08 08:10 


Shows - in this version - up to 3 MA from different timeframes. Maybe is usefulll for someone. Enter the period for the ma's in Minute of the desired timeframe, f.e ma2_periode=15 shows you the ma for the timeframe M15. Enter in ma2 the Calculte Perio

Author: r.v.

MQL4 Comments
MQL4 Comments 2008.10.18 14:33  

ATTENTION: this indicator is WRONG!

You cannot call iMA on different timeframes using the same barshift of the current timeframe.... what you get is a senseless series of numbers.

The correct way to address data from different timeframes is to get, in the current timeframe, the time of opening of the bar you want to process (i) and using iBarshift find out to which bar of  another timeframe that opening time belongs.

Visually you should expect to see MA of bigger timeframes moving by steps, ie you need 5 M1 bars to make an M5 bar... and if the current timeframe is M1 the displayed MA for M5 shall remain constant for 5 bars... and so on :)

Here a sample code which will fix your indicator:

I used same MA periods and methods for different timeframes. Also added the option to change applied prices from external.

To add comments, please log in or register