This indicator plots horizontal lines at daily pivot levels R3, R2, R1, Pivot, S1, S2 & S3, using a day that is advanced (or retarded) from the server time (called Pivot Day). You can see in the illustration, that the pivot lines start earlier than the server time days (except for the most recent day, because it was a weekend).
The only input is the integer "ShiftHrs", which gives the number of hours to advance the pivot day. A negative value delays the day for pivot calculation. For example, if your server is on New York time (GMT-5) and you want pivot points in London time (GMT), then ShiftHrs is set to +5 (the default in the code).
Saturday and Sunday trading is not ignored (after all it was real trading). If the pivot day shift results in data appearing on Saturday, it was really Friday where it occured, so the indicator treats it as part of Friday. If the pivot day shift results in data appearing on Sunday, it was really Monday where it occured, so the indicator treats it as Monday.
It uses an indicator buffer for each line, so pivot levels of previous days remain visible. (This has a negative consequence: it is not possible to use the same technique to draw additional intermediate levels (S0.5, S1.5, etc.) because of the limit of 8 buffers.)
Labels are shown for the most recent day's levels.
This indicator can be applied to any chart period, although daily pivots on charts with long periods are meaningless.
The formulae for the caluclations are:
Pivot = ( High + Low + Close ) / 3
Range = High - Low
Resistance1 = 2 * Pivot - Low
Resistance2 = Pivot + Range
Resistance3 = Resistance1 + Range
Support1 = 2 * Pivot - High
Support2 = Pivot - Range
Support3 = Support1 - Range
2009.07.02 Note that I have corrected the calculations for Resistance3 and Support3 in line with the post by substanz. Sorry for the mistake :-(
jellybean thanks for the wonderful indicator. However I think there's an error when calculating pivots on mondays. At least it is an error I found yesterday: the pivots where different from the levels of other platforms while on the other days everything corresponds. I live in Italy but my broker is Uk.
is there a way to add another pivot line? I want to add a line that is the average of the current session's pivot point added to the 2 prior sessions pivot points. it would be called the 3 Period Pivot Point Average.
Yes it is possible to do this. There is a limit of 8 indicator buffers and this indicator uses 7, so as long as you only want to add one more line, it should be OK.
Are you able to program this or are you asking me to do it?
Thanks for the quick reply, I was going to give a crack at coding this, but since I'm new to MQL4 it might not go so well. Can i ask you questions if i run into issues? :) I really want to learn how to do this myself so i can write my own code. :)
Hi Mcleod, Jellybean, and other members,
I have attached a version of Jellybeans fantastic indicator that displays Midpoints between the pivot levels. Will attach a screen shot and also the indicator. As Jellybean mentions, MT4 has a limit of 8 indicator buffers so this midpoint indicator must be attached to your chart as a seperate indicator.
Also, i saw in the first page of comments that the indicator had been updated to show correct levels for R3/S3 however the version i downloaded did not appear to have such a correction? I have adjusted to what i think should be the correct levels, using the same formulas from pivotpointcalculator.com and attached my corrected version for those who may have also downloaded the older version of the indicator.
Jellybean (or anyone else) would you be able to adjust the code for the indicator to display WEEKLY Pivot levels as a seperate indicator? I am new to MQ4 and still learning the ropes, and will attempt to figuire this out myself, but any help would be greatly appreciated.
Thanks for your hard work and great indicator Jellybean, this is by far the best PP indicator i've come across!
I really like your pivots and use them for scalping targets. However, the 1m daily pivot is different from other time frames. Could you fix this?
God bless you,
I have just tried this quickly on EURUSD with several values of ShiftHrs and the values for the levels didn't change as I changed timeframe. Please give me more information, for example, what currency pair and what value of ShiftHrs are you using? I need to replicate the problem before I can investigate it.