mirror of
https://github.com/mihakralj/QuanTAlib.git
synced 2026-08-25 22:08:05 +00:00
style: format code with dotnet-format
This commit fixes the style issues introduced in 931bbdb according to the output
from dotnet-format.
Details: https://github.com/mihakralj/QuanTAlib/pull/30
This commit is contained in:
+14
-14
@@ -22,23 +22,23 @@ public class Rma : AbstractBase
|
||||
_alpha = 1.0 / _period; // Wilder's smoothing factor
|
||||
Name = $"Rma({_period})";
|
||||
Init();
|
||||
}
|
||||
}
|
||||
|
||||
public Rma(object source, int period) : this(period)
|
||||
{
|
||||
public Rma(object source, int period) : this(period)
|
||||
{
|
||||
var pubEvent = source.GetType().GetEvent("Pub");
|
||||
pubEvent?.AddEventHandler(source, new ValueSignal(Sub));
|
||||
}
|
||||
}
|
||||
|
||||
public override void Init()
|
||||
{
|
||||
public override void Init()
|
||||
{
|
||||
base.Init();
|
||||
_lastRMA = 0;
|
||||
_savedLastRMA = 0;
|
||||
}
|
||||
}
|
||||
|
||||
protected override void ManageState(bool isNew)
|
||||
{
|
||||
protected override void ManageState(bool isNew)
|
||||
{
|
||||
if (!isNew)
|
||||
{
|
||||
_lastRMA = _savedLastRMA;
|
||||
@@ -48,10 +48,10 @@ public class Rma : AbstractBase
|
||||
_savedLastRMA = _lastRMA;
|
||||
_lastValidValue = Input.Value;
|
||||
_index++;
|
||||
}
|
||||
}
|
||||
|
||||
protected override double Calculation()
|
||||
{
|
||||
protected override double Calculation()
|
||||
{
|
||||
ManageState(Input.IsNew);
|
||||
|
||||
double rma;
|
||||
@@ -69,9 +69,9 @@ public class Rma : AbstractBase
|
||||
|
||||
// Wilder's smoothing method
|
||||
return _alpha * (Input.Value - _lastRMA) + _lastRMA;
|
||||
}
|
||||
}
|
||||
|
||||
_lastRMA = rma;
|
||||
_lastRMA = rma;
|
||||
IsHot = _index >= WarmupPeriod;
|
||||
|
||||
return rma;
|
||||
|
||||
Reference in New Issue
Block a user