Customised Pivot Point Indicator
Forums › ProRealTime English forum › ProBuilder support › Customised Pivot Point Indicator
- This topic has 5 replies, 3 voices, and was last updated 8 years ago by Nicolas.
-
-
05/11/2016 at 2:01 PM #6806
A request that was addressed to ProRealTime:
It would be great if you could help me with a customised indicator I need.
I’m looking for a customised pivot indicator (on price).
– As a starting point the default indicator on the system is fine with standard pivot levels based on yesterdays data, eg P+([H+L+C]/3), R1=(2*P)-L etc
– In addition I need 2 additional horizontal lines placed above and below the ‘P’ line I will describe as the ‘TC’/top channel and ‘BC’ bottom channel.
– These are again both based on yesterdays data.
– The ‘TC’ sits horizontally >P and <R1 and is defined as (P-BC)+P
– The ‘BC’ sits horizontally <P and >S1 and is defined as (H+L)/2
– Core priority is for a daily setting but ideally option for weekly and monthly timeframeAs well :
– ideally option for colour code or if easier to be pre set, eg for TC and BC to both be dotted blue lines or a shaded box?
– Sunday open data to be merged into Monday
– As with default pivot indicator I need to be able to display more than one time period at the same time, eg ‘today’ Mon 1 May (based on Fri 29 data) and ‘yesterday’ Fri 29 (based on Thurs 28 data) etc
– Also need the actual numbers to be displayed on the chart or cursor?Many thanks
Suggestion for an answer:
- Adding texts, shaded boxes etc is only possible with version 10.3 (this request has not been taken into account for this reason)
- This indicator has to be added directly on the price chart and load at least a month’s historical data
- You can adjust style and line types by clicking on wrench icon (v10.3 will also allow to pre-set line styles in the code)
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697//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)EndifReturn dailyPivot as "Daily P", dailyR1 as "Daily R1", dailyS1 as "Daily S1", dailyR2 as "Daily R2", dailyS2 as "Daily S2", dailyR3 as "Daily R3", dailyS3 as "Daily S3", weeklyPivot as "Weekly P", weeklyR1 as "Weekly R1", weeklyS1 as "Weekly S1", weeklyR2 as "Weekly R2", weeklyS2 as "Weekly S2", weeklyR3 as "Weekly R3", weeklyS3 as "Weekly S3", 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"05/11/2016 at 2:06 PM #680709/17/2016 at 1:13 PM #13184Hi
Thanks for the great code. 2 Questions though…
- Please see attached file. When opening a chart, the price action is compressed to show all the pivot data points. How can that be fixed in the code? It would be tedious to scroll / adjust the price column all the time?
- Day on Day / Week on Week and Month on Month pivots are linked with a line. It would be so much cleaner if the pivots are not ‘attached’ to each other. In other words if yesterday’s pivot was 3456 and today it is 3476 then there is not a line linking the daily pivots. It gives a jagged result and makes the chart look cluttered. I hope that makes sense.
Thanks and regards
09/17/2016 at 1:31 PM #13195Hi,
- The only way to get it work like this would be to only display the last pivot lines. That involve some code modifications.
- In v10.2, the lines are continuous, in fact they are horizontal curves, so that’s why they are all linked like this. The only solution to have them not linked together is to set the pivot lines to “dots”
09/18/2016 at 10:24 AM #13221Thanks for the reply Nicolas. I’m still finding my way in coding. How do I set the pivots to dots so that the continuous link can be broken (or better even – disappear)? Going through threads for examples but not finding any
09/18/2016 at 1:45 PM #13227 -
AuthorPosts
Find exclusive trading pro-tools on