mirror of
https://github.com/mihakralj/QuanTAlib.git
synced 2026-08-22 20:48:04 +00:00
style patterns
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user