Found this code of interest on a NL Prorealtime forum for someone requesting an intraday pivot points indicator. Nicely coded and would surely be of interest of other people around here, I add it to library.
The variables ‘myStartHour’, ‘myStartMinute’, ‘myEndHour’ and ‘myEndMinute’ may be changed to any start and end time for the pivot points calculation.
// Variable Pivots
// by Smoke
// Zeitvariable
myStartHour = 7
myStartMinute = 0
myEndHour = 9
myEndMinute = 0
// umrechnung Zeit
start = (myStartHour * 10000) + (myStartMinute * 100)
ende = (myEndHour * 10000) + (myEndMinute * 100) + 1000
// Hoch-Tief-Close Berechnung
Once myHigh = 0
Once myLow = 1000
If (Day > Day[1]) Then
myLow = Low
myHigh = High
myClose = Close
Endif
If (Time >= start) Then
myClose = Close
If High > myHigh Then
myHigh = High
Else
myHigh = myHigh[1]
Endif
If (Time > ende) Then
myHigh = myHigh[1]
myClose = myClose[1]
Endif
If Low < myLow Then
myLow = Low
Else
myLow = myLow[1]
Endif
If (Time > ende) Then
myLow = myLow[1]
Endif
Endif
If Time >= ende Then
// PP-Berechnung
PRange = ABS(myHigh - myLow)
PP = (myHigh + myLow + myClose) / 3
R1 = 2 * PP - myLow
R22 = PP + PRange
R3 = PP + PRange * 2
R4 = PP + PRange * 3
S1 = 2 * PP - myHigh
S2 = PP - PRange
S3 = PP - Prange * 2
S4 = PP - PRange * 3
Endif
Return PP coloured(0,0,0) as "PP", R1 coloured(255,0,0) as "R1", R22 coloured(255,0,0) as "R2", R3 coloured(255,0,0) as "R3", R4 coloured(255,0,0) as "R4", S1 coloured(0,255,0) as "S1", S2 coloured(0,255,0) as "S2", S3 coloured(0,255,0) as "S3", S4 coloured(0,255,0) as "S4"