Change with ATR from 8.0 to 8.5  [SOLVED]

Questions about MultiCharts .NET and user contributed studies.
robbob
Posts: 46
Joined: 26 Jan 2013
Has thanked: 2 times
Been thanked: 3 times

Change with ATR from 8.0 to 8.5

Postby robbob » 17 May 2013

Hi,
I'm having more issues with my compiling my scripts after moving to 8.5. It looks like the API for the ATR indicator has changed. Previously I was calculating ATR for a higher time frame by doing the following.

in Create()
m_avgtruerange = new AvgTrueRange(this,2);

in StartCalc()
m_avgtruerange.length = new Lambda<Int32>(delegate { return atrlength; });

in CalcBar()
(m_avgtruerange[1]*numatrs);


Now it appears in CalcBar I need to do something like:
double atr = this.AverageTrueRange(atrLength,2);

However, it is always returning the value based on the lower timeframe.

Any help would be appreciated.

Thanks,
-Rob

User avatar
Henry MultiСharts
Posts: 9165
Joined: 25 Aug 2011
Has thanked: 1264 times
Been thanked: 2957 times

Re: Change with ATR from 8.0 to 8.5  [SOLVED]

Postby Henry MultiСharts » 21 May 2013

Hello Rob,

Here is how to calculate ATR on data2 in MultiCharts .Net 8.5.
AverageTrueRange interface will be extended in MultiCharts .NET 8.7 Beta 1
Attachments
AtrData2.pln
(1.25 KiB) Downloaded 591 times

robbob
Posts: 46
Joined: 26 Jan 2013
Has thanked: 2 times
Been thanked: 3 times

Re: Change with ATR from 8.0 to 8.5

Postby robbob » 22 May 2013

Thanks Henry, the script worked.

-Rob


Return to “MultiCharts .NET”