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

Re: [EquisMetaStock Group] Weekly pdi and mdi on daily charts



PureBytes Links

Trading Reference Links


Roy, you're belting out formulas faster than I can read them!    :-)

>Here's a formula for weekly +DI and -DI on daily charts. Use Fml("Weekly 
>PlusDI MinusDI") to
>call -DI in a systems test or exploration, and FmlVar("Weekly PlusDI 
>MinusDI","PlusDI") to call +DI.
>These values do not agree exactly with the MetaStock functions because 
>MetaStock rounds the values
>and these formulas do not.

I'm aware of that. Happily, I need the unrounded version anyway. The 
rounded formula is not quite sensitive enough when it comes to the 
directional system. (In the meantime you sent the rounded version, too. 
Many thanks.)

>  When I crack the rounding approach that MetaStock uses I'll be able to
>get a better simulation value. Whether that would be as accurate as Wilder 
>intended is questionable.

Yes, questionable.


>Sorry about the number of PREVs in this formula. There is no way, short of 
>creating a dll, to code
>weekly Wilders Smoothing without PREV. You will need to install Jose's 
>"Calender Week counter"
>indicator before this indicator will function. You can get that from
>http://users.bigpond.com/prominex/pegasus.htm#metastock

Thanks. Got it.

>I've set the indicator to "dynamic" mode. That means that it will update 
>the current week as each
>day's data is added.

The way the indicator plots right now, it seems to reflect the PDM/MDM 
values as of the prev. week's close for the entire current week -- this is 
exactly what I want. Awesome!

>  Remember to set the "periods" default before use.

Final question:

I'm glad to have the Inputs because they make it easy to experiment 
visually. But if I want to use a certain length of weekly PDM or MDM in an 
exploration, what changes do I make so that I always have, say, a 21-week 
or an 8-week PDM/MDM?

Hmmm, not sure I've done very well explaining that. Let me try again. Say I 
want to explore for weekly PDM(34) > weekly MDM(34) or Max(weekly 
MDM(21),weekly PDM(21) or some such.

TIA,
Philip













>Regards
>
>Roy
>
>
>   {Weekly PlusDI MinusDI}
>   {2004 Roy Larsen, rlarsen@xxxxxxxxxxxxxx}
>   {for use on daily charts with
>    Jose Silva's "Calendar Week counter"}
>N:=Input("Weekly ADX Periods",1,99,14); X:=1/N;
>F:=Input("End of Week,  5=Friday  6=Saturday  7=Sunday",5,7,5);
>Q:=Input("Display Mode,  0=Static  1=Dynamic  2=Test",0,2,1);
>   {0=Display, update on Friday when possible}
>   {1=Display, update on each new bar}
>   {2=Backtest, update on first bar of new week}
>G:=LastValue(Highest(Sum(DayOfWeek()=F,5))=5);
>I:=Fml("Calendar Week counter");
>I:=Abs(I-ValueWhen(2-G,1,I)); M:=G OR I>0;
>F:=G OR (DayOfWeek()=F AND I=0);
>A:=LastValue(Cum(1)-1)=Cum(1);
>B:=ValueWhen(2,1,A);
>J:=If(F,1,If(Alert(F,2)=0 AND M,2,0));
>J:=If(A+LastValue(J)>2 OR B+(Q=1)=2,1,J);
>J:=If(G,1,If(Q=2 OR Cum(J)<=1,M*2,J));
>Ho:=HighestSince(1,M,H);
>Ho:=ValueWhen(1,J,If(J=1,Ho,ValueWhen(2-G,1,Ho)));
>Lo:=LowestSince(1,M,L);
>Lo:=ValueWhen(1,J,If(J=1,Lo,ValueWhen(2-G,1,Lo)));
>Ci:=ValueWhen(1,J,If(J=1,C,ValueWhen(2-G,1,C)));
>Ho:=ValueWhen(1,Ho>0,Ho); Hi:=ValueWhen(2,J,Ho);
>Lo:=ValueWhen(1,Lo>0,Lo); Li:=ValueWhen(2,J,Lo);
>Ci:=ValueWhen(1,Ci>0,Ci); Ci:=ValueWhen(2,J,Ci);
>Pdm:=If(Ho>Hi AND Lo>=Li,Ho-Hi,If(Ho>Hi AND
>   Lo<Li AND (Ho-Hi)>(Li-Lo),Ho-Hi,0));
>Mdm:=If(Lo<Li AND Ho<=Hi,Li-Lo,If(Ho>Hi AND
>   Lo<Li AND (Ho-Hi)<(Li-Lo),Li-Lo,0));
>R:=Max(Max(Abs(Ci-Lo),Abs(Ci-Ho)),Ho-Lo);
>A:=If(Cum(J>0)<N+1,Cum((J>0)*R)/N, ValueWhen(1,J,PREV)*(1-X)+R*X);
>I:=If(Cum(J>0)<N+1,Cum((J>0)*Pdm)/N, ValueWhen(1,J,PREV)*(1-X)+Pdm*X);
>PlusDI:=100*I/A;
>PlusDI:=ValueWhen(1,Cum(J>0)>=N,PlusDI);
>M:=If(Cum(J>0)<N+1,Cum((J>0)*Mdm)/N, ValueWhen(1,J,PREV)*(1-X)+Mdm*X);
>MinusDI:=100*M/A;
>MinusDI:=ValueWhen(1,Cum(J>0)>=N,MinusDI);
>PlusDI;
>MinusDI;
>
>
>
>
>
>
>
>Yahoo! Groups Links
>
>
>
>







------------------------ Yahoo! Groups Sponsor --------------------~--> 
Make a clean sweep of pop-up ads. Yahoo! Companion Toolbar.
Now with Pop-Up Blocker. Get it for free!
http://us.click.yahoo.com/L5YrjA/eSIIAA/yQLSAA/BefplB/TM
--------------------------------------------------------------------~-> 

 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/equismetastock/

<*> To unsubscribe from this group, send an email to:
    equismetastock-unsubscribe@xxxxxxxxxxxxxxx

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