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:
deepsource-autofix[bot]
2024-10-08 17:31:29 +00:00
committed by GitHub
parent 931bbdb6a0
commit 85b9d9217a
8 changed files with 142 additions and 127 deletions
+14 -14
View File
@@ -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;