Wrong Pivot points on Futures NQ and DJ
Forums › ProRealTime English forum › ProBuilder support › Wrong Pivot points on Futures NQ and DJ
- This topic has 52 replies, 6 voices, and was last updated 10 months ago by PeterSt.
-
-
02/05/2024 at 5:04 AM #227405
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
02/05/2024 at 11:17 PM #227446Hi @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.
02/06/2024 at 5:26 AM #227450Hi 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.
02/06/2024 at 9:48 PM #227494Sur les futures, la cloture de PRT est différente de celle de globex.(dernier tick pris en compte)
voir graphique02/06/2024 at 9:51 PM #227496le dossier a déjà été traité
https://www.prorealcode.com/topic/points-pivots-probleme-de-cloture/1 user thanked author for this post.
02/07/2024 at 7:00 AM #22750302/07/2024 at 8:01 AM #227504Hi 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…
02/07/2024 at 8:08 AM #227505Sure, thank you.
Month and day are corrected because of PRT bug on (some) futures (day increases only at 7:00)
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980MaxDayInFeburary=29myTime=TimemyDay=daymyMonth=monthif myTime>=000000 and myTime<= 065959 thenmyDay=myDay+1if myMonth=1 and myDay>31 thenmyMonth=2myDay=1elsif myMonth=2 and myDay>MaxDayInFeburary thenmyMonth=3myDay=1elsif myMonth=3 and myDay>31 thenmyMonth=4myDay=1elsif myMonth=4 and myDay>30 thenmyMonth=5myDay=1elsif myMonth=5 and myDay>31 thenmyMonth=6myDay=1elsif myMonth=6 and myDay>30 thenmyMonth=7myDay=1elsif myMonth=7 and myDay>31 thenmyMonth=8myDay=1elsif myMonth=8 and myDay>31 thenmyMonth=9myDay=1elsif myMonth=9 and myDay>30 thenmyMonth=10myDay=1elsif myMonth=10 and myDay>31 thenmyMonth=11myDay=1elsif myMonth=11 and myDay>30 thenmyMonth=12myDay=1elsif myMonth=12 and myDay>31 thenmyMonth=1myDay=1endifendif//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 = 0If myMonth<>myMonth[1] thenMonthlyHigh = Highest[max(1,BarIndex - lastMonthBarIndex)](High)[1]MonthlyLow = Lowest[max(1,BarIndex - lastMonthBarIndex)](Low)[1]lastMonthBarIndex = BarIndexIf mode = 0 thenMonthlyPivot = (MonthlyHigh + MonthlyLow + Close[1]) / 3Elsif mode = 1 thenMonthlyPivot = (Open + MonthlyHigh + MonthlyLow + Close[1]) / 4Elsif mode = 2 thenMonthlyPivot = (MonthlyHigh + MonthlyLow + Close[1]*2) / 4ElseMonthlyPivot = (Open*2 + MonthlyHigh + MonthlyLow) / 4EndifMonthlyR1 = 2*MonthlyPivot - MonthlyLowMonthlyS1 = 2*MonthlyPivot - MonthlyHighMonthlyR2 = MonthlyPivot + (MonthlyHigh - MonthlyLow)MonthlyS2 = MonthlyPivot - (MonthlyHigh - MonthlyLow)MonthlyR3 = MonthlyR1 + (MonthlyHigh - MonthlyLow)MonthlyS3 = MonthlyS1 - (MonthlyHigh - MonthlyLow)Endifreturn 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, MonthlyLow02/07/2024 at 8:21 AM #227506I just tried with timeframe 1 month instead, same problem
123456789101112131415timeframe(1 month)Ht = High[1]Bs = Low[1]C = close[1]Pivot = (Ht + Bs + C) / 3Res3 = Ht + ((Pivot - Bs)*2)Res2 = Pivot + Ht - BsRes1 = (2 * Pivot) - BsSup1 = (2 * Pivot) - HtSup2 = 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"02/07/2024 at 8:31 AM #22750702/07/2024 at 9:06 AM #227508There 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!
02/07/2024 at 9:13 AM #22751202/07/2024 at 9:29 AM #227516For daily pivot point i did this (that i already posted several times here).
For Daily Pivot Point12345678910IF (DAYOFWEEK=DAYOFWEEK[1] and DAYOFWEEK<>DAYOFWEEK[2] and dayofweek>1) or (dayofweek<DAYOFWEEK[1]) thenIF dayofweek <> 1 or (dayofweek<DAYOFWEEK[1]) THENPivotDuJour = (DHigh(1) + DLow(1) + DClose(1)) / 3Elsif dayofweek = 1 thenPivotDuJour = (DHigh(2) + DLow(2) + DClose(2)) / 3endifdrawvline(barindex)endifReturn PivotDuJourGive me few minutes / 1 hour, i am looking at it for monthly/weekly pivot point
1 user thanked author for this post.
02/07/2024 at 9:30 AM #22751702/07/2024 at 11:27 AM #227525Daily and Monthly Pivots12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061ONCE DayH = highONCE DayL = lowONCE DayC = closeONCE FullDay = 0ONCE FullMonth = 0IF (OpenTime=010000 and dayofweek<>1) or (dayofweek<DAYOFWEEK[1]) THENif dayofweek <> 1 or (dayofweek<DAYOFWEEK[1]) THENPivotDuJour = (DHigh(1) + DLow(1) + DClose(1)) / 3elsif dayofweek = 1 thenPivotDuJour = (DHigh(2) + DLow(2) + DClose(2)) / 3endifMonthi = MonthMonthH = max(MonthH,DayH)MonthL = min(MonthL,DayL)MonthC = DayCpDayI = DayIpDayH = DayHpDayL = DayLpDayC = DayCDayI = DayDayH = HighDayL = LowDayC = CloseIf FullDay thenDayPivot = (pDayH + pDayL + pDayC)/3ElseDayPivot = undefinedFullDay = 1EndifIf DayI < pDayI thenpMonthH = MonthHpMonthL = MonthLpMonthC = MonthCMonthH = HighMonthL = LowMonthC = CloseIf FullMonth thenMonthPivot = (pMonthH + pMonthL + pMonthC)/3ElseMonthPivot = undefinedFullMonth = 1Endifdrawvline(barindex)EndifENDIFDayH = max(DayH,high)DayL = min(DayL,low)DayC = closeReturn MonthPivot -
AuthorPosts
Find exclusive trading pro-tools on