How does WL calculate the ATR?
I have selected a trailing ATR of 6, 3.00 as per the attached screenshot.
If I plot an ATR of 6, 3.00 on the chart, it is a different price to what the preference command is producing. So I am thinking it must be calculated differently, so how is it calculated and can I change how it is calculated?
Rename
You're showing the use of the TASC ATRTrail indicator for % Risk Sizing. TASC indicators are documented by their articles in the magazine. Sadly our documentation doesn't even indicate which issue this one's from, so here's the code that populates the indicator.
CODE:If you're looking for a straight ATR calculation for your Max Risk Sizing, you should do it yourself using the MathIndOpInd indicator.
public override void Populate() { BarHistory source = Parameters[0].AsBarHistory; Int32 period = Parameters[1].AsInt; Double factor = Parameters[2].AsDouble; DateTimes = source.DateTimes; //ATR ATR atr = new ATR(source, period); //calculate ATR Trailing Stop for (int n = period; n < source.Count; n++) { double loss = factor * atr[n]; if (source.Close[n] > Values[n - 1] && source.Close[n - 1] > Values[n - 1]) Values[n] = Math.Max(Values[n - 1], source.Close[n] - loss); else if (source.Close[n] < Values[n - 1] && source.Close[n - 1] < Values[n - 1]) Values[n] = Math.Min(Values[n - 1], source.Close[n] + loss); else Values[n] = source.Close[n] > Values[n - 1] ? source.Close[n] - loss : source.Close[n] + loss; } }
p.s. ATRTrail was from the June 2009 issue of TASC magazine.
https://traders.com/Documentation/FEEDbk_docs/2009/06/Vervoort.html
https://traders.com/Documentation/FEEDbk_docs/2009/06/Vervoort.html
QUOTE:
ATRTrail was from the June 2009 issue of TASC magazine.
If the ATRModified and ATRTrail indicators are both from the same TASC issue, then how are they different?
ATRModified is an inconsecuential modification (imho) of ATR.
ATRTrail is a value you can use for a SAR strategy.
ATRTrail is a value you can use for a SAR strategy.
Your Response
Post
Edit Post
Login is required