style patterns

This commit is contained in:
Miha Kralj
2026-01-25 16:01:45 -08:00
parent 2836f253c4
commit e59665c8f0
399 changed files with 6892 additions and 1323 deletions
+17 -4
View File
@@ -47,7 +47,10 @@ public class AccelIndicator : Indicator, IWatchlistIndicator
protected override void OnUpdate(UpdateArgs args)
{
if (_accel == null || _selector == null) return;
if (_accel == null || _selector == null)
{
return;
}
var item = HistoricalData[0, SeekOriginHistory.End];
double value = _selector(item);
@@ -64,7 +67,9 @@ public class AccelIndicator : Indicator, IWatchlistIndicator
{
value = _accel!.Last.Value;
if (!double.IsFinite(value))
{
value = 0.0;
}
}
TValue input = new(time, value);
@@ -87,8 +92,16 @@ public class AccelIndicator : Indicator, IWatchlistIndicator
[MethodImpl(MethodImplOptions.AggressiveInlining)]
private static IndicatorLineMarker GetMarker(double value)
{
if (value > 0) return GreenMarker;
if (value < 0) return RedMarker;
if (value > 0)
{
return GreenMarker;
}
if (value < 0)
{
return RedMarker;
}
return GrayMarker;
}
}
}