Moderator: Perry
Vars:
RefHi(0),
RefLo(0),
DayC(0),
DayH(0),
DayL(0),
DPivot(0),
DPivotR1(0),
DPivotR2(0),
DPivotS1(0),
DPivotS2(0);
{ new day detected}
if Date<>Date[1] then begin
DayC = C[1] ;
DayH = RefHi ;
DayL = RefLo ;
RefHi = H ;
RefLo = L ;
DPivot = (DayC + DayH + DayL) / 3 ;
DPivotR1 = (DPivot*2)-DayL ;
DPivotS1 = (Dpivot*2)-DayH ;
DPivotR2 = Dpivot+(DayH-DayL) ;
DPivotS2 = Dpivot-(DayH-DayL) ;
End ;
{ update daily high / low}
If H > RefHi then RefHi = H ;
If L < RefLo then RefLo = L ;
If DPivot > 0 and currentbar > 50 then
Plot1(DPivot, "Pivot") ;
If DPivotR1 > 0 and currentbar > 50 then
Plot2(DPivotR1, "R1") ;
If DPivotR2 > 0 and currentbar > 50 then
Plot3(DPivotR2, "R2") ;
If DPivotS1 > 0 and currentbar > 50 then
Plot4(DPivotS1, "S1") ;
If DPivotS2 > 0 and currentbar > 50 then
Plot5(DPivotS2, "S2") ;
Vars:
Mo(0),
RefHi(0),
RefLo(0),
HourC(0),
HourH(0),
HourL(0),
Hour_Pivot(0),
HPivotR1(0),
HPivotR2(0),
HPivotS1(0),
HPivotS2(0);
{ uses Mod function to detect new hour }
Mo = Mod(time, 100) ;
{ new hour detected}
If Mo < Mo[1] then begin
HourC = C[1] ;
HourH = RefHi ;
HourL = RefLo ;
RefHi = H ;
RefLo = L ;
Hour_Pivot = (HourC + HourH + HourL) / 3 ;
HPivotR1 = (Hour_Pivot*2)-HourL ;
HPivotS1 = (Hour_Pivot*2)-HourH;
HPivotR2 = Hour_Pivot+(HourH-HourL) ;
HPivotS2 = Hour_Pivot-(HourH-HourL) ;
End ;
{ update daily high / low}
If H > RefHi then RefHi = H ;
If L < RefLo then RefLo = L ;
If Hour_Pivot > 0 and currentbar > 150 then
Plot1(Hour_Pivot, "Pivot") ;
If HPivotR1 > 0 and currentbar > 150 then
Plot2(HPivotR1, "R1") ;
If HPivotR2 > 0 and currentbar > 150 then
Plot3(HPivotR2, "R2") ;
If HPivotS1 > 0 and currentbar > 150 then
Plot4(HPivotS1, "S1") ;
If HPivotS2 > 0 and currentbar > 150 then
Plot5(HPivotS2, "S2") ;
Keer terug naar Handelssystemen + Indicatoren
Gebruikers op dit forum: Geen geregistreerde gebruikers en 5 gasten