33 private decimal _prevClose;
68 : this($
"TSI({longTermPeriod},{shortTermPeriod},{signalPeriod})", longTermPeriod, shortTermPeriod, signalPeriod, signalType)
86 _absPriceChangeEmaEma =
new ExponentialMovingAverage(name +
"_APC_EMA_EMA", shortTermPeriod).Of(_absPriceChangeEma,
true);
87 _tsi = _priceChangeEmaEma.Over(_absPriceChangeEmaEma).Times(100m);
88 Signal = signalType.AsIndicator(name +
"_Signal", signalPeriod).Of(_tsi,
true);
101 _prevClose = input.
Price;
105 var priceChange = input.
Price - _prevClose;
106 _prevClose = input.
Price;
107 _priceChangeEma.Update(input.
Time, priceChange);
108 _absPriceChangeEma.Update(input.
Time, Math.Abs(priceChange));
110 return _tsi.Current.Value;
119 _priceChangeEma.Reset();
120 _priceChangeEmaEma.Reset();
121 _absPriceChangeEma.Reset();
122 _absPriceChangeEmaEma.Reset();