Rank: Advanced Member
Groups: Registered, Registered Users, Subscribers, Unverified Users Joined: 10/28/2004(UTC) Posts: 3,111 Location: Perth, Western Australia
Was thanked: 16 time(s) in 16 post(s)
|
Hi Algorithm,
Welcome to the forum.
In order to use the Min() (and later the Max() ) functions, you should assign each moving average line to a variable then test each variable against each other variable. Something like:
------
Periods := Input("Time Periods", 1, 1000, 20); Spacing := Input("Spacing", 1, 100, 5); Ribbons := Input("Ribbons", 1, 12, 12);
ma0 := Mov(C,Periods+(Spacing*0),S);
ma1:=If(Ribbons>=2,Mov(C,Periods+(Spacing*1),S),ma0); ma2:=If(Ribbons>=3,Mov(C,Periods+(Spacing*2),S),ma0); ma3:=If(Ribbons>=4,Mov(C,Periods+(Spacing*3),S),ma0); ma4:=If(Ribbons>=5,Mov(C,Periods+(Spacing*4),S),ma0); ma5:=If(Ribbons>=6,Mov(C,Periods+(Spacing*5),S),ma0); ma6:=If(Ribbons>=7,Mov(C,Periods+(Spacing*6),S),ma0); ma7:=If(Ribbons>=8,Mov(C,Periods+(Spacing*7),S),ma0); ma8:=If(Ribbons>=9,Mov(C,Periods+(Spacing*8),S),ma0); ma9:=If(Ribbons>=10,Mov(C,Periods+(Spacing*9),S),ma0); ma10:=If(Ribbons>=11,Mov(C,Periods+(Spacing*10),S),ma0); ma11:=If(Ribbons>=12,Mov(C,Periods+(Spacing*11),S),ma0);
mn:=Min(Min(Min(Min(Min(Min(Min(Min(Min(Min(Min(ma0,ma1),ma2),ma3),ma4),ma5),ma6),ma7),ma8),ma9),ma10),ma11); mx:=Max(Max(Max(Max(Max(Max(Max(Max(Max(Max(Max(ma0,ma1),ma2),ma3),ma4),ma5),ma6),ma7),ma8),ma9),ma10),ma11);
{plot} ma0;ma1;ma2;ma3;ma4;ma5;ma6;ma7;ma8;ma9;ma10;ma11; mn; mx;
----------------------
Hope this helps.
wabbit [:D]
|