mirror of
https://github.com/mihakralj/QuanTAlib.git
synced 2026-08-20 11:38:05 +00:00
[CodeFactor] Apply fixes to commit 0606491
This commit is contained in:
@@ -507,8 +507,8 @@ public class QstickTests
|
||||
|
||||
for (int i = 0; i < 20; i++)
|
||||
{
|
||||
double open = 100.0 + i * 0.5;
|
||||
double close = open + (i % 3 - 1); // varies between -1, 0, 1
|
||||
double open = 100.0 + (i * 0.5);
|
||||
double close = open + ((i % 3) - 1); // varies between -1, 0, 1
|
||||
bars.Add(new TBar(time.AddMinutes(i).Ticks, open, open + 2, open - 1, close, 1000));
|
||||
}
|
||||
|
||||
|
||||
@@ -123,7 +123,7 @@ public sealed class QstickValidationTests : IDisposable
|
||||
|
||||
// Bar 2: diff = 3, EMA = alpha * 3 + (1-alpha) * 6-
|
||||
qstick.Update(new TBar(time.AddMinutes(1).Ticks, 100.0, 108.0, 96.0, 103.0, 1000));
|
||||
expectedEma = alpha * 3 + (1 - alpha) * expectedEma;
|
||||
expectedEma = (alpha * 3) + ((1 - alpha) * expectedEma);
|
||||
Assert.Equal(expectedEma, qstick.Last.Value, 10);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user