Download MetaTrader 5

How to catch a trend from MA

To add comments, please log in or register
Create interesting Forum topics concerning the automated trading!
mareks1
131
mareks1 2015.03.27 11:58 

Hi, I'm trying to catch a trend from MA to the indicator but it doesn't work.

It should drow the label when ma 3 bars back is higher than ma 1 bar back.

The code is like this:

MA6=iMA(Symbol(),0,ma_fast_period,0,ma_fast_method,ma_fast_price,1);

MA6_2=iMA(Symbol(),0,ma_fast_period,0,ma_fast_method,ma_fast_price,3);

if (MA6_2>MA6)
{

draw_labe(code_60,color_60,i);

}

Can anyone advice what is wrong?

Roberto Jacobs
46479
Roberto Jacobs 2015.03.29 14:49  
mareks1:

Hi, I'm trying to catch a trend from MA to the indicator but it doesn't work.

It should drow the label when ma 3 bars back is higher than ma 1 bar back.

The code is like this:

MA6=iMA(Symbol(),0,ma_fast_period,0,ma_fast_method,ma_fast_price,1);

MA6_2=iMA(Symbol(),0,ma_fast_period,0,ma_fast_method,ma_fast_price,3);

if (MA6_2>MA6)
{

draw_labe(code_60,color_60,i);

}

Can anyone advice what is wrong?

No one will be able to help you, if you just give a piece of code like this. ^_^
To add comments, please log in or register