27 private readonly decimal _multiplier;
28 private decimal _superTrend;
29 private decimal _currentClose;
30 private decimal _previousTrailingUpperBand;
31 private decimal _previousTrailingLowerBand;
32 private decimal _previousClose;
33 private decimal _prevSuper;
34 private readonly
int _period;
64 public override bool IsReady => _averageTrueRange.IsReady;
82 _multiplier = multiplier;
94 : this($
"SuperTrend({period},{multiplier})", period, multiplier, movingAverageType)
105 if (!_averageTrueRange.Update(input))
107 _previousClose = input.
Close;
111 _currentClose = input.
Close;
118 if ((_prevSuper == -1) || (_prevSuper == _previousTrailingUpperBand))
122 else if (_prevSuper == _previousTrailingLowerBand)
128 _previousClose = _currentClose;
129 _prevSuper = _superTrend;
141 _averageTrueRange.Reset();
142 _previousTrailingLowerBand = 0;
143 _previousTrailingUpperBand = 0;