How to catch a trend from MA

 

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?

 
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. ^_^
Reason: