Skip to content

Commit 85916ca

Browse files
committed
ParabolicSar fix.
1 parent 84cc514 commit 85916ca

2 files changed

Lines changed: 1 addition & 6 deletions

File tree

Algo/Indicators/ParabolicSar.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ protected override IIndicatorValue OnProcess(IIndicatorValue input)
272272
IsFormed = true;
273273

274274
var b = _buf;
275-
var val = b.Calculate(_candles, this.GetCurrentValue(), Acceleration, AccelerationMax, AccelerationStep, input.IsFinal, input.ToCandle());
275+
var val = b.Calculate(input.IsFinal ? _candles : [.. _candles], this.GetCurrentValue(), Acceleration, AccelerationMax, AccelerationStep, input.IsFinal, input.ToCandle());
276276

277277
if (input.IsFinal)
278278
_buf = b;

Tests/IndicatorTests.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,6 @@ public void StateNonFinalInput()
6060

6161
foreach (var type in GetIndicatorTypes())
6262
{
63-
if (
64-
type.Indicator == typeof(ParabolicSar)
65-
)
66-
continue;
67-
6863
var indicator = type.CreateIndicator();
6964
indicator.IsFormed.AssertFalse();
7065

0 commit comments

Comments
 (0)