mirror of
https://github.com/mihakralj/QuanTAlib.git
synced 2026-08-25 05:48:06 +00:00
docs: remove C# Implementation Considerations sections, clean up temp scripts, reorganize test files
- Remove 'C# Implementation Considerations' sections from 34 indicator .md files - Delete 29 temp PowerShell scripts (_fix_mojibake.ps1, _hex_scan.ps1, etc.) - Move test files into tests/ subdirectories for consistent project structure - Add trader-focused bullet points to indicator documentation
This commit is contained in:
@@ -0,0 +1,237 @@
|
||||
using TradingPlatform.BusinessLayer;
|
||||
|
||||
namespace QuanTAlib.Tests;
|
||||
|
||||
public class PvoIndicatorTests
|
||||
{
|
||||
[Fact]
|
||||
public void PvoIndicator_Constructor_SetsDefaults()
|
||||
{
|
||||
var indicator = new PvoIndicator();
|
||||
|
||||
Assert.Equal("PVO - Percentage Volume Oscillator", indicator.Name);
|
||||
Assert.Equal(12, indicator.FastPeriod);
|
||||
Assert.Equal(26, indicator.SlowPeriod);
|
||||
Assert.Equal(9, indicator.SignalPeriod);
|
||||
Assert.True(indicator.SeparateWindow);
|
||||
Assert.True(indicator.OnBackGround);
|
||||
Assert.Equal(26, indicator.MinHistoryDepths); // SlowPeriod
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void PvoIndicator_ShortName_ReflectsPeriods()
|
||||
{
|
||||
var indicator = new PvoIndicator { FastPeriod = 5, SlowPeriod = 20, SignalPeriod = 5 };
|
||||
Assert.Equal("PVO(5,20,5)", indicator.ShortName);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void PvoIndicator_MinHistoryDepths_EqualsSlowPeriod()
|
||||
{
|
||||
var indicator = new PvoIndicator { SlowPeriod = 50 };
|
||||
|
||||
Assert.Equal(50, indicator.MinHistoryDepths);
|
||||
Assert.Equal(50, ((IWatchlistIndicator)indicator).MinHistoryDepths);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void PvoIndicator_Initialize_CreatesInternalPvo()
|
||||
{
|
||||
var indicator = new PvoIndicator();
|
||||
|
||||
// Initialize should not throw
|
||||
indicator.Initialize();
|
||||
|
||||
// After init, three line series should exist (PVO, Signal, Histogram)
|
||||
Assert.Equal(3, indicator.LinesSeries.Count);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void PvoIndicator_ProcessUpdate_HistoricalBar_ComputesValue()
|
||||
{
|
||||
var indicator = new PvoIndicator();
|
||||
indicator.Initialize();
|
||||
|
||||
// Add historical data
|
||||
var now = DateTime.UtcNow;
|
||||
for (int i = 0; i < 30; i++)
|
||||
{
|
||||
indicator.HistoricalData.AddBar(now.AddMinutes(i), 100 + i, 110 + i, 90 + i, 105 + i, 1000 + (i * 100));
|
||||
|
||||
// Process update for each bar to simulate history loading
|
||||
var args = new UpdateArgs(UpdateReason.HistoricalBar);
|
||||
indicator.ProcessUpdate(args);
|
||||
}
|
||||
|
||||
// PVO series should have a value
|
||||
double pvoVal = indicator.LinesSeries[0].GetValue(0);
|
||||
Assert.True(double.IsFinite(pvoVal));
|
||||
|
||||
// Signal series should have a value
|
||||
double signalVal = indicator.LinesSeries[1].GetValue(0);
|
||||
Assert.True(double.IsFinite(signalVal));
|
||||
|
||||
// Histogram series should have a value
|
||||
double histogramVal = indicator.LinesSeries[2].GetValue(0);
|
||||
Assert.True(double.IsFinite(histogramVal));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void PvoIndicator_ProcessUpdate_NewBar_ComputesValue()
|
||||
{
|
||||
var indicator = new PvoIndicator();
|
||||
indicator.Initialize();
|
||||
|
||||
var now = DateTime.UtcNow;
|
||||
for (int i = 0; i < 30; i++)
|
||||
{
|
||||
indicator.HistoricalData.AddBar(now.AddMinutes(i), 100 + i, 110 + i, 90 + i, 105 + i, 1000 + (i * 100));
|
||||
}
|
||||
|
||||
indicator.ProcessUpdate(new UpdateArgs(UpdateReason.HistoricalBar));
|
||||
|
||||
// Add new bar
|
||||
indicator.HistoricalData.AddBar(now.AddMinutes(30), 130, 140, 120, 135, 4000);
|
||||
indicator.ProcessUpdate(new UpdateArgs(UpdateReason.NewBar));
|
||||
|
||||
Assert.Equal(2, indicator.LinesSeries[0].Count);
|
||||
Assert.Equal(2, indicator.LinesSeries[1].Count);
|
||||
Assert.Equal(2, indicator.LinesSeries[2].Count);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void PvoIndicator_Value_IsFinite()
|
||||
{
|
||||
var indicator = new PvoIndicator();
|
||||
indicator.Initialize();
|
||||
|
||||
var now = DateTime.UtcNow;
|
||||
for (int i = 0; i < 40; i++)
|
||||
{
|
||||
// Create varying volume patterns
|
||||
double volume = 1000 + (i * 50) + ((i % 5) * 200);
|
||||
|
||||
indicator.HistoricalData.AddBar(now.AddMinutes(i), 100, 110, 90, 105, volume);
|
||||
indicator.ProcessUpdate(new UpdateArgs(UpdateReason.HistoricalBar));
|
||||
}
|
||||
|
||||
double pvoVal = indicator.LinesSeries[0].GetValue(0);
|
||||
double signalVal = indicator.LinesSeries[1].GetValue(0);
|
||||
double histogramVal = indicator.LinesSeries[2].GetValue(0);
|
||||
Assert.True(double.IsFinite(pvoVal), $"PVO value {pvoVal} should be finite");
|
||||
Assert.True(double.IsFinite(signalVal), $"Signal value {signalVal} should be finite");
|
||||
Assert.True(double.IsFinite(histogramVal), $"Histogram value {histogramVal} should be finite");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void PvoIndicator_PositiveValue_OnIncreasingVolume()
|
||||
{
|
||||
var indicator = new PvoIndicator { FastPeriod = 3, SlowPeriod = 6, SignalPeriod = 3 };
|
||||
indicator.Initialize();
|
||||
|
||||
var now = DateTime.UtcNow;
|
||||
|
||||
// Add bars with increasing volume
|
||||
for (int i = 0; i < 15; i++)
|
||||
{
|
||||
// Exponentially increasing volume
|
||||
double volume = 1000 * Math.Pow(1.2, i);
|
||||
indicator.HistoricalData.AddBar(now.AddMinutes(i), 100, 110, 90, 105, volume);
|
||||
indicator.ProcessUpdate(new UpdateArgs(UpdateReason.HistoricalBar));
|
||||
}
|
||||
|
||||
double val = indicator.LinesSeries[0].GetValue(0);
|
||||
Assert.True(val > 0, $"PVO should be positive on increasing volume, got {val}");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void PvoIndicator_NegativeValue_OnDecreasingVolume()
|
||||
{
|
||||
var indicator = new PvoIndicator { FastPeriod = 3, SlowPeriod = 6, SignalPeriod = 3 };
|
||||
indicator.Initialize();
|
||||
|
||||
var now = DateTime.UtcNow;
|
||||
|
||||
// Add bars with decreasing volume
|
||||
for (int i = 0; i < 15; i++)
|
||||
{
|
||||
// Start high and decrease
|
||||
double volume = 10000 / (1.0 + i * 0.3);
|
||||
indicator.HistoricalData.AddBar(now.AddMinutes(i), 100, 110, 90, 105, volume);
|
||||
indicator.ProcessUpdate(new UpdateArgs(UpdateReason.HistoricalBar));
|
||||
}
|
||||
|
||||
double val = indicator.LinesSeries[0].GetValue(0);
|
||||
Assert.True(val < 0, $"PVO should be negative on decreasing volume, got {val}");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void PvoIndicator_SignalLine_CalculatedCorrectly()
|
||||
{
|
||||
var indicator = new PvoIndicator { FastPeriod = 5, SlowPeriod = 10, SignalPeriod = 5 };
|
||||
indicator.Initialize();
|
||||
|
||||
var now = DateTime.UtcNow;
|
||||
for (int i = 0; i < 30; i++)
|
||||
{
|
||||
double volume = 1000 + (i * 100);
|
||||
indicator.HistoricalData.AddBar(now.AddMinutes(i), 100, 110, 90, 105, volume);
|
||||
indicator.ProcessUpdate(new UpdateArgs(UpdateReason.HistoricalBar));
|
||||
}
|
||||
|
||||
double pvoVal = indicator.LinesSeries[0].GetValue(0);
|
||||
double signalVal = indicator.LinesSeries[1].GetValue(0);
|
||||
|
||||
Assert.True(double.IsFinite(pvoVal));
|
||||
Assert.True(double.IsFinite(signalVal));
|
||||
// Signal is an EMA of PVO, so they should be different in trending conditions
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void PvoIndicator_Histogram_EqualsPvoMinusSignal()
|
||||
{
|
||||
var indicator = new PvoIndicator { FastPeriod = 5, SlowPeriod = 10, SignalPeriod = 5 };
|
||||
indicator.Initialize();
|
||||
|
||||
var now = DateTime.UtcNow;
|
||||
for (int i = 0; i < 30; i++)
|
||||
{
|
||||
double volume = 1000 + (i * 150);
|
||||
indicator.HistoricalData.AddBar(now.AddMinutes(i), 100, 110, 90, 105, volume);
|
||||
indicator.ProcessUpdate(new UpdateArgs(UpdateReason.HistoricalBar));
|
||||
}
|
||||
|
||||
double pvoVal = indicator.LinesSeries[0].GetValue(0);
|
||||
double signalVal = indicator.LinesSeries[1].GetValue(0);
|
||||
double histogramVal = indicator.LinesSeries[2].GetValue(0);
|
||||
|
||||
Assert.Equal(pvoVal - signalVal, histogramVal, 10);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void PvoIndicator_CustomPeriods_AffectsOutput()
|
||||
{
|
||||
var indicator1 = new PvoIndicator { FastPeriod = 5, SlowPeriod = 10, SignalPeriod = 5 };
|
||||
var indicator2 = new PvoIndicator { FastPeriod = 10, SlowPeriod = 20, SignalPeriod = 10 };
|
||||
indicator1.Initialize();
|
||||
indicator2.Initialize();
|
||||
|
||||
var now = DateTime.UtcNow;
|
||||
for (int i = 0; i < 50; i++)
|
||||
{
|
||||
double volume = 1000 + (i * 100);
|
||||
indicator1.HistoricalData.AddBar(now.AddMinutes(i), 100, 110, 90, 105, volume);
|
||||
indicator2.HistoricalData.AddBar(now.AddMinutes(i), 100, 110, 90, 105, volume);
|
||||
indicator1.ProcessUpdate(new UpdateArgs(UpdateReason.HistoricalBar));
|
||||
indicator2.ProcessUpdate(new UpdateArgs(UpdateReason.HistoricalBar));
|
||||
}
|
||||
|
||||
double val1 = indicator1.LinesSeries[0].GetValue(0);
|
||||
double val2 = indicator2.LinesSeries[0].GetValue(0);
|
||||
|
||||
// Different periods should produce different results
|
||||
Assert.NotEqual(val1, val2);
|
||||
Assert.True(double.IsFinite(val1));
|
||||
Assert.True(double.IsFinite(val2));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,520 @@
|
||||
using Xunit;
|
||||
|
||||
namespace QuanTAlib.Tests;
|
||||
|
||||
public class PvoTests
|
||||
{
|
||||
private const int DefaultFastPeriod = 12;
|
||||
private const int DefaultSlowPeriod = 26;
|
||||
private const int DefaultSignalPeriod = 9;
|
||||
|
||||
[Fact]
|
||||
public void Constructor_DefaultParameters_CreatesValidIndicator()
|
||||
{
|
||||
var pvo = new Pvo();
|
||||
Assert.Equal($"Pvo({DefaultFastPeriod},{DefaultSlowPeriod},{DefaultSignalPeriod})", pvo.Name);
|
||||
Assert.Equal(DefaultSlowPeriod, pvo.WarmupPeriod);
|
||||
Assert.False(pvo.IsHot);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Constructor_CustomParameters_CreatesValidIndicator()
|
||||
{
|
||||
var pvo = new Pvo(fastPeriod: 5, slowPeriod: 10, signalPeriod: 3);
|
||||
Assert.Equal("Pvo(5,10,3)", pvo.Name);
|
||||
Assert.Equal(10, pvo.WarmupPeriod);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Constructor_InvalidFastPeriod_ThrowsArgumentException()
|
||||
{
|
||||
Assert.Throws<ArgumentException>(() => new Pvo(fastPeriod: 0));
|
||||
Assert.Throws<ArgumentException>(() => new Pvo(fastPeriod: -1));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Constructor_InvalidSlowPeriod_ThrowsArgumentException()
|
||||
{
|
||||
Assert.Throws<ArgumentException>(() => new Pvo(slowPeriod: 0));
|
||||
Assert.Throws<ArgumentException>(() => new Pvo(slowPeriod: -1));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Constructor_InvalidSignalPeriod_ThrowsArgumentException()
|
||||
{
|
||||
Assert.Throws<ArgumentException>(() => new Pvo(signalPeriod: 0));
|
||||
Assert.Throws<ArgumentException>(() => new Pvo(signalPeriod: -1));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Constructor_FastNotLessThanSlow_ThrowsArgumentException()
|
||||
{
|
||||
Assert.Throws<ArgumentException>(() => new Pvo(fastPeriod: 26, slowPeriod: 26));
|
||||
Assert.Throws<ArgumentException>(() => new Pvo(fastPeriod: 30, slowPeriod: 26));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Update_WithTBar_ReturnsValidValue()
|
||||
{
|
||||
var pvo = new Pvo();
|
||||
var bar = new TBar(DateTime.UtcNow, 100, 110, 90, 105, 1000000);
|
||||
var result = pvo.Update(bar);
|
||||
Assert.True(double.IsFinite(result.Value));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Update_WithTValue_ReturnsValidValue()
|
||||
{
|
||||
var pvo = new Pvo();
|
||||
var value = new TValue(DateTime.UtcNow, 1000000);
|
||||
var result = pvo.Update(value);
|
||||
Assert.True(double.IsFinite(result.Value));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Update_VolumeIncrease_ReturnsPositiveValue()
|
||||
{
|
||||
var pvo = new Pvo(fastPeriod: 3, slowPeriod: 5, signalPeriod: 3);
|
||||
var time = DateTime.UtcNow;
|
||||
|
||||
// Constant volume first
|
||||
for (int i = 0; i < 50; i++)
|
||||
{
|
||||
pvo.Update(new TBar(time.AddMinutes(i), 100, 105, 95, 102, 100000));
|
||||
}
|
||||
|
||||
// Then increasing volume - fast EMA will be higher than slow
|
||||
for (int i = 50; i < 100; i++)
|
||||
{
|
||||
pvo.Update(new TBar(time.AddMinutes(i), 100, 105, 95, 102, 100000 + (i - 50) * 50000));
|
||||
}
|
||||
|
||||
// Fast EMA responds quicker to volume increase, should be positive
|
||||
Assert.True(pvo.Last.Value > 0, "PVO should be positive when volume is increasing");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Update_VolumeDecrease_ReturnsNegativeValue()
|
||||
{
|
||||
var pvo = new Pvo(fastPeriod: 3, slowPeriod: 5, signalPeriod: 3);
|
||||
var time = DateTime.UtcNow;
|
||||
|
||||
// High constant volume first
|
||||
for (int i = 0; i < 50; i++)
|
||||
{
|
||||
pvo.Update(new TBar(time.AddMinutes(i), 100, 105, 95, 102, 1000000));
|
||||
}
|
||||
|
||||
// Then decreasing volume - fast EMA will be lower than slow
|
||||
for (int i = 50; i < 100; i++)
|
||||
{
|
||||
pvo.Update(new TBar(time.AddMinutes(i), 100, 105, 95, 102, 1000000 - (i - 50) * 15000));
|
||||
}
|
||||
|
||||
// Fast EMA responds quicker to volume decrease, should be negative
|
||||
Assert.True(pvo.Last.Value < 0, "PVO should be negative when volume is decreasing");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Update_IsNewTrue_AdvancesState()
|
||||
{
|
||||
var pvo = new Pvo();
|
||||
var bar1 = new TBar(DateTime.UtcNow, 100, 110, 90, 105, 1000000);
|
||||
var result1 = pvo.Update(bar1, isNew: true);
|
||||
|
||||
var bar2 = new TBar(DateTime.UtcNow.AddMinutes(1), 105, 115, 95, 110, 1100000);
|
||||
var result2 = pvo.Update(bar2, isNew: true);
|
||||
|
||||
Assert.NotEqual(result1.Time, result2.Time);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Update_IsNewFalse_UpdatesCurrentBar()
|
||||
{
|
||||
var pvo = new Pvo();
|
||||
var time = DateTime.UtcNow;
|
||||
var bar1 = new TBar(time, 100, 110, 90, 105, 1000000);
|
||||
pvo.Update(bar1, isNew: true);
|
||||
|
||||
var bar2 = new TBar(time.AddMinutes(1), 105, 115, 95, 110, 1100000);
|
||||
var result1 = pvo.Update(bar2, isNew: true);
|
||||
|
||||
// Update same bar with different volume
|
||||
var bar2Updated = new TBar(time.AddMinutes(1), 105, 120, 95, 118, 2000000);
|
||||
var result2 = pvo.Update(bar2Updated, isNew: false);
|
||||
|
||||
Assert.Equal(result1.Time, result2.Time);
|
||||
Assert.NotEqual(result1.Value, result2.Value);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Update_IterativeCorrections_RestoresState()
|
||||
{
|
||||
var pvo = new Pvo(fastPeriod: 5, slowPeriod: 10, signalPeriod: 5);
|
||||
var time = DateTime.UtcNow;
|
||||
|
||||
// Build up state
|
||||
for (int i = 0; i < 15; i++)
|
||||
{
|
||||
pvo.Update(new TBar(time.AddMinutes(i), 100 + i, 110 + i, 90 + i, 105 + i, 100000 + i * 10000), isNew: true);
|
||||
}
|
||||
|
||||
// New bar
|
||||
var originalBar = new TBar(time.AddMinutes(15), 120, 130, 110, 125, 250000);
|
||||
var originalResult = pvo.Update(originalBar, isNew: true);
|
||||
|
||||
// Correction with different volume
|
||||
var correctionBar = new TBar(time.AddMinutes(15), 110, 150, 90, 140, 500000);
|
||||
var correctedResult = pvo.Update(correctionBar, isNew: false);
|
||||
|
||||
Assert.NotEqual(originalResult.Value, correctedResult.Value);
|
||||
Assert.True(double.IsFinite(correctedResult.Value));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Update_WarmupPeriod_IsHotBecomesTrueAfterWarmup()
|
||||
{
|
||||
var pvo = new Pvo(fastPeriod: 3, slowPeriod: 5, signalPeriod: 3);
|
||||
var time = DateTime.UtcNow;
|
||||
|
||||
Assert.False(pvo.IsHot);
|
||||
|
||||
// Feed many bars until compensators decay below threshold (1e-10)
|
||||
for (int i = 0; i < 100; i++)
|
||||
{
|
||||
pvo.Update(new TBar(time.AddMinutes(i), 100 + i, 110 + i, 90 + i, 105 + i, 100000), isNew: true);
|
||||
}
|
||||
|
||||
Assert.True(pvo.IsHot);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Update_WithNaN_UsesLastValidValue()
|
||||
{
|
||||
var pvo = new Pvo(fastPeriod: 3, slowPeriod: 5, signalPeriod: 3);
|
||||
var time = DateTime.UtcNow;
|
||||
|
||||
// Process some valid bars first
|
||||
for (int i = 0; i < 10; i++)
|
||||
{
|
||||
pvo.Update(new TBar(time.AddMinutes(i), 100, 105, 95, 102, 100000));
|
||||
}
|
||||
|
||||
// Process bar with NaN volume
|
||||
var nanBar = new TBar(time.AddMinutes(10), 105, 110, 100, 108, double.NaN);
|
||||
var result = pvo.Update(nanBar);
|
||||
|
||||
Assert.True(double.IsFinite(result.Value));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Update_ZeroVolume_HandlesGracefully()
|
||||
{
|
||||
var pvo = new Pvo(fastPeriod: 3, slowPeriod: 5, signalPeriod: 3);
|
||||
var time = DateTime.UtcNow;
|
||||
|
||||
pvo.Update(new TBar(time, 100, 110, 90, 105, 100000));
|
||||
var result = pvo.Update(new TBar(time.AddMinutes(1), 105, 115, 95, 110, 0));
|
||||
|
||||
Assert.True(double.IsFinite(result.Value));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Signal_CalculatedAlongsidePvo()
|
||||
{
|
||||
var pvo = new Pvo(fastPeriod: 3, slowPeriod: 5, signalPeriod: 3);
|
||||
var time = DateTime.UtcNow;
|
||||
|
||||
for (int i = 0; i < 20; i++)
|
||||
{
|
||||
pvo.Update(new TBar(time.AddMinutes(i), 100 + i, 110 + i, 90 + i, 105 + i, 100000 + i * 10000));
|
||||
}
|
||||
|
||||
Assert.True(double.IsFinite(pvo.Signal.Value));
|
||||
Assert.Equal(pvo.Last.Time, pvo.Signal.Time);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Histogram_CalculatedCorrectly()
|
||||
{
|
||||
var pvo = new Pvo(fastPeriod: 3, slowPeriod: 5, signalPeriod: 3);
|
||||
var time = DateTime.UtcNow;
|
||||
|
||||
for (int i = 0; i < 20; i++)
|
||||
{
|
||||
pvo.Update(new TBar(time.AddMinutes(i), 100 + i, 110 + i, 90 + i, 105 + i, 100000 + i * 10000));
|
||||
}
|
||||
|
||||
Assert.True(double.IsFinite(pvo.Histogram.Value));
|
||||
Assert.Equal(pvo.Last.Value - pvo.Signal.Value, pvo.Histogram.Value, 10);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Reset_ClearsState()
|
||||
{
|
||||
var pvo = new Pvo(fastPeriod: 3, slowPeriod: 5, signalPeriod: 3);
|
||||
var time = DateTime.UtcNow;
|
||||
|
||||
// Process many bars until IsHot becomes true
|
||||
for (int i = 0; i < 100; i++)
|
||||
{
|
||||
pvo.Update(new TBar(time.AddMinutes(i), 100 + i, 110 + i, 90 + i, 105 + i, 100000), isNew: true);
|
||||
}
|
||||
|
||||
Assert.True(double.IsFinite(pvo.Last.Value));
|
||||
|
||||
pvo.Reset();
|
||||
|
||||
Assert.False(pvo.IsHot);
|
||||
Assert.Equal(default, pvo.Last);
|
||||
Assert.Equal(default, pvo.Signal);
|
||||
Assert.Equal(default, pvo.Histogram);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void UpdateWithSignal_ReturnsAllSeries()
|
||||
{
|
||||
var bars = new TBarSeries();
|
||||
var gbm = new GBM(seed: 42);
|
||||
|
||||
for (int i = 0; i < 100; i++)
|
||||
{
|
||||
bars.Add(gbm.Next());
|
||||
}
|
||||
|
||||
var pvo = new Pvo();
|
||||
var (pvoSeries, signalSeries, histogramSeries) = pvo.UpdateWithSignal(bars);
|
||||
|
||||
Assert.Equal(bars.Count, pvoSeries.Count);
|
||||
Assert.Equal(bars.Count, signalSeries.Count);
|
||||
Assert.Equal(bars.Count, histogramSeries.Count);
|
||||
|
||||
// Verify values are finite
|
||||
for (int i = 0; i < bars.Count; i++)
|
||||
{
|
||||
Assert.True(double.IsFinite(pvoSeries[i].Value));
|
||||
Assert.True(double.IsFinite(signalSeries[i].Value));
|
||||
Assert.True(double.IsFinite(histogramSeries[i].Value));
|
||||
}
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void BatchCalculate_MatchesStreaming()
|
||||
{
|
||||
var bars = new TBarSeries();
|
||||
var gbm = new GBM(seed: 42);
|
||||
|
||||
for (int i = 0; i < 100; i++)
|
||||
{
|
||||
bars.Add(gbm.Next());
|
||||
}
|
||||
|
||||
// Streaming
|
||||
var pvo = new Pvo();
|
||||
var streamingValues = new List<double>();
|
||||
foreach (var bar in bars)
|
||||
{
|
||||
streamingValues.Add(pvo.Update(bar).Value);
|
||||
}
|
||||
|
||||
// Batch
|
||||
var batchResult = Pvo.Batch(bars);
|
||||
|
||||
Assert.Equal(bars.Count, batchResult.Count);
|
||||
for (int i = 0; i < bars.Count; i++)
|
||||
{
|
||||
Assert.Equal(streamingValues[i], batchResult[i].Value, 10);
|
||||
}
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void SpanCalculate_MatchesStreaming()
|
||||
{
|
||||
var bars = new TBarSeries();
|
||||
var gbm = new GBM(seed: 42);
|
||||
|
||||
for (int i = 0; i < 100; i++)
|
||||
{
|
||||
bars.Add(gbm.Next());
|
||||
}
|
||||
|
||||
// Streaming
|
||||
var pvo = new Pvo();
|
||||
var streamingPvo = new List<double>();
|
||||
var streamingSignal = new List<double>();
|
||||
var streamingHistogram = new List<double>();
|
||||
foreach (var bar in bars)
|
||||
{
|
||||
pvo.Update(bar);
|
||||
streamingPvo.Add(pvo.Last.Value);
|
||||
streamingSignal.Add(pvo.Signal.Value);
|
||||
streamingHistogram.Add(pvo.Histogram.Value);
|
||||
}
|
||||
|
||||
// Span
|
||||
var volume = bars.Volume.Values.ToArray();
|
||||
var spanPvo = new double[bars.Count];
|
||||
var spanSignal = new double[bars.Count];
|
||||
var spanHistogram = new double[bars.Count];
|
||||
|
||||
Pvo.Batch(volume, spanPvo, spanSignal, spanHistogram);
|
||||
|
||||
for (int i = 0; i < bars.Count; i++)
|
||||
{
|
||||
Assert.Equal(streamingPvo[i], spanPvo[i], 10);
|
||||
Assert.Equal(streamingSignal[i], spanSignal[i], 10);
|
||||
Assert.Equal(streamingHistogram[i], spanHistogram[i], 10);
|
||||
}
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void SpanCalculate_InvalidLengths_ThrowsArgumentException()
|
||||
{
|
||||
var volume = new double[100];
|
||||
var output = new double[99]; // Different length
|
||||
var signal = new double[100];
|
||||
var histogram = new double[100];
|
||||
|
||||
Assert.Throws<ArgumentException>(() => Pvo.Batch(volume, output, signal, histogram));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void SpanCalculate_InvalidFastPeriod_ThrowsArgumentException()
|
||||
{
|
||||
var volume = new double[100];
|
||||
var output = new double[100];
|
||||
var signal = new double[100];
|
||||
var histogram = new double[100];
|
||||
|
||||
Assert.Throws<ArgumentException>(() => Pvo.Batch(volume, output, signal, histogram, fastPeriod: 0));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void SpanCalculate_InvalidSlowPeriod_ThrowsArgumentException()
|
||||
{
|
||||
var volume = new double[100];
|
||||
var output = new double[100];
|
||||
var signal = new double[100];
|
||||
var histogram = new double[100];
|
||||
|
||||
Assert.Throws<ArgumentException>(() => Pvo.Batch(volume, output, signal, histogram, slowPeriod: 0));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void SpanCalculate_InvalidSignalPeriod_ThrowsArgumentException()
|
||||
{
|
||||
var volume = new double[100];
|
||||
var output = new double[100];
|
||||
var signal = new double[100];
|
||||
var histogram = new double[100];
|
||||
|
||||
Assert.Throws<ArgumentException>(() => Pvo.Batch(volume, output, signal, histogram, signalPeriod: 0));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void SpanCalculate_FastNotLessThanSlow_ThrowsArgumentException()
|
||||
{
|
||||
var volume = new double[100];
|
||||
var output = new double[100];
|
||||
var signal = new double[100];
|
||||
var histogram = new double[100];
|
||||
|
||||
Assert.Throws<ArgumentException>(() => Pvo.Batch(volume, output, signal, histogram, fastPeriod: 26, slowPeriod: 26));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void SpanCalculate_EmptyInput_HandlesGracefully()
|
||||
{
|
||||
var volume = Array.Empty<double>();
|
||||
var output = Array.Empty<double>();
|
||||
var signal = Array.Empty<double>();
|
||||
var histogram = Array.Empty<double>();
|
||||
|
||||
// Should not throw
|
||||
Pvo.Batch(volume, output, signal, histogram);
|
||||
|
||||
Assert.Empty(output);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Event_PubFiresOnUpdate()
|
||||
{
|
||||
var pvo = new Pvo();
|
||||
TValue? receivedValue = null;
|
||||
bool receivedIsNew = false;
|
||||
|
||||
pvo.Pub += (object? sender, in TValueEventArgs args) =>
|
||||
{
|
||||
receivedValue = args.Value;
|
||||
receivedIsNew = args.IsNew;
|
||||
};
|
||||
|
||||
var bar = new TBar(DateTime.UtcNow, 100, 110, 90, 105, 1000000);
|
||||
pvo.Update(bar, isNew: true);
|
||||
|
||||
Assert.NotNull(receivedValue);
|
||||
Assert.True(receivedIsNew);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void CustomPeriods_AffectsResults()
|
||||
{
|
||||
var bars = new TBarSeries();
|
||||
var gbm = new GBM(seed: 42);
|
||||
|
||||
for (int i = 0; i < 100; i++)
|
||||
{
|
||||
bars.Add(gbm.Next());
|
||||
}
|
||||
|
||||
var pvo1 = new Pvo(fastPeriod: 5, slowPeriod: 10, signalPeriod: 3);
|
||||
var pvo2 = new Pvo(fastPeriod: 10, slowPeriod: 20, signalPeriod: 5);
|
||||
|
||||
foreach (var bar in bars)
|
||||
{
|
||||
pvo1.Update(bar);
|
||||
pvo2.Update(bar);
|
||||
}
|
||||
|
||||
// Different periods should produce different results
|
||||
Assert.NotEqual(pvo1.Last.Value, pvo2.Last.Value);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void LargeDataset_HandlesWithoutError()
|
||||
{
|
||||
var bars = new TBarSeries();
|
||||
var gbm = new GBM(seed: 42);
|
||||
|
||||
for (int i = 0; i < 10000; i++)
|
||||
{
|
||||
bars.Add(gbm.Next());
|
||||
}
|
||||
|
||||
var pvo = new Pvo();
|
||||
foreach (var bar in bars)
|
||||
{
|
||||
var result = pvo.Update(bar);
|
||||
Assert.True(double.IsFinite(result.Value));
|
||||
}
|
||||
|
||||
Assert.True(pvo.IsHot);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ConstantVolume_PvoIsZero()
|
||||
{
|
||||
var pvo = new Pvo(fastPeriod: 3, slowPeriod: 5, signalPeriod: 3);
|
||||
var time = DateTime.UtcNow;
|
||||
|
||||
// With constant volume, fast and slow EMAs should converge to same value
|
||||
// resulting in PVO = 0
|
||||
for (int i = 0; i < 200; i++)
|
||||
{
|
||||
pvo.Update(new TBar(time.AddMinutes(i), 100, 105, 95, 102, 100000));
|
||||
}
|
||||
|
||||
// After warmup with constant volume, PVO should be very close to 0
|
||||
Assert.True(Math.Abs(pvo.Last.Value) < 0.01, $"PVO should be ~0 with constant volume, but was {pvo.Last.Value}");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,298 @@
|
||||
using OoplesFinance.StockIndicators;
|
||||
using OoplesFinance.StockIndicators.Models;
|
||||
using Skender.Stock.Indicators;
|
||||
|
||||
namespace QuanTAlib.Tests;
|
||||
|
||||
public class PvoValidationTests
|
||||
{
|
||||
private readonly ValidationTestData _data;
|
||||
private const int DefaultFastPeriod = 12;
|
||||
private const int DefaultSlowPeriod = 26;
|
||||
private const int DefaultSignalPeriod = 9;
|
||||
|
||||
public PvoValidationTests()
|
||||
{
|
||||
_data = new ValidationTestData();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Validate_Skender_Pvo_Streaming()
|
||||
{
|
||||
// QuanTAlib PVO (streaming)
|
||||
var pvo = new Pvo(DefaultFastPeriod, DefaultSlowPeriod, DefaultSignalPeriod);
|
||||
var qResults = new List<double>();
|
||||
foreach (var bar in _data.Bars)
|
||||
{
|
||||
qResults.Add(pvo.Update(bar).Value);
|
||||
}
|
||||
|
||||
// Skender PVO
|
||||
var sResult = _data.SkenderQuotes.GetPvo(DefaultFastPeriod, DefaultSlowPeriod, DefaultSignalPeriod).ToList();
|
||||
|
||||
// Cross-validate PVO line
|
||||
ValidationHelper.VerifyData(qResults, sResult, s => s.Pvo, tolerance: ValidationHelper.SkenderTolerance);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Validate_Skender_Pvo_Signal()
|
||||
{
|
||||
// QuanTAlib PVO signal (streaming)
|
||||
var pvo = new Pvo(DefaultFastPeriod, DefaultSlowPeriod, DefaultSignalPeriod);
|
||||
var qSignal = new List<double>();
|
||||
foreach (var bar in _data.Bars)
|
||||
{
|
||||
pvo.Update(bar);
|
||||
qSignal.Add(pvo.Signal.Value);
|
||||
}
|
||||
|
||||
// Skender PVO
|
||||
var sResult = _data.SkenderQuotes.GetPvo(DefaultFastPeriod, DefaultSlowPeriod, DefaultSignalPeriod).ToList();
|
||||
|
||||
// Cross-validate signal line
|
||||
ValidationHelper.VerifyData(qSignal, sResult, s => s.Signal, tolerance: ValidationHelper.SkenderTolerance);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Validate_Skender_Pvo_Histogram()
|
||||
{
|
||||
// QuanTAlib PVO histogram (streaming)
|
||||
var pvo = new Pvo(DefaultFastPeriod, DefaultSlowPeriod, DefaultSignalPeriod);
|
||||
var qHistogram = new List<double>();
|
||||
foreach (var bar in _data.Bars)
|
||||
{
|
||||
pvo.Update(bar);
|
||||
qHistogram.Add(pvo.Histogram.Value);
|
||||
}
|
||||
|
||||
// Skender PVO
|
||||
var sResult = _data.SkenderQuotes.GetPvo(DefaultFastPeriod, DefaultSlowPeriod, DefaultSignalPeriod).ToList();
|
||||
|
||||
// Cross-validate histogram
|
||||
ValidationHelper.VerifyData(qHistogram, sResult, s => s.Histogram, tolerance: ValidationHelper.SkenderTolerance);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Pvo_Matches_Talib()
|
||||
{
|
||||
// TA-Lib does not have PVO (has PPO for price)
|
||||
Assert.True(true, "TA-Lib does not have a Percentage Volume Oscillator implementation");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Pvo_Matches_Tulip()
|
||||
{
|
||||
// Tulip has pvo (Percentage Volume Oscillator)
|
||||
var pvo = new Pvo(DefaultFastPeriod, DefaultSlowPeriod, DefaultSignalPeriod);
|
||||
var quantalibValues = new List<double>();
|
||||
foreach (var bar in _data.Bars)
|
||||
{
|
||||
quantalibValues.Add(pvo.Update(bar).Value);
|
||||
}
|
||||
|
||||
// Note: Tulip's pvo indicator exists and should match our implementation
|
||||
// The formula is: ((fast_ema - slow_ema) / slow_ema) * 100
|
||||
Assert.True(quantalibValues.All(v => double.IsFinite(v)), "QuanTAlib PVO produces finite values");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Pvo_Matches_Ooples()
|
||||
{
|
||||
// Ooples may have PVO implementation
|
||||
var pvo = new Pvo(DefaultFastPeriod, DefaultSlowPeriod, DefaultSignalPeriod);
|
||||
var quantalibValues = new List<double>();
|
||||
var quantalibSignal = new List<double>();
|
||||
foreach (var bar in _data.Bars)
|
||||
{
|
||||
pvo.Update(bar);
|
||||
quantalibValues.Add(pvo.Last.Value);
|
||||
quantalibSignal.Add(pvo.Signal.Value);
|
||||
}
|
||||
|
||||
// Note: Different implementations may use different EMA warmup handling
|
||||
Assert.True(quantalibValues.All(v => double.IsFinite(v)), "QuanTAlib PVO produces finite values");
|
||||
Assert.True(quantalibSignal.All(v => double.IsFinite(v)), "QuanTAlib PVO signal produces finite values");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Pvo_Streaming_Matches_Batch()
|
||||
{
|
||||
// Streaming
|
||||
var pvo = new Pvo(DefaultFastPeriod, DefaultSlowPeriod, DefaultSignalPeriod);
|
||||
var streamingValues = new List<double>();
|
||||
foreach (var bar in _data.Bars)
|
||||
{
|
||||
streamingValues.Add(pvo.Update(bar).Value);
|
||||
}
|
||||
|
||||
// Batch
|
||||
var batchResult = Pvo.Batch(_data.Bars, DefaultFastPeriod, DefaultSlowPeriod, DefaultSignalPeriod);
|
||||
var batchValues = batchResult.Values.ToArray();
|
||||
|
||||
ValidationHelper.VerifyData(streamingValues.ToArray(), batchValues, 0, 100, 1e-9);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Pvo_Span_Matches_Streaming()
|
||||
{
|
||||
// Streaming
|
||||
var pvo = new Pvo(DefaultFastPeriod, DefaultSlowPeriod, DefaultSignalPeriod);
|
||||
var streamingPvo = new List<double>();
|
||||
var streamingSignal = new List<double>();
|
||||
var streamingHistogram = new List<double>();
|
||||
foreach (var bar in _data.Bars)
|
||||
{
|
||||
pvo.Update(bar);
|
||||
streamingPvo.Add(pvo.Last.Value);
|
||||
streamingSignal.Add(pvo.Signal.Value);
|
||||
streamingHistogram.Add(pvo.Histogram.Value);
|
||||
}
|
||||
|
||||
// Span
|
||||
var volume = _data.Bars.Volume.Values.ToArray();
|
||||
var spanPvo = new double[volume.Length];
|
||||
var spanSignal = new double[volume.Length];
|
||||
var spanHistogram = new double[volume.Length];
|
||||
|
||||
Pvo.Batch(volume, spanPvo, spanSignal, spanHistogram, DefaultFastPeriod, DefaultSlowPeriod, DefaultSignalPeriod);
|
||||
|
||||
ValidationHelper.VerifyData(streamingPvo.ToArray(), spanPvo, 0, 100, 1e-9);
|
||||
ValidationHelper.VerifyData(streamingSignal.ToArray(), spanSignal, 0, 100, 1e-9);
|
||||
ValidationHelper.VerifyData(streamingHistogram.ToArray(), spanHistogram, 0, 100, 1e-9);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Pvo_Signal_Streaming_Matches_Batch()
|
||||
{
|
||||
// Streaming
|
||||
var pvo = new Pvo(DefaultFastPeriod, DefaultSlowPeriod, DefaultSignalPeriod);
|
||||
var streamingSignal = new List<double>();
|
||||
foreach (var bar in _data.Bars)
|
||||
{
|
||||
pvo.Update(bar);
|
||||
streamingSignal.Add(pvo.Signal.Value);
|
||||
}
|
||||
|
||||
// Batch with signal
|
||||
var (_, signalSeries, _) = new Pvo(DefaultFastPeriod, DefaultSlowPeriod, DefaultSignalPeriod).UpdateWithSignal(_data.Bars);
|
||||
var batchSignal = signalSeries.Values.ToArray();
|
||||
|
||||
ValidationHelper.VerifyData(streamingSignal.ToArray(), batchSignal, 0, 100, 1e-9);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Pvo_Histogram_Streaming_Matches_Batch()
|
||||
{
|
||||
// Streaming
|
||||
var pvo = new Pvo(DefaultFastPeriod, DefaultSlowPeriod, DefaultSignalPeriod);
|
||||
var streamingHistogram = new List<double>();
|
||||
foreach (var bar in _data.Bars)
|
||||
{
|
||||
pvo.Update(bar);
|
||||
streamingHistogram.Add(pvo.Histogram.Value);
|
||||
}
|
||||
|
||||
// Batch with histogram
|
||||
var (_, _, histogramSeries) = new Pvo(DefaultFastPeriod, DefaultSlowPeriod, DefaultSignalPeriod).UpdateWithSignal(_data.Bars);
|
||||
var batchHistogram = histogramSeries.Values.ToArray();
|
||||
|
||||
ValidationHelper.VerifyData(streamingHistogram.ToArray(), batchHistogram, 0, 100, 1e-9);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Pvo_Different_Periods_ProduceDifferentResults()
|
||||
{
|
||||
// Test with default periods
|
||||
var pvo1 = new Pvo(12, 26, 9);
|
||||
var values1 = new List<double>();
|
||||
foreach (var bar in _data.Bars)
|
||||
{
|
||||
values1.Add(pvo1.Update(bar).Value);
|
||||
}
|
||||
|
||||
// Test with different periods
|
||||
var pvo2 = new Pvo(5, 10, 5);
|
||||
var values2 = new List<double>();
|
||||
foreach (var bar in _data.Bars)
|
||||
{
|
||||
values2.Add(pvo2.Update(bar).Value);
|
||||
}
|
||||
|
||||
// Values should differ
|
||||
bool allEqual = true;
|
||||
for (int i = 0; i < values1.Count; i++)
|
||||
{
|
||||
if (Math.Abs(values1[i] - values2[i]) > 1e-9)
|
||||
{
|
||||
allEqual = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Assert.False(allEqual, "Different periods should produce different results");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Pvo_HistogramEqualsMinusSignal()
|
||||
{
|
||||
var pvo = new Pvo(DefaultFastPeriod, DefaultSlowPeriod, DefaultSignalPeriod);
|
||||
|
||||
foreach (var bar in _data.Bars)
|
||||
{
|
||||
pvo.Update(bar);
|
||||
double expectedHistogram = pvo.Last.Value - pvo.Signal.Value;
|
||||
Assert.Equal(expectedHistogram, pvo.Histogram.Value, 10);
|
||||
}
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Pvo_ConsistentAcrossAllModes()
|
||||
{
|
||||
// Mode 1: Streaming with TBar
|
||||
var pvo1 = new Pvo(DefaultFastPeriod, DefaultSlowPeriod, DefaultSignalPeriod);
|
||||
var mode1Values = new List<double>();
|
||||
foreach (var bar in _data.Bars)
|
||||
{
|
||||
mode1Values.Add(pvo1.Update(bar).Value);
|
||||
}
|
||||
|
||||
// Mode 2: Streaming with TValue (volume)
|
||||
var pvo2 = new Pvo(DefaultFastPeriod, DefaultSlowPeriod, DefaultSignalPeriod);
|
||||
var mode2Values = new List<double>();
|
||||
foreach (var bar in _data.Bars)
|
||||
{
|
||||
mode2Values.Add(pvo2.Update(new TValue(bar.Time, bar.Volume)).Value);
|
||||
}
|
||||
|
||||
// Mode 3: Batch
|
||||
var mode3Result = Pvo.Batch(_data.Bars, DefaultFastPeriod, DefaultSlowPeriod, DefaultSignalPeriod);
|
||||
var mode3Values = mode3Result.Values.ToArray();
|
||||
|
||||
// Mode 4: Span
|
||||
var volume = _data.Bars.Volume.Values.ToArray();
|
||||
var mode4Values = new double[volume.Length];
|
||||
var mode4Signal = new double[volume.Length];
|
||||
var mode4Histogram = new double[volume.Length];
|
||||
Pvo.Batch(volume, mode4Values, mode4Signal, mode4Histogram, DefaultFastPeriod, DefaultSlowPeriod, DefaultSignalPeriod);
|
||||
|
||||
// All modes should match
|
||||
ValidationHelper.VerifyData(mode1Values.ToArray(), mode2Values.ToArray(), 0, 100, 1e-9);
|
||||
ValidationHelper.VerifyData(mode1Values.ToArray(), mode3Values, 0, 100, 1e-9);
|
||||
ValidationHelper.VerifyData(mode1Values.ToArray(), mode4Values, 0, 100, 1e-9);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Pvo_MatchesOoples_Structural()
|
||||
{
|
||||
// CalculatePercentageVolumeOscillator — structural test
|
||||
var ooplesData = _data.SkenderQuotes
|
||||
.Select(q => new TickerData { Date = q.Date, Open = (double)q.Open, High = (double)q.High, Low = (double)q.Low, Close = (double)q.Close, Volume = (double)q.Volume })
|
||||
.ToList();
|
||||
|
||||
var result = new StockData(ooplesData).CalculatePercentageVolumeOscillator();
|
||||
var values = result.CustomValuesList;
|
||||
|
||||
int finiteCount = values.Count(v => double.IsFinite(v));
|
||||
Assert.True(finiteCount > 100, $"Expected >100 finite Ooples PVO values, got {finiteCount}");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user