Pivot Point 4h miscalculation on one day only: August 5, 2020

Forums ProRealTime English forum ProOrder support Pivot Point 4h miscalculation on one day only: August 5, 2020

Viewing 7 posts - 1 through 7 (of 7 total)
  • #142101

    Hello everybody,

    I’ve been looking at the different threads that offer some formula to calculate pivot points in order to use it in strategies and I’ve eventually used Nicolas’s that you may find here : https://www.prorealcode.com/prorealtime-indicators/fibonacci-pivots-points-4-hours-daily-weekly-monthly/

    (Thank you very much Nicolas, you’ve been a tremendous help)

     

    I’ve kept this part only (from line 50 to 56 in the original post)

    I’ve changed the first line adding 1 to each hour because otherwise ProOrder wouldn’t take  the right hour frames into account. Probably because I’m on a different time frame on PRT, but it doesn’t seem to matter really.

     

    I’ve used it on the DAX30 and I have checked around 20 occurrences and it works like a charm… except on one day.

    On August 5, 2020, from 9 am to 13 (so 8 to 12 with the normal time frame), the pivot point is supposed to be 12 658,53 but the code’s calculation makes it 12 656,27.

    Previous close is 12682, previous high is 12688,3 and previous low is 12605,3.

    It does the same from 5 pm to 9 (so 4 pm to 8 on a normal time frame) on the same day!

     

    You may try it out for yourself with this bit of code :

    (don’t forget to change the first line depending on your time frame)

     

    I have no idea why there’s a mistake or even where, so if you might help it would be very much appreciated!

    Obviously, I haven’t checked all the possible pivot points but it might have happened elsewhere too without my knowing.

    #142152

    We must grapher the variables of the pivot: hhigh + llow + cclose, and see which one is wrong. If the result is not good, we analyze the calculation and by going up like that you will find the reason for the bad result.

    #142529

    Hey thx for your help, I should have thought about it.

    So for both Pivot Points, the mistake is that ProOrder doesn’t use the correct hhigh.

    To calculate the PP from 9 am to 13, it uses the hhigh from the candle preceding the closing candle even if the high of the closing candle is higher. For example, with a 2-minute timeframe, it’ll take into consideration the candle from 08:56 to 08:58 instead of the candle from 08:58 to 09:00

     

    To calculate the PP from 5 pm to 9, ProOrder uses the hhigh from the candle preceding the opening candle. For instance, with a 2-minute timeframe, it’ll take into consideration the candle from 12:58 to 13:00 instead of using the candle from 1:34 pm to 1:36.

     

    It might seem that ProOrder’s calculation is always one candle late, meaning for example that it uses the 8:58 to 12:58 timeframe instead of the 09:00 to 13:00 timeframe to get its data. But it collects the correct data for cclose, which means it does include the last candle. Would it mean that it doesn’t include the last candle only to get the hhigh data (and maybe the llow too)?

    Not sure what to do with that… If ever you have any ideas, please let me know.

    #142569

    Try to use OpenHour instead of Hour for your highest/lowest calculation.

    #142686

    Hey, it has had no effect. Either on hhigh values or llow values. Cclose hasn’t changed either though.

     

    So I’ve checked a few other occurrencies and there’s also a discrepancy between the actual llows and the llows that ProOrder uses.

    For example, on August 26 from 9pm to 1am (8pm to 0pm on a normal timeframe), ProOrder uses the llow from 4:58 to 5:00 when it should only consider the lows from 5:00 to 9:00 to make its calculations.

    There are other similar examples the same day.

     

    In view of the examples given above and the new ones, it leads me to assume that ProOrder (or the code) does use the correct timeframe to collect the cclose but does not to collect the hhigh and llow. It is even more strange that, when using the graph command, all values change at the same time, between the last candle of each 4-hour period.

    #148144

    @Tanou found the solution in another thread, many thanks!

    In case anyone needs it, here it is:

     

     

    #149738

    Glad to see that it helps! 😃😉

Viewing 7 posts - 1 through 7 (of 7 total)

Create your free account now and post your request to benefit from the help of the community
Register or Login