Rank: Advanced Member
Groups: Registered, Registered Users, Subscribers Joined: 4/30/2005(UTC) Posts: 112
|
Hi all,
Based on Joetrade 69, we can plot the daily privot (based on previous day H, L, C) on intraday bars. How can we plot "3-day rolling pivot range" based on 3-day's H, L C?
I am interested in plotting the following r1 and s1 only:-
3DPV1 = (highest high of last 3 days + lowest low of last three days + yesterday's close)/3
3DPV2 = (highest high of last 3 days + lowest low of last three days)/2
Diff = Abs(3DPV1 - 3DPV2)
r1 = 3DPV1 + Diff
s1 = 3DPV1 - Diff
I initially want to code it, but failed.... need help on this..
Gary
Joetrade 69's code
Quote:{daily pivot on intraday bars}
ic:=ValueWhen(1,ROC(DayOfWeek(),1,$)<>0,Ref(C,-1));
ih:=ValueWhen(1,ROC(Hour(),1,%)<0,HighestSince(2,ROC(Hour(),1,%)<0,Ref
(H,-1)));
il:=ValueWhen(1,ROC(Hour(),1,%)<0,LowestSince(2,ROC(Hour(),1,%)<0,Ref
(L,-1)));
mp1:=(ih+il+ic)/3;
r2:=mp1+(ih-il);
r1:=(mp1*2)-il;
s1:=(mp1*2)-ih;
s2:=mp1-(r1-s1);
r1;
r2;
s1;
s2;
|