MetaStock™ Zone Forum & FAQ Artykuły Linki Elliott Waves EasyLanguage™ Zone

 A B C D E F G H I J K L M N O P R S T U V W Y Z #

Moving Average Ribbon
This is a good example of variables and user inputs. It's also an interesting indicator.

Moving Average Ribbon

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);

Source / From: TOP
MetaStock CF

Equis and MetaStock® and MetaStock Professional® are registered trademarks of Equis International. Achelis Binary Wave®, The DownLoader®,
Expert Advisor®, OptionScope®, Quotecenter® and Smart Charts® are trademarks of Equis International, a Thomson Reuters company.