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

Weekly Stochastic and Momentum on Daily chart



PureBytes Links

Trading Reference Links

Ah yes....the old Inbox factor....it seldom fails.  Whenever something I
post hits my Inbox, I see something I don't like.   Usually I can live
with it, but sometimes I just can't.  :-)   It would be more accurate
name-wise if I changed the eow variable to sw (for start week).  I had
considered calling it ftd (first trading day), but it sounded
so....well....flowery.  (Merlin Olsen would have gone with it I bet.
<g>)   Anyway, since I had to change mine, I thought I'd save you most
of the trouble.  Just replace the original version with this revised
version .

Regards,
Ken
--
mailto:wander@xxxxxxxx

============================

   {`Wkly Stoch 5 per %K, slowing=3, no %D}

{start week}
sw:=If(DayOfWeek()<=Ref(DayOfWeek(),-1),1,0);
yestClo:=If(sw>0,Ref(C,-1),0);

  {lowest low last 5 weeks}
LLow:=(ValueWhen(1,sw>0,
       Ref(LowestSince(5,sw>0=1,L),-1)));

  {highest high last 5 weeks}
HHigh:=(ValueWhen(1,sw>0,
        Ref(HighestSince(5,sw>0,H),-1)));


{5 per %K, slowing=3}
y:=(ValueWhen(1,sw>0,(yestClo-LLow))+
    ValueWhen(2,sw>0,(yestClo-LLow))+
    ValueWhen(3,sw>0,(yestClo-LLow)))/

((ValueWhen(1,sw>0,HHigh)+
  ValueWhen(2,sw>0,HHigh)+
  ValueWhen(3,sw>0,HHigh))-

(ValueWhen(1,sw>0,LLow)+
 ValueWhen(2,sw>0,LLow)+
 ValueWhen(3,sw>0,LLow)))*100;
y;


=====================
   {`Wkly Stoch 5 per %K, slowing=3, no %D}

{start week}
sw:=If(DayOfWeek()<=Ref(DayOfWeek(),-1),1,0);
yestClo:=If(sw>0,Ref(C,-1),0);

  {lowest low last 5 weeks}
LLow:=(ValueWhen(1,sw>0,
       Ref(LowestSince(5,sw>0=1,L),-1)));

  {highest high last 5 weeks}
HHigh:=(ValueWhen(1,sw>0,
        Ref(HighestSince(5,sw>0,H),-1)));


{5 per %K, slowing=3}
y:=(ValueWhen(1,sw>0,(yestClo-LLow))+
    ValueWhen(2,sw>0,(yestClo-LLow))+
    ValueWhen(3,sw>0,(yestClo-LLow)))/

((ValueWhen(1,sw>0,HHigh)+
  ValueWhen(2,sw>0,HHigh)+
  ValueWhen(3,sw>0,HHigh))-

(ValueWhen(1,sw>0,LLow)+
 ValueWhen(2,sw>0,LLow)+
 ValueWhen(3,sw>0,LLow)))*100;

{This plots the 3 period %D (ma) of the above.}
z:=(ValueWhen(1,sw>0,y)+ValueWhen(2,sw>0,y)+
    ValueWhen(3,sw>0,y))/3;
z
========================

{`Wkly Momentum for DAILY Chart }

{This plots WEEKLY Momentum on DAILY charts. -Ken  4/16/99}

n:=Input("Periods",1,20,10);
 {start week}
sw:=If(DayOfWeek()<=Ref(DayOfWeek(),-1),1,0);

(ValueWhen(1,sw>0,Ref(C,-1))/
 ValueWhen(n+1,sw>0,
 Ref(C,-1)))*100