Second Raw Moment |
The second raw moment (SecondRawMoment) (SRM) is defined as the mean square (the arithmetic mean of the squares of a set of numbers). The second raw moment is the square of the (RootMeanSquare).
In the case of a set of N values , the SRM is
To initialize indicator, use one of the following constructors:
SecondRawMoment – set default values: period = 14
SecondRawMoment(Int32) – set value for period
SecondRawMoment(TimeSpan) – sets time period
Use
SRM - property to get current value
1// Create new instance 2var indicator = new SecondRawMoment(28); 3 4// Number of stored values 5indicator.HistoryCapacity = 2; 6 7// Add new data point 8indicator.Add(CurrentPrice); 9 10// Get indicator value 11double IndicatorValue = indicator.SRM; 12// Get previous value 13if (indicator.HistoryCount == 2) 14{ 15 double IndicatorPrevValue = indicator[1]; 16}