I am using as part of an indicator the code of Pivot point as below :
1
2
3
4
5
6
7
8
9
10
11
IfOpenDayOfWeek=1Then
Ht=DHigh(2)
Bs=DLow(2)
C=DClose(2)
Endif
IfOpenDayOfWeek=>2anddayofweek<6Then
Ht=DHigh(1)
Bs=DLow(1)
C=DClose(1)
Endif
Pivot=(Ht+Bs+C)/3
I have noticed sometimes differences between the code and my eye. After some reseachs, I have found the reason of those discrepencies: the Pivot point calculation.
To simplify, the indicator could be : if close > Pivot, it returns 1 and if close < Pivot, it returns -1
the black line is the native Pivot from PRT and the purple one the result of the above the code.
For a reason I don’t understand the Pivot value at the current bar is different. (see pic below)
This difference disappears if I reload PRT, and it comes back the next bar
reb – Topic moved to ProBuilder forum as it is an indicator issue. I have also inserted the code that you posted using the ‘Insert PRT Code’ button. Please ensure that you do the same with all future posts that include code. I have edited your post and inserted the code.
There have been several posts recently about DCLOSE, DHIGH, DLOW and DOPEN not returning the correct values and whilst we wait for PRT to provide a fix it is best to use MTF to return the daily time frame high, low, open and close values rather than use DCLOSE, DHIGH, DLOW and DOPEN.
To help us continually offer you the best experience on ProRealCode, we use cookies. By clicking on "Continue" you are agreeing to our use of them. You can also check our "privacy policy" page for more information.Continue