PureBytes Links
Trading Reference Links
|
Awesome!
thanks.
On 12/19/05, Jose Silva <josesilva22@xxxxxxxxx> wrote:
DT, try this:
{ Hour's start } {...} HourPds:=4; dStart:=Hour()<>Ref(Hour(),-1)
AND Hour()/HourPds=Int(Hour()/HourPds); {...}
jose '-) http://metastocktools.com
--- In equismetastock@xxxxxxxxxxxxxxx, dr torque <drtorque@xxxx> wrote: >
> jose, > i am using your code as below to plot hourly pivot levels in > intraday charts for intervals less than an hour. You suggested me to > alter Hour's start accordingly. however, hourly pivots seemed to be
> too frequent for me. what i would like to see is the pivots > calculated for 4 hour periods. > > I tried to add a small trick as below but it didnt serve me. Do you > have any idea? > { Hour's start }
> dStart:= abs(Hour()/4)<>Abs(Ref(Hour(),-1)/4); > > > Thanks > > { Plots daily pivot values on intraday charts } > { Apply only to weekday data: > MetaStock -> Tools -> Options -> Chart Options
> -> untick "Ignore weekend data" } > { With thanks to Kevin Barry for pivot logic.} > > { (c)Copyright 2004~2005 Jose Silva > The grant of this license is for personal use
> only - no resale or repackaging allowed. > All code remains the property of Jose Silva. > http://metastocktools.com
} > > { User input } > pds:=Input("Use Highest/Lowest of past x days",1,260,1); > > { Message } > message:=Input("(Plot on intraday charts)",0,0,0); >
> { Hour's start } > dStart:= Hour()<>Ref(Hour(),-1); > > { Previous x Days' High } > Hd:=HighestSince(pds,dStart,H); > Hd:=ValueWhen(1,dStart,ValueWhen(2,1,Hd)); > Hd:=ValueWhen(1,Hd>0,Hd);
> > { Previous x Days' Low } > Ld:=LowestSince(pds,dStart,L); > Ld:=ValueWhen(1,dStart,ValueWhen(2,1,Ld)); > Ld:=ValueWhen(1,Ld>0,Ld); > > { Previous Day's Close } > Cd:=ValueWhen(1,dStart,ValueWhen(2,1,C));
> Cd:=ValueWhen(1,Cd>0,Cd); > > { Pivot } > Pivot:=(Hd+Ld+Cd)/3; {Plot in Green bold} > > { Support } > S1:=2*Pivot-Hd; {Blue} > S2:=Pivot-(Hd-Ld); {Red} > S3:=2*Pivot-(2*Hd-Ld); {dark Green}
> > { Resistance } > R1:=2*Pivot-Ld; {Blue} > R2:=Pivot+(Hd-Ld); {Red} > R3:=2*Pivot+(Hd-2*Ld); {dark Green} > > {All mid-pivot levels light Grey} > M0:=(S2+S3)/2; > M1:=(S1+S2)/2;
> M2:=(Pivot+S1)/2; > M3:=(R1+Pivot)/2; > M4:=(R2+R1)/2; > M5:=(R3+R2)/2; > > { Plot on intraday price charts } > {R3;M5;R2;M4;R1;M3; > Pivot; > M2;S1;M1;S2;M0;S3}
> > Pivot; > > > -- > Dr. Torque > http://groups.yahoo.com/group/FXtrades
YAHOO! GROUPS LINKS
-- Dr. Torque http://groups.yahoo.com/group/FXtrades
YAHOO! GROUPS LINKS
|