ATR miscalculating!

Viewing 15 posts - 1 through 15 (of 36 total)
  • #71388

    I’m just in the process of transferring all my strategies away from PRT and stumbled over another bug in PRT I wasn’t aware of. I found already a bug a half year ago in PRT’s MACD (they mixed up the names of the lines) but now I had to notice that also ATR is calculated wrong by PRT.

    PRT’s help function gives the correct description how to calculate the ATR but something goes wrong and the indicator gives wrong results.

    If I check for example the daily chart of chicago wheat. The last ATR(14) value PRT gives us is 14,567 but if you calculate according to the formula one finds on the internet (or for example also in PRT’s help function) you get a value of 12,6429.

    I checked this several times. Of course I would be happy if somebody could proof me wrong.

    Anyway since ATR is an indicator used by many I think this is no unimportant find. I’m pretty annoyed by this I must admit. I use ATR in almost all my strategies and all are optimized with PRT’s ATR. Having adapted all strategies to a ATR that is calculated wrongly is not nice. :-S

    1 user thanked author for this post.
    #71391

    Is it possible to add an example?, to be sure we are talking about the same calculation, thanks.

    #71395

    I now found out little more. The difference in the ATR is caused by a difference in closing price of each bar. For high and low of each bar PRT is showing the mid price between bid and ask. This was what I also expected for the close but this isn’t the case. For the close it becomes strange. To give a concrete example:

    I look at chicago wheat JUL-18 contract, daily bars. For the closing price of the 24th may IG gives me bid: 530.9, ask: 531.9, so the mid price would be 531.4. But when I look in the PRT chart I find for the close of the 24th may 530.8!


    @Nicolas
    : Do you have an idea how this can be? It is the same for other days. High and low that PRT gives are exactly the mid prices between bid and ask but the closes are strange. Do you maybe know what PRT uses as closing price?

    #71397

    Oddly this is not the case for all days. For example fridays close is just the mid price between bid and ask. But if one looks back a few days one finds several where this is not true.

    This effects of course all indicators using the closing price. So I guess I really would like to know what closing price this is we see in PRT. 🙂

    #71419

    I just send the following to PRT. I hope I receive an answer:

    “I’m wondering if you can tell me how PRT calculates the shown closing price. As pecified above I’m looking at the dailhy chart of the JUL-18 contract for chicago wheat. Fridays close is given with 544,6 which is exactly the midprice between the bid and ask price I get from IG. This is what I expected.
    But now look at thursday (the day before). The bid and ask I get from IG are 530,9 and 531,9 respectively. The midprice would be 531,4. But if you look in the PRT chart I see a value of 530,8 which is obviously NOT the midprice. So how was this price calculated?
    For wednesday (the day before) it is similar. The midprice according IG would be 530,6 but instead PRT shows 531,1 (this happens to be IG’s ask price for the close of this day).
    Tuesday is again completely different. IG’s midprice is 522,9 but PRT shows 521,1. It continues in this fashion. Can you please explain?
    It is easy to understand that this difference in closing price has a major impact on amost all indicators because they more or less all make use of the closing price in some way.”

    #71431

    Are you using the default time zone of the instrument? and no customized chart?

    #71481

    All default (I think), I have never changed this settings.

    #71511

    Right click on the price chart / ‘custom trading hours’.

    #71514

    I checked and all is default.

    #72197

    Dear PRT,

    Can you PLEASE answer at least this report? I really need this info to port my strategies to another environment. This should be in your interest because after I’m gone you will receive less reports (or even none!) from me. 😉

    #72200

    I got exactly the same value between a personal code of the ATR and the platform one:

     

    #72202

    Same goes with Chicago Wheat.

    #72204

    Of course you do. Please read what I wrote above. The miscalculations are caused by PRT showing a wrong closing price (not the midprice between bid and ask). Your code is using the same close as the builtin ATR so the results are identical. But please compare the bid and ask of the close you can retrieve from IG with the close PRT uses. I can’t make sense to the strange PRT-close. This observations are from the daily chart, I have not checked how it is with other timeframes.

    This affects all indicators using the close, ATR is just an example.

    #72206

    Could you please post some screenshots of the 2 platforms to show the differences, as I can’t replicate it between IG platform and PRT on my own.

    #72207

    I can’t provide any screenshots now since I’m on my way to the airport but I wrote exact examples in #71419. Just open your IG platform and have a look at the bid/ask for the days mentioned and compare them to the close for the day in question PRT shows you. Then you will see…

Viewing 15 posts - 1 through 15 (of 36 total)

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