ATR miscalculating!
Forums › ProRealTime English forum › ProRealTime platform support › ATR miscalculating!
- This topic has 35 replies, 4 voices, and was last updated 6 years ago by Vonasi.
-
-
06/04/2018 at 1:21 PM #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…)
06/04/2018 at 2:10 PM #7222106/05/2018 at 4:31 PM #72375Sorry 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.
06/09/2018 at 10:00 AM #72689I 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…
06/09/2018 at 10:09 AM #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”.
06/09/2018 at 10:31 AM #72692It 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!
12345678Period = 14Type = 3PRTATR = AverageTrueRange[Period]a = MAX(MAX((high - low),ABS(High - close[1])),ABS(Low - Close[1]))CalcATR = Average[Period,type](a)Return PRTATR as "PRT ATR", CalcATR as "Calculated ATR"06/09/2018 at 11:05 AM #72693I 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).
06/09/2018 at 11:21 AM #72694I 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.
As for the data issue – hopefully Nicolas will come up with an answer for that.
06/09/2018 at 11:25 AM #72697I 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.
06/09/2018 at 11:31 AM #72698If 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.
1a = Average[Period,Type](close)06/09/2018 at 12:01 PM #72699Sure, 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.
06/09/2018 at 3:54 PM #72722Here 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.
06/09/2018 at 4:42 PM #72726Now 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.
06/10/2018 at 9:07 AM #72747I 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 …
06/10/2018 at 9:14 AM #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.
-
AuthorPosts
Find exclusive trading pro-tools on