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

Re: weekly pivots



PureBytes Links

Trading Reference Links

Here you are, Bijan.
This plots the pivot, R1, R2, S1, and S2.

Claud

Dw:=If(DayOfWeek()<=Ref(DayOfWeek(),-1),1,0);
{Weekly Typical Price}
PP1:=If(Dw=1,
{then}(Ref(HighestSince(1,Dw=1,H),-1)+
Ref(LowestSince(1,Dw=1,L),-1) +
Ref(C,-1))/3,
{else}0);
{Weekly High}
Wh1:=If(Dw=1,
{then}Ref(HighestSince(1,Dw=1,H),-1),
{else}0);
{Weekly Low}
Wl1:=If(Dw=1,
{then}Ref(LowestSince(1,Dw=1,L),-1),
{else}0);
Wh:=ValueWhen(1,Wh1>0,Wh1);
Wl:=ValueWhen(1,Wl1>0,Wl1);
{Pivot Point}
PP:=ValueWhen(1,PP1>0,PP1);
{Resistance 1}
R1:=(2*PP)-Wl;
{Support 1}
S1:=(2*PP)-Wh;
{Resistance 2}
R2:=(PP-S1)+R1;
{Support 2}
S2:=PP-(R1-S1);
R2;
R1;
PP;
S1;
S2

Bijan Khezri wrote:

> Does anyone know how to write an indicator to plot the weekly pivot
> ((h+l+c)/3) on a daily chart?  Thanks
>
> Bijan