Help: Metastock Indicator to AmiBroker AFL

didi

New Member
#1
Hi All Seniors,

Can anyone help me to convert this Metastock Indicator to AmiBroker formula (AFL)?
MA Ribbons
-----------
Periods := Input("Time Periods", 1, 1000, 20);
Spacing := Input("Spacing", 1, 100, 5);
Ribbons := Input("Ribbons", 1, 12, 12);
BaseMA := Mov(C,Periods+(Spacing*0),S);

If(Ribbons>=2,Mov(C,Periods+(Spacing*1),S),BaseMA);
If(Ribbons>=3,Mov(C,Periods+(Spacing*2),S),BaseMA);
If(Ribbons>=4,Mov(C,Periods+(Spacing*3),S),BaseMA);
If(Ribbons>=5,Mov(C,Periods+(Spacing*4),S),BaseMA);
If(Ribbons>=6,Mov(C,Periods+(Spacing*5),S),BaseMA);
If(Ribbons>=7,Mov(C,Periods+(Spacing*6),S),BaseMA);
If(Ribbons>=8,Mov(C,Periods+(Spacing*7),S),BaseMA);
If(Ribbons>=9,Mov(C,Periods+(Spacing*8),S),BaseMA);
If(Ribbons>=10,Mov(C,Periods+(Spacing*9),S),BaseMA);
If(Ribbons>=11,Mov(C,Periods+(Spacing*10),S),BaseMA);
If(Ribbons>=12,Mov(C,Periods+(Spacing*11),S),BaseMA);

Thanks in advance,

Kind regards,

Didi
 

Similar threads

Broker Special Offers

Intraday Higher Leverage

Save up to 90% in brokerage and get higher leverage for intraday trades.

Name:Phone:
Email:City:
State:
Are you a day trader?