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

Re: Multi-period Market Indicator Values



PureBytes Links

Trading Reference Links

Steve and Rick,

I hadn't yet seen Rick's response when I posted my "claim for dinner".

Rick is absolutely correct in what he says.
Especially the bit about "the last bar of higher time frames is usually not
complete".

Because I agree with what Rick says, and because his suggestion eliminates
the "last Weekly period" problem from my solution, I include an updated
version of my previous reply, but based on Rick's "synthetic" weekly OHLC
data.

I think my original solution more correctly approximated the result of
dropping a Stochastic on a Weekly chart, but Rick's solution is more useful
at the hard right edge.

Rick, how about we split the dinner?

Paul Chivers
Western Australia
+8:00 GMT


{ Weekly High - Synthetic }
     If( DayOfWeek() = 1 , HHV(H, 1),
     If( DayOfWeek() = 2 , HHV(H, 2),
     If( DayOfWeek() = 3 , HHV(H, 3),
     If( DayOfWeek() = 4 , HHV(H, 4),
     If( DayOfWeek() = 5 , HHV(H, 5),
         H 
       )))));

{ Weekly Low - Synthetic }
     If( DayOfWeek() = 1 , LLV(H, 1),
     If( DayOfWeek() = 2 , LLV(H, 2),
     If( DayOfWeek() = 3 , LLV(H, 3),
     If( DayOfWeek() = 4 , LLV(H, 4),
     If( DayOfWeek() = 5 , LLV(H, 5),
         L 
       )))));

{ Weekly Stochastic - Synthetic Data }
WClose:= C ;
WHigh := Fml( "Weekly High - Synthetic" ) ;
WLow  := Fml( "Weekly Low - Synthetic" ) ;
KPer:=Input("%K Time Periods", 1, 200, 5)*5;
KSmooth:=Input("%K Slowing",   1, 200, 3)*5;
DPer:=Input("%D Time Periods", 1, 200, 3)*5;
PercentK:=(  Sum(  WClose 
                 - LLV(WLow, KPer), 
                 KSmooth ) /
           Sum(   HHV(WHigh, KPer)
                - LLV(WLow, KPer), 
                KSmooth) ) * 100;
PercentK;
PercentD:= Mov(PercentK, DPer, S) ;
PercentD;