mirror of
https://github.com/mihakralj/QuanTAlib.git
synced 2026-08-04 04:07:42 +00:00
VAR test fix
This commit is contained in:
+10
-10
@@ -1,10 +1,10 @@
|
||||
using Xunit;
|
||||
using System;
|
||||
using TALib;
|
||||
using QuanTAlib;
|
||||
|
||||
namespace Validations;
|
||||
public class TA_LIB
|
||||
using Xunit;
|
||||
using System;
|
||||
using TALib;
|
||||
using QuanTAlib;
|
||||
|
||||
namespace Validations;
|
||||
public class TA_LIB
|
||||
{
|
||||
private readonly GBM_Feed bars;
|
||||
private readonly Random rnd = new();
|
||||
@@ -118,7 +118,7 @@ public class TA_LIB
|
||||
VAR_Series QL = new(bars.Close, period, false);
|
||||
Core.Var(inclose, 0, bars.Count - 1, TALIB, out int outBegIdx, out _, period);
|
||||
|
||||
Assert.Equal(Math.Round(TALIB[TALIB.Length - outBegIdx - 1], 5, MidpointRounding.AwayFromZero), Math.Round(QL.Last().v, 5));
|
||||
Assert.Equal(Math.Round(TALIB[TALIB.Length - outBegIdx - 1], 4, MidpointRounding.AwayFromZero), Math.Round(QL.Last().v, 4));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
@@ -314,5 +314,5 @@ public class TA_LIB
|
||||
Core.WclPrice(inhigh, inlow, inclose, 0, bars.Count - 1, TALIB, out int outBegIdx, out _);
|
||||
|
||||
Assert.Equal(Math.Round(TALIB[TALIB.Length - outBegIdx - 1], 6, MidpointRounding.AwayFromZero), Math.Round(QL.Last().v, 6, MidpointRounding.AwayFromZero));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user