Files
QuanTAlib/Tests/test_updates_statistics.cs
T

133 lines
2.9 KiB
C#
Raw Normal View History

2024-10-11 18:02:09 -07:00
using Xunit;
namespace QuanTAlib.Tests;
2024-11-07 09:55:19 -08:00
public class StatisticsUpdateTests : UpdateTestBase
2024-10-11 18:02:09 -07:00
{
2024-11-05 15:51:29 -08:00
[Fact]
public void Beta_Update()
{
var indicator = new Beta(period: 14);
2024-11-07 09:55:19 -08:00
TestDualTBarUpdate(indicator, indicator.Calc);
2024-11-05 15:51:29 -08:00
}
[Fact]
public void Corr_Update()
{
var indicator = new Corr(period: 14);
2024-11-07 09:55:19 -08:00
TestDualTValueUpdate(indicator, indicator.Calc);
2024-11-05 15:51:29 -08:00
}
2024-10-11 18:02:09 -07:00
[Fact]
public void Curvature_Update()
{
var indicator = new Curvature(period: 14);
2024-11-07 09:55:19 -08:00
TestTValueUpdate(indicator, indicator.Calc);
2024-10-11 18:02:09 -07:00
}
[Fact]
public void Entropy_Update()
{
var indicator = new Entropy(period: 14);
2024-11-07 09:55:19 -08:00
TestTValueUpdate(indicator, indicator.Calc);
2024-10-11 18:02:09 -07:00
}
[Fact]
public void Hurst_Update()
{
var indicator = new Hurst(period: 100, minLength: 10);
2024-11-07 09:55:19 -08:00
TestTBarUpdate(indicator, indicator.Calc);
}
2024-10-11 18:02:09 -07:00
[Fact]
public void Kurtosis_Update()
{
var indicator = new Kurtosis(period: 14);
2024-11-07 09:55:19 -08:00
TestTValueUpdate(indicator, indicator.Calc);
2024-10-11 18:02:09 -07:00
}
[Fact]
public void Max_Update()
{
var indicator = new Max(period: 14);
2024-11-07 09:55:19 -08:00
TestTValueUpdate(indicator, indicator.Calc);
2024-10-11 18:02:09 -07:00
}
[Fact]
public void Median_Update()
{
var indicator = new Median(period: 14);
2024-11-07 09:55:19 -08:00
TestTValueUpdate(indicator, indicator.Calc);
2024-10-11 18:02:09 -07:00
}
[Fact]
public void Min_Update()
{
var indicator = new Min(period: 14);
2024-11-07 09:55:19 -08:00
TestTValueUpdate(indicator, indicator.Calc);
2024-10-11 18:02:09 -07:00
}
[Fact]
public void Mode_Update()
{
var indicator = new Mode(period: 14);
2024-11-07 09:55:19 -08:00
TestTValueUpdate(indicator, indicator.Calc);
2024-10-11 18:02:09 -07:00
}
[Fact]
public void Percentile_Update()
{
var indicator = new Percentile(period: 14, percent: 50);
2024-11-07 09:55:19 -08:00
TestTValueUpdate(indicator, indicator.Calc);
2024-10-11 18:02:09 -07:00
}
[Fact]
public void Skew_Update()
{
var indicator = new Skew(period: 14);
2024-11-07 09:55:19 -08:00
TestTValueUpdate(indicator, indicator.Calc);
2024-10-11 18:02:09 -07:00
}
[Fact]
public void Slope_Update()
{
var indicator = new Slope(period: 14);
2024-11-07 09:55:19 -08:00
TestTValueUpdate(indicator, indicator.Calc);
2024-10-11 18:02:09 -07:00
}
[Fact]
public void Stddev_Update()
{
var indicator = new Stddev(period: 14);
2024-11-07 09:55:19 -08:00
TestTValueUpdate(indicator, indicator.Calc);
}
2024-10-11 18:02:09 -07:00
2024-11-07 09:55:19 -08:00
[Fact]
public void Theil_Update()
{
var indicator = new Theil(period: 14);
TestTValueUpdate(indicator, indicator.Calc);
}
2024-10-11 18:02:09 -07:00
2024-11-07 09:55:19 -08:00
[Fact]
public void Tsf_Update()
{
var indicator = new Tsf(period: 14);
TestTValueUpdate(indicator, indicator.Calc);
2024-10-11 18:02:09 -07:00
}
[Fact]
public void Variance_Update()
{
var indicator = new Variance(period: 14);
2024-11-07 09:55:19 -08:00
TestTValueUpdate(indicator, indicator.Calc);
2024-10-11 18:02:09 -07:00
}
[Fact]
public void Zscore_Update()
{
var indicator = new Zscore(period: 14);
2024-11-07 09:55:19 -08:00
TestTValueUpdate(indicator, indicator.Calc);
2024-10-11 18:02:09 -07:00
}
}