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)
|
You actually need to 'nest' the ROC functions.
For a price to be 'accelerating', we assume the price change today is greater than at a previous time, and that price change is more than a time previous to that.
There are a couple of ways to achieve this (like a lot of things with MS there are many ways to write the actual code) but these might get you on your way:
--8<-----------------------------
prd:=Input("Consecutive periods",1,10,5);
x:=ROC(C,1,$);
y:=x > Ref(x,-1);
z:=Sum(y,prd)=prd;
z;
--8<-----------------------------
OR
--8<-----------------------------
ROC(C,1,$)>ROC(C,2,$) AND
ROC(C,2,$)>ROC(C,3,$) AND
ROC(C,3,$)>ROC(C,4,$) AND
ROC(C,4,$)>ROC(C,5,$) AND
ROC(C,5,$)>ROC(C,6,$)
--8<-----------------------------
etc etc etc.....
Have a read of the USers Manual and try something out for yourself. Post your code when have something working.
Hope this helps.
wabbit :D
|