ATR miscalculating!

Viewing 15 posts - 16 through 30 (of 36 total)
  • #72211

    I know this is of little to no help but +1 for me on this issue – I did a lot of work way back trying to create a multi timeframe ATR so was manually coding/calculating but it was not correlating with the built in PRT ATR – I cannot remember exactly what the issue was but it was similar if not the same to what @Despair is describing (but at the time I was in a period of ‘I’ve had enough of PRT’ so did not bother posting about it and just moved on…)

    #72221

    I am currently looking more closely at this problem, please wait ..

    #72375

    Sorry but I can’t replicate the problem with the new IG platform. Are you looking at the same exact instrument between the 2 platforms? Did you include or not the weekend data? Differences are often coming from Sunday data displayed/included or not, especially on Monday.

    #72689

    I was on vacation and couldn’t provide the info you asked for, but here it comes.

    Have a look at the attached picture. This is the last week for chicago wheat JUL-18 25 USD contract. The left column is the midprice that IG gives me, the right column is the data PRT shows. Obviously there is a significant difference. Some day more, some day less but for example wednesday the difference was 4.4 USD!

    I also checked other underlyings (AEX for example) and it was the same. Not as bad as with wheat though but still.

    @MaxT: I understand and I’m very tired of it too. Now I was away a whole week but didn’t get a single answer from PRT regarding ANY report that is still open. sigh…

    #72691

    @Nicolas: I saw when reprogramming the ATR you used wilder’s smoothing. Are you sure that this is what PRT is using? In the literature one finds all SMA, EMA and wilder smoothing. In the PRT help function this is not specified there is just written “apply a moving average to the true range”.

    #72692

    It is definitely Wilder’s. Try this code and change the average type. Type 3 is an exact match which is Wilder’s average. I guess that would make sense as he developed ATR!

     

    #72693

    I think this too. But if you check with google you will find that this is inconsistent from platform to platform. This is why I ask.

    This of course doesn’t change anything with the problem that PRT shows a strange closing price as I posted above (which is the real problem).

    #72694

    I guess that like all indicators that use an average you can choose whichever style fits your needs the best. Fast reacting but erratic or lagging but smooth. There is no law that says it should be one particular type used for ATR.

    Screenshot_1-2

    As for the data issue – hopefully Nicolas will come up with an answer for that.

    #72697

    I found a post on another forum where somebody posted results that his strategies performed best with an ATR with exponential smoothing. Wilder smoothing was little better than a SMA but not much while the EMA gave really a difference. Maybe something worth to have a look into.

    #72698

    If I use an average in a strategy then I will always run a test with a ‘type’ optimized variable and see how the results are affected. Obviously it is just another method of fitting but then that is what we are doing all the time whether we like it or not.

     

    #72699

    Sure, I just never thought about trying other smoothings when it comes to the ATR.

    If just this closing prices would add up. These are no minor rounding errors. Wednesday this was about 0.85% difference in closing price between IG and PRT on chicago wheat. On a full contract this means over 200 USD difference! This screws up all indicators, backtests and whatever. Almost everything uses the close.

    #72722

    Here are two more pictures showing the problem. Both pictures show chicago wheat 25 USD JUL-18 contract. The first picture is from IG’s platform. It even says “mittpris” what is swedish for midprice. The second picture shows the same day and contract on PRT’s platform. As you can see the high is the same but all three close, low and open are significantly different.

    The prices shown in IG’s platform is what I get from IG when I retrieve the price over IG’s API. The prices PRT shows I do not understand. Also I have no custom tradinghours set that could explain the differences.

    #72726

    Now I had a look at investing.com price of the wheat futures and was surprised. The prices are quite similar to PRT prices. Not exactly but just slightly off, so this I can see as rounding error but according to PRT they are using IG’s data feed.

    Also since IG is the executing broker. Will we see fills to the IG prices or the PRT prices? IG’s I’d assume.

    I’m honestly confused.

    #72747

    I can confirm that the ATR calculation made in PRT is averaged with a Wilders one (which is a small variant of an EMA).

    Despair,  in the 2 charts you shared, the candlesticks look very different,  why do you assume that the price should be the same then? There must be a difference between the 2 contracts: not the same security,  week end data included or not, rollover applied or not …

    #72748

    @Nicolas: I wished it were different contracts (then there would be no problem). It is in both cases the 25 USD contract for chicago wheat (JUL-18) with daily bars. Obviously there is a difference but this is exactly what I’m asking. WHAT is this difference? Weekend data can’t be the issue since there is no weekend session for wheat. I also thought about a different way of building the continuous contract (rollover) but like I wrote above, I thought PRT uses IG’s data feed and therefore the prices should be the same.

    Thank you for confirming that the ATR from PRT uses wilder smoothing.

Viewing 15 posts - 16 through 30 (of 36 total)

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