[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Metastockusers] Mikula's Safe Pivots



PureBytes Links

Trading Reference Links

Here's the MS code for the MarketWarrior Strategy "Safe Pivots" 
discussed here http://www.marketwarrior.com/public/1/strategy1.htm

Not bad, at times, tends to be fairly conservative & misses extreme 
trends but works ok when looking for an entry into the early phase of 
an established trend with pullbacks

__________________________________

Dw:=If(DayOfWeek()<=Ref(DayOfWeek(),-1),1,0);
xH:=If(Dw=1,
{then}(Ref(HighestSince(1,Dw=1,H),-1)),0);

mawH:=
(ValueWhen(1,xh>0,xh)+
ValueWhen(2,xh>0,xh)+
ValueWhen(3,xh>0,xh)+
ValueWhen(4,xh>0,xh)+
ValueWhen(5,xh>0,xh)+
ValueWhen(6,xh>0,xh)+
ValueWhen(7,xh>0,xh)+
ValueWhen(8,xh>0,xh)+
ValueWhen(9,xh>0,xh)+
ValueWhen(10,xh>0,xh)+
ValueWhen(11,xh>0,xh)+
ValueWhen(12,xh>0,xh)+
ValueWhen(13,xh>0,xh)+
ValueWhen(14,xh>0,xh)+
ValueWhen(15,xh>0,xh)+
ValueWhen(16,xh>0,xh)+
ValueWhen(17,xh>0,xh))/17;

xL:=If(Dw=1,
{then}(Ref(LowestSince(1,Dw=1,L),-1)),0);

mawL:=(ValueWhen(1,xl>0,xl)+
ValueWhen(2,xl>0,xl)+
ValueWhen(3,xl>0,xl)+
ValueWhen(4,xl>0,xl)+
ValueWhen(5,xl>0,xl)+
ValueWhen(6,xl>0,xl)+
ValueWhen(7,xl>0,xl)+
ValueWhen(8,xl>0,xl)+
ValueWhen(9,xl>0,xl)+
ValueWhen(10,xl>0,xl)+
ValueWhen(11,xl>0,xl)+
ValueWhen(12,xl>0,xl)+
ValueWhen(13,xl>0,xl)+
ValueWhen(14,xl>0,xl)+
ValueWhen(15,xl>0,xl)+
ValueWhen(16,xl>0,xl)+
ValueWhen(17,xl>0,xl))/17;

madP:=Mov(MP(),17,TIMESERIES);

mawH; mawL; madP


------------------------ Yahoo! Groups Sponsor ---------------------~-->
Sell a Home with Ease!
http://us.click.yahoo.com/SrPZMC/kTmEAA/jd3IAA/zMEolB/TM
---------------------------------------------------------------------~->

To unsubscribe from this group, send an email to:
Metastockusers-unsubscribe@xxxxxxxxxxx

 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/