mirror of
https://github.com/mihakralj/QuanTAlib.git
synced 2026-08-19 11:08:05 +00:00
Squash
dotcover s1 .sln s1 s1 s2 s3 s4 s5 s1 s2 x x2 x3 x4 x5 x6 x1 sonarcube cleanup1 sonarcube cleanup2 sonarcube cleanup 3 fixes q q q q q q q q q1 q2 q q1 codacy 1
This commit is contained in:
+3
-4
@@ -1,6 +1,6 @@
|
||||
using Xunit;
|
||||
using Tulip;
|
||||
using QuanTAlib;
|
||||
namespace QuanTAlib;
|
||||
|
||||
public class TulipTests
|
||||
{
|
||||
@@ -23,7 +23,7 @@ public class TulipTests
|
||||
iterations = 3;
|
||||
skip = 500;
|
||||
data = feed.Close.v.ToArray();
|
||||
outdata = new double[data.Count()];
|
||||
outdata = new double[data.Length];
|
||||
}
|
||||
|
||||
[Fact]
|
||||
@@ -66,12 +66,11 @@ public class TulipTests
|
||||
double[][] arrout = [outdata];
|
||||
Tulip.Indicators.ema.Run(inputs: arrin, options: [period], outputs: arrout);
|
||||
|
||||
Assert.Equal(QL.Length, arrout[0].Count());
|
||||
Assert.Equal(QL.Length, arrout[0].Length);
|
||||
for (int i = QL.Length - 1; i > skip*2; i--) //Initial Tulip Ema value is (wrongly) set to the first input value - therefore large skip
|
||||
{
|
||||
double QL_item = QL[i].Value;
|
||||
double TU = arrout[0][i];
|
||||
//Assert.InRange(TU - QL_item, -range, range);
|
||||
Assert.True(Math.Abs(TU - QL_item) <= range, $"Assertion failed at index {i} for period {period}: TU = {TU}, QL_item = {QL_item}, delta = {TU-QL_item}");
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user