Pivot Point “Standard” indicator code
Forums › ProRealTime English forum › ProBuilder support › Pivot Point “Standard” indicator code
- This topic has 6 replies, 3 voices, and was last updated 2 years ago by fifi743.
Viewing 7 posts - 1 through 7 (of 7 total)
-
-
12/08/2021 at 4:02 PM #183025
Hello, anyone able to provide the code for the pivot point “standard” indicator for the several timeframes? (daily, weekly, monthly and yearly?)
I got only the daily version:
1234567891011121314151617181920Ht = DHigh(1)Bs = DLow(1)C = DClose(1)IF dayofweek = 1 THENHt = DHigh(2)Bs = DLow(2)C = DClose(2)ENDIFPivot = (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 "Point Pivot", Res1 as "R1", Res2 as "R2", Res3 as "R3", Sup1 as "S1", Sup2 as "S2", Sup3 as "S3"thanks in advance for your support
12/09/2021 at 1:57 PM #183072Pivot Calculation12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394//Pivot calculation methodOnce mode = 1Once dailyPivot = undefinedOnce dailyR1 = undefinedOnce dailyS1 = undefinedOnce dailyR2 = undefinedOnce dailyS2 = undefinedOnce dailyR3 = undefinedOnce dailyS3 = undefinedOnce lastWeekBarIndex = 0Once weeklyHigh = undefinedOnce weeklyLow = undefinedOnce weeklyPivot = undefinedOnce weeklyR1 = undefinedOnce weeklyS1 = undefinedOnce weeklyR2 = undefinedOnce weeklyS2 = undefinedOnce weeklyR3 = undefinedOnce weeklyS3 = undefinedOnce lastMonthBarIndex = 0Once monthlyHigh = undefinedOnce monthlyLow = undefinedOnce monthlyPivot = undefinedOnce monthlyR1 = undefinedOnce monthlyS1 = undefinedOnce monthlyR2 = undefinedOnce monthlyS2 = undefinedOnce monthlyR3 = undefinedOnce monthlyS3 = undefinedIf Day>Day[1] thenIf mode = 0 thendailyPivot = (DHigh(1) + DLow(1) + Close[1]) / 3Elsif mode = 1 thendailyPivot = (Open + DHigh(1) + DLow(1) + Close[1]) / 4Elsif mode = 2 thendailyPivot = (DHigh(1) + DLow(1) + Close[1]*2) / 4ElsedailyPivot = (Open*2 + DHigh(1) + DLow(1)) / 4EndifdailyR1 = 2*dailyPivot - DLow(1)dailyS1 = 2*dailyPivot - DHigh(1)dailyR2 = dailyPivot + (DHigh(1) - DLow(1))dailyS2 = dailyPivot - (DHigh(1) - DLow(1))dailyR3 = dailyR1 + (DHigh(1) - DLow(1))dailyS3 = dailyS1 - (DHigh(1) - DLow(1))EndifIf DayOfWeek<DayOfWeek[1] thenweeklyHigh = Highest[BarIndex - lastWeekBarIndex](High)[1]weeklyLow = Lowest[BarIndex - lastWeekBarIndex](Low)[1]lastWeekBarIndex = BarIndexIf mode = 0 thenweeklyPivot = (weeklyHigh + weeklyLow + Close[1]) / 3Elsif mode = 1 thenweeklyPivot = (Open + weeklyHigh + weeklyLow + Close[1]) / 4Elsif mode = 2 thenweeklyPivot = (weeklyHigh + weeklyLow + Close[1]*2) / 4ElseweeklyPivot = (Open*2 + weeklyHigh + weeklyLow) / 4EndifweeklyR1 = 2*weeklyPivot - weeklyLowweeklyS1 = 2*weeklyPivot - weeklyHighweeklyR2 = weeklyPivot + (weeklyHigh - weeklyLow)weeklyS2 = weeklyPivot - (weeklyHigh - weeklyLow)weeklyR3 = weeklyR1 + (weeklyHigh - weeklyLow)weeklyS3 = weeklyS1 - (weeklyHigh - weeklyLow)EndifIf Month<>Month[1] thenmonthlyHigh = Highest[BarIndex - lastMonthBarIndex](High)[1]monthlyLow = Lowest[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)Endif12/09/2021 at 1:58 PM #18307312/21/2021 at 2:08 PM #18369012/21/2021 at 2:28 PM #18369412/21/2021 at 2:38 PM #18369612/21/2021 at 3:10 PM #183699add barindex
1234567891011121314151617181920212223if barindex>0 thenIf Month<>Month[1] thenmonthlyHigh = Highest[BarIndex - lastMonthBarIndex](High)[1]monthlyLow = Lowest[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)Endifendif -
AuthorPosts
Viewing 7 posts - 1 through 7 (of 7 total)