Hello,
I display the native PRT montly pivot points and I compare them with some calculated one (base on the same formula).
- on futures nasdaq NQXXXX and dowjones YMXXXX (I did not test others): I have some deltas of 10 or 20 points between the native and calculated ones
- NQXXXNG or YMXXXXNG (i.e. without GLOBEX sessions): no delta
- stocks : no delta
So it appears that GLOBLEX sessions introduce problems. Do you understand where it can come from and ?
Thank you
JSParticipant
Veteran
Hi @Jerome888
The non-Globex sessions run from 15:30-22:15 (UTC+01:00) so the regular trading hours.
The Globex sessions run from 00:00-00:00 (UTC+01:00) so also outside regular trading hours.
These different times can give different values for Open, Close, High, and Low.
Due to the different values, you also get differences in the calculation of the pivots.
Hi jS,
Thank you. Perhaps I was not clear, let me try to reformulate:
When I compare the pivot points I calculate (probuilder) with the PRT’s native pivot points, I have no difference on futures without globex or on equities. However, there is a difference (between the pivot points I calculate and those native to PRT) on futures with globex.
Sur les futures, la cloture de PRT est différente de celle de globex.(dernier tick pris en compte)
voir graphique
Merci.
Tu as réussi finalement à trouver une solution ?
Hi jS,
Thank you. Perhaps I was not clear, let me try to reformulate:
When I compare the pivot points I calculate (probuilder) with the PRT’s native pivot points, I have no difference on futures without globex or on equities. However, there is a difference (between the pivot points I calculate and those native to PRT) on futures with globex.
Can you add the code you are using to calculat the pivot points ? It would be easier for others to help you…
Sure, thank you.
Month and day are corrected because of PRT bug on (some) futures (day increases only at 7:00)
MaxDayInFeburary=29
myTime=Time
myDay=day
myMonth=month
if myTime>=000000 and myTime<= 065959 then
myDay=myDay+1
if myMonth=1 and myDay>31 then
myMonth=2
myDay=1
elsif myMonth=2 and myDay>MaxDayInFeburary then
myMonth=3
myDay=1
elsif myMonth=3 and myDay>31 then
myMonth=4
myDay=1
elsif myMonth=4 and myDay>30 then
myMonth=5
myDay=1
elsif myMonth=5 and myDay>31 then
myMonth=6
myDay=1
elsif myMonth=6 and myDay>30 then
myMonth=7
myDay=1
elsif myMonth=7 and myDay>31 then
myMonth=8
myDay=1
elsif myMonth=8 and myDay>31 then
myMonth=9
myDay=1
elsif myMonth=9 and myDay>30 then
myMonth=10
myDay=1
elsif myMonth=10 and myDay>31 then
myMonth=11
myDay=1
elsif myMonth=11 and myDay>30 then
myMonth=12
myDay=1
elsif myMonth=12 and myDay>31 then
myMonth=1
myDay=1
endif
endif
//PRC_MonthlyPivotPoints | indicator
//26.10.2016
//Nicolas @ www.prorealcode.com
//Sharing ProRealTime knowledge
//adapted from PRT original indicator
//select mode of calculation of the Monthly pivot points (0,1,2)
mode = 0
If myMonth<>myMonth[1] then
MonthlyHigh = Highest[max(1,BarIndex - lastMonthBarIndex)](High)[1]
MonthlyLow = Lowest[max(1,BarIndex - lastMonthBarIndex)](Low)[1]
lastMonthBarIndex = BarIndex
If mode = 0 then
MonthlyPivot = (MonthlyHigh + MonthlyLow + Close[1]) / 3
Elsif mode = 1 then
MonthlyPivot = (Open + MonthlyHigh + MonthlyLow + Close[1]) / 4
Elsif mode = 2 then
MonthlyPivot = (MonthlyHigh + MonthlyLow + Close[1]*2) / 4
Else
MonthlyPivot = (Open*2 + MonthlyHigh + MonthlyLow) / 4
Endif
MonthlyR1 = 2*MonthlyPivot - MonthlyLow
MonthlyS1 = 2*MonthlyPivot - MonthlyHigh
MonthlyR2 = MonthlyPivot + (MonthlyHigh - MonthlyLow)
MonthlyS2 = MonthlyPivot - (MonthlyHigh - MonthlyLow)
MonthlyR3 = MonthlyR1 + (MonthlyHigh - MonthlyLow)
MonthlyS3 = MonthlyS1 - (MonthlyHigh - MonthlyLow)
Endif
return MonthlyPivot as "Monthly P", MonthlyR1 as "Monthly R1", MonthlyS1 as "Monthly S1", MonthlyR2 as "Monthly R2", MonthlyS2 as "Monthly S2", MonthlyR3 as "Monthly R3", MonthlyS3 as "Monthly S3", MonthlyHigh, MonthlyLow
I just tried with timeframe 1 month instead, same problem
timeframe(1 month)
Ht = High[1]
Bs = Low[1]
C = close[1]
Pivot = (Ht + Bs + C) / 3
Res3 = Ht + ((Pivot - Bs)*2)
Res2 = Pivot + Ht - Bs
Res1 = (2 * Pivot) - Bs
Sup1 = (2 * Pivot) - Ht
Sup2 = Pivot - (Ht - Bs)
Sup3 = Bs - ((Ht-Pivot)*2)
return Pivot as "Monthly P", Res1 as "Monthly R1", Sup1 as "Monthly S1", Res2 as "Monthly R2", Sup2 as "Monthly S2", Res3 as "Monthly R3", Sup3 as "Monthly S3"
It loooks like end of session (so also end of the month) considered by PRT is the close at 22:15 not at 00:00.
So timframe 1 month cannot be used since we shall detect the close at 22:15.
There is problem with month prt instruction (as well as with day, or dayofweek), look at the pictures (in 1 hour time frame and daily time frame).
Those instructions change the day at midnight and with 1 hour of the sunday (midnight to 1h AM) things can get very wrong…
So using dayofweek, month, or week instructions only will not give the good pivot points as the bgining/end (and so the high/low/close) are not the same!
Thank you.
Do you know the hours used by PRT for their native monthly pivots ?
For daily pivot point i did this (that i already posted several times here).
IF (DAYOFWEEK=DAYOFWEEK[1] and DAYOFWEEK<>DAYOFWEEK[2] and dayofweek>1) or (dayofweek<DAYOFWEEK[1]) then
IF dayofweek <> 1 or (dayofweek<DAYOFWEEK[1]) THEN
PivotDuJour = (DHigh(1) + DLow(1) + DClose(1)) / 3
Elsif dayofweek = 1 then
PivotDuJour = (DHigh(2) + DLow(2) + DClose(2)) / 3
endif
drawvline(barindex)
endif
Return PivotDuJour
Give me few minutes / 1 hour, i am looking at it for monthly/weekly pivot point
ONCE DayH = high
ONCE DayL = low
ONCE DayC = close
ONCE FullDay = 0
ONCE FullMonth = 0
IF (OpenTime=010000 and dayofweek<>1) or (dayofweek<DAYOFWEEK[1]) THEN
if dayofweek <> 1 or (dayofweek<DAYOFWEEK[1]) THEN
PivotDuJour = (DHigh(1) + DLow(1) + DClose(1)) / 3
elsif dayofweek = 1 then
PivotDuJour = (DHigh(2) + DLow(2) + DClose(2)) / 3
endif
Monthi = Month
MonthH = max(MonthH,DayH)
MonthL = min(MonthL,DayL)
MonthC = DayC
pDayI = DayI
pDayH = DayH
pDayL = DayL
pDayC = DayC
DayI = Day
DayH = High
DayL = Low
DayC = Close
If FullDay then
DayPivot = (pDayH + pDayL + pDayC)/3
Else
DayPivot = undefined
FullDay = 1
Endif
If DayI < pDayI then
pMonthH = MonthH
pMonthL = MonthL
pMonthC = MonthC
MonthH = High
MonthL = Low
MonthC = Close
If FullMonth then
MonthPivot = (pMonthH + pMonthL + pMonthC)/3
Else
MonthPivot = undefined
FullMonth = 1
Endif
drawvline(barindex)
Endif
ENDIF
DayH = max(DayH,high)
DayL = min(DayL,low)
DayC = close
Return MonthPivot