True Range |
TrueRange is a technical analysis volatility indicator. The indicator does not provide an indication of price trend, simply the degree of price volatility. The range of a day's trading is simply high − low. The true range extends it to yesterday's closing price if it was outside of today's range.
The true range is the largest of the:
Most recent period's high less the most recent period's low
Absolute value of the most recent period's high less the previous close
Absolute value of the most recent period's low less the previous close
The idea of ranges is that they show the commitment or enthusiasm of traders. Large or increasing ranges suggest traders prepared to continue to bid up or sell down a stock through the course of the day. Decreasing range suggests waning interest.
Indicator has no input parameters. To initialize TrueRange indicator use the following constructor:
Use
TR - property to get current value
1// Create new instance 2TrueRange tr = new TrueRange(); 3 4// Number of stored values 5tr.HistoryCapacity = 2; 6 7// Add new data point 8tr.Add(Bars.Current.Open, Bars.Current.High, Bars.Current.Low, Bars.Current.Close, Bars.Current.Volume); 9 10// Get indicator value 11double IndicatorValue = tr.TR; 12// Get previous value 13if (tr.HistoryCount == 2) 14{ 15 double IndicatorPrevValue = tr[1]; 16}