Rank: Advanced Member
Groups: Registered, Registered Users Joined: 11/9/2012(UTC) Posts: 169
|
I let Wabbit and MSTT do the heavy lifting on the formula stuff, but I think I might can handle this one. First, you'll need to remove the brackets { and } from your formula otherwise nothing will plot. The first formula reads like this: A:=Mov(C,30,S); B:=If(Sum(A>Ref(A,-1),11)>5,1,If(Sum(A<Ref(A,-1),11)>5,-1,0)); B;
If a 30-period simple moving average has gone up more than 5 times over the last 11 periods, then plot a "1". If its gone down more than 5 of the last 11 then plot a "-1". If neither is true, then plot a "0". The second formula reads like this: Pd:=30; Mov(C,pd,S)>Ref(Mov(C,pd,S),-1)The 30-period simple moving average is greater than the previous period's. If this is TRUE then a "1" will plot; otherwise it plots "0". Neither of these may produce what you are looking for. The MA could still be trending down, yet still have 6 (or more) rising values. You could add one more variable that gets you closer to this. A:=Mov(C,30,S); B:=If(Sum(A>Ref(A,-1),11)>5,1,If(Sum(A<Ref(A,-1),11)>5,-1,0)); C: A>ref(A,-11); B AND C; I haven't actually done any of the above in MetaStock, so there could indeed be some syntax errors. --john
|