This commit is contained in:
Miha Kralj
2024-10-08 13:59:33 -07:00
parent 46f5ffe9e9
commit 0bc41854aa
19 changed files with 48 additions and 218 deletions
-1
View File
@@ -33,7 +33,6 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="xunit" Version="2.4.1" />
<ProjectReference Include="..\lib\quantalib.csproj" />
</ItemGroup>
+2 -8
View File
@@ -13,10 +13,9 @@ public class SkenderTests
private readonly Random rnd;
private readonly double range;
private int period;
private readonly int iterations;
private readonly int iterations = 3; // Initialized directly at declaration
private readonly IEnumerable<Quote> quotes;
public SkenderTests()
{
rnd = new((int)DateTime.Now.Ticks);
@@ -24,7 +23,6 @@ public class SkenderTests
bars = new(feed);
range = 1e-9;
feed.Add(10000);
iterations = 3;
quotes = bars.Select(q => new Quote
{
Date = q.Time,
@@ -338,15 +336,11 @@ public class SkenderTests
var atrValues = quotes.GetAtr(lookbackPeriods: period).Select(i => i.Atr.Null2NaN()!);
const int AdditionalPeriods = 500;
<<<<<<< HEAD
for (int i = QL.Length - 1; i > period + 500; i--)
=======
for (int i = QL.Length - 1; i > period + AdditionalPeriods; i--)
>>>>>>> dev
{
Assert.InRange(atrValues.ElementAt(i) - QL[i].Value, -range, range);
}
}
}
}
}