test: setup common stability and robustness properties tracking

This commit is contained in:
Miha Kralj
2026-02-27 12:50:05 -08:00
parent 4ab3a7fb53
commit 769a923a24
287 changed files with 1314 additions and 867 deletions
+1 -1
View File
@@ -157,4 +157,4 @@ public class AobvIndicatorTests
Assert.Equal("Fast", indicator.LinesSeries[0].Name);
Assert.Equal("Slow", indicator.LinesSeries[1].Name);
}
}
}
+1 -1
View File
@@ -353,4 +353,4 @@ public class AobvTests
Assert.NotEqual(0, aobv.LastFast.Value);
Assert.NotEqual(0, aobv.LastSlow.Value);
}
}
}
+1 -1
View File
@@ -202,4 +202,4 @@ public class AobvValidationTests
Assert.True(risingFastCount > 20, $"Fast EMA should trend up in uptrend, rising count: {risingFastCount}");
Assert.True(risingSlowCount > 15, $"Slow EMA should trend up in uptrend, rising count: {risingSlowCount}");
}
}
}
+1 -1
View File
@@ -156,4 +156,4 @@ public class EfiIndicatorTests
double val = indicator.LinesSeries[0].GetValue(0);
Assert.True(val < 0, $"EFI should be negative on sustained price decrease, got {val}");
}
}
}
+1 -1
View File
@@ -334,4 +334,4 @@ public class EfiTests
var val = efi.Update(new TBar(time.AddMinutes(1), 10, 11, 4, 5, 500));
Assert.True(val.Value < 0);
}
}
}
+1 -1
View File
@@ -83,4 +83,4 @@ public class EfiValidationTests
ValidationHelper.VerifyData(streamingValues.ToArray(), spanValues, 0, 100, 1e-12);
}
}
}
+1 -1
View File
@@ -186,4 +186,4 @@ public class EomIndicatorTests
Assert.True(double.IsFinite(val1));
Assert.True(double.IsFinite(val2));
}
}
}
+1 -1
View File
@@ -137,4 +137,4 @@ public sealed class EomValidationTests : IDisposable
ValidationHelper.VerifyData(streamingValues.ToArray(), spanValues, 0, 100, 1e-9);
}
}
}
+1 -1
View File
@@ -195,4 +195,4 @@ public class IiiIndicatorTests
Assert.True(double.IsFinite(val1));
Assert.True(double.IsFinite(val2));
}
}
}
+1 -1
View File
@@ -408,4 +408,4 @@ public class IiiTests
var result2 = iii.Update(bar2);
Assert.Equal(-0.5 * 200, result2.Value, 10); // -0.5 * volume
}
}
}
+1 -1
View File
@@ -294,4 +294,4 @@ public class IiiValidationTests
}
}
}
}
}
+1 -1
View File
@@ -208,4 +208,4 @@ public class KvoIndicatorTests
Assert.True(double.IsFinite(val1));
Assert.True(double.IsFinite(val2));
}
}
}
+1 -1
View File
@@ -509,4 +509,4 @@ public class KvoTests
Assert.True(kvo.IsHot);
}
}
}
+1 -1
View File
@@ -119,4 +119,4 @@ public class MfiIndicatorTests
Assert.Equal(21, indicator.MinHistoryDepths);
Assert.Equal(21, ((IWatchlistIndicator)indicator).MinHistoryDepths);
}
}
}
+1 -1
View File
@@ -409,4 +409,4 @@ public class MfiTests
Assert.True(mfi.IsHot);
}
}
}
+2 -2
View File
@@ -52,7 +52,7 @@ public class MfiValidationTests
var retCode = Functions.Mfi<double>(
highData, lowData, closeData, volumeData,
0..^0, taOut, out var outRange, period);
Assert.Equal(Core.RetCode.Success, retCode);
Assert.Equal(TALib.Core.RetCode.Success, retCode);
(int offset, int length) = outRange.GetOffsetAndLength(taOut.Length);
Assert.True(length > 100, $"TALib MFI produced only {length} values");
@@ -192,4 +192,4 @@ public class MfiValidationTests
Assert.False(allEqual, "Different periods should produce different results");
}
}
}
+1 -1
View File
@@ -184,4 +184,4 @@ public class NviIndicatorTests
Assert.True(secondVal > firstVal, $"NVI should increase when volume decreases and price rises: {secondVal} vs {firstVal}");
}
}
}
+1 -1
View File
@@ -426,4 +426,4 @@ public class NviTests
Assert.True(nvi.IsHot);
}
}
}
+1 -1
View File
@@ -260,4 +260,4 @@ public sealed class NviValidationTests : IDisposable
nvi.Update(new TBar(time.AddMinutes(3), 110, 112, 98, 100, 70000));
Assert.Equal(1050 * (100.0 / 110.0), nvi.Last.Value, 6);
}
}
}
+1 -1
View File
@@ -221,4 +221,4 @@ public class ObvIndicatorTests
double firstVal = indicator.LinesSeries[0].GetValue(0);
Assert.Equal(0, firstVal);
}
}
}
+1 -1
View File
@@ -400,4 +400,4 @@ public class ObvTests
obv.Update(new TBar(time.AddMinutes(4), 102, 112, 100, 110, 8000));
Assert.Equal(11000, obv.Last.Value);
}
}
}
+1 -1
View File
@@ -159,4 +159,4 @@ public class ObvValidationTests
ValidationHelper.VerifyData(streamingValues.ToArray(), spanOutput, 0, 100, 1e-9);
}
}
}
+1 -1
View File
@@ -220,4 +220,4 @@ public class PvdIndicatorTests
double val = indicator.LinesSeries[0].GetValue(0);
Assert.True(double.IsFinite(val));
}
}
}
+1 -1
View File
@@ -600,4 +600,4 @@ public class PvdTests
}
#endregion
}
}
+1 -1
View File
@@ -375,4 +375,4 @@ public class PvdValidationTests
}
#endregion
}
}
+1 -1
View File
@@ -184,4 +184,4 @@ public class PviIndicatorTests
Assert.True(secondVal > firstVal, $"PVI should increase when volume increases and price rises: {secondVal} vs {firstVal}");
}
}
}
+1 -1
View File
@@ -426,4 +426,4 @@ public class PviTests
Assert.True(pvi.IsHot);
}
}
}
+1 -1
View File
@@ -260,4 +260,4 @@ public sealed class PviValidationTests : IDisposable
pvi.Update(new TBar(time.AddMinutes(3), 110, 112, 98, 100, 150000));
Assert.Equal(1050 * (100.0 / 110.0), pvi.Last.Value, 6);
}
}
}
+1 -1
View File
@@ -234,4 +234,4 @@ public class PvoIndicatorTests
Assert.True(double.IsFinite(val1));
Assert.True(double.IsFinite(val2));
}
}
}
+1 -1
View File
@@ -517,4 +517,4 @@ public class PvoTests
// 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}");
}
}
}
+1 -1
View File
@@ -245,4 +245,4 @@ public class PvoValidationTests
int finiteCount = values.Count(v => double.IsFinite(v));
Assert.True(finiteCount > 100, $"Expected >100 finite Ooples PVO values, got {finiteCount}");
}
}
}
+1 -1
View File
@@ -135,4 +135,4 @@ public class PvrIndicatorTests
double val = indicator.LinesSeries[0].GetValue(0);
Assert.Equal(4.0, val);
}
}
}
+1 -1
View File
@@ -354,4 +354,4 @@ public class PvrTests
Assert.True(pvr.IsHot);
}
}
}
+1 -1
View File
@@ -136,4 +136,4 @@ public class PvrValidationTests
ValidationHelper.VerifyData(mode1Values.ToArray(), mode3Values, 0, 100, 1e-9);
ValidationHelper.VerifyData(mode1Values.ToArray(), mode4Values, 0, 100, 1e-9);
}
}
}
+1 -1
View File
@@ -225,4 +225,4 @@ public class PvtIndicatorTests
double firstVal = indicator.LinesSeries[0].GetValue(0);
Assert.Equal(0, firstVal);
}
}
}
+1 -1
View File
@@ -458,4 +458,4 @@ public class PvtTests
pvt.Update(new TBar(time.AddMinutes(3), 105, 108, 102, 105, 20000));
Assert.Equal(prevPvt, pvt.Last.Value, Tolerance);
}
}
}
+1 -1
View File
@@ -112,4 +112,4 @@ public class PvtValidationTests
double expected3 = expected2 + 2500 * (10.0 / 105.0); // = 369.9134...
Assert.Equal(expected3, result3.Value, 1e-10);
}
}
}
+1 -1
View File
@@ -275,4 +275,4 @@ public class TviIndicatorTests
Assert.True(double.IsFinite(smallVal));
Assert.True(double.IsFinite(largeVal));
}
}
}
+1 -1
View File
@@ -480,4 +480,4 @@ public class TviTests
// Results should differ due to sticky direction behavior
Assert.NotEqual(tvi01.Last.Value, tvi05.Last.Value);
}
}
}
+1 -1
View File
@@ -193,4 +193,4 @@ public class TviValidationTests
int finiteCount = values.Count(v => double.IsFinite(v));
Assert.True(finiteCount > 100, $"Expected >100 finite values, got {finiteCount}");
}
}
}
+1 -1
View File
@@ -284,4 +284,4 @@ public class TwapIndicatorTests
Assert.True(double.IsFinite(val), $"Value at bar {i} should be finite");
}
}
}
}
+1 -1
View File
@@ -421,4 +421,4 @@ public class TwapTests
Assert.Equal(100, result.Value, 10);
}
}
}
+1 -1
View File
@@ -178,4 +178,4 @@ public class TwapValidationTests
$"TWAP {v} should be within reasonable bounds of price range [{minPrice}, {maxPrice}]");
}
}
}
}
+1 -1
View File
@@ -227,4 +227,4 @@ public class VaIndicatorTests
double val = indicator.LinesSeries[0].GetValue(0);
Assert.Equal(0, val, 1);
}
}
}
+1 -1
View File
@@ -343,4 +343,4 @@ public class VaTests
va.Update(new TBar(time.AddMinutes(2), 100, 115, 95, 98, 1500));
Assert.Equal(4500, va.Last.Value, 10);
}
}
}
+1 -1
View File
@@ -305,4 +305,4 @@ public class VfIndicatorTests
Assert.True(hasPositive && hasNegative, "VF should oscillate around zero");
}
}
}
+1 -1
View File
@@ -586,4 +586,4 @@ public class VfTests
}
#endregion
}
}
+1 -1
View File
@@ -310,4 +310,4 @@ public class VoIndicatorTests
Assert.True(hasPositive && hasNegative, "VO should oscillate around zero");
}
}
}
+1 -1
View File
@@ -599,4 +599,4 @@ public class VoTests
}
#endregion
}
}
+1 -1
View File
@@ -334,4 +334,4 @@ public class VrocIndicatorTests
// Division by zero protection should return 0
Assert.Equal(0.0, val, 1);
}
}
}
+1 -1
View File
@@ -687,4 +687,4 @@ public class VrocTests
}
#endregion
}
}
+1 -1
View File
@@ -161,4 +161,4 @@ public class VwadIndicatorTests
// Different periods should produce different results
Assert.NotEqual(val10, val20, 6);
}
}
}
+1 -1
View File
@@ -426,4 +426,4 @@ public class VwadTests
Assert.Equal(expected, spanResult, precision: 9);
Assert.Equal(expected, streamingResult, precision: 9);
}
}
}
+1 -1
View File
@@ -244,4 +244,4 @@ public class VwadValidationTests
// Most bars should cause changes (unless MFM happens to be exactly 0)
Assert.True(changeCount > _data.Bars.Count * 0.5, "VWAD should change for most bars with non-zero MFM");
}
}
}
+1 -1
View File
@@ -189,4 +189,4 @@ public class VwapIndicatorTests
// All values after reset should be similar (since price is constant)
Assert.True(valuesAtReset.Count >= 2, "Should have multiple reset points");
}
}
}
+1 -1
View File
@@ -426,4 +426,4 @@ public class VwapTests
Assert.Equal(batchResult.Values[i], streamingResults[i], 10);
}
}
}
}
+1 -1
View File
@@ -258,4 +258,4 @@ public class VwapValidationTests
double expectedTypicalPrice = (30.0 + 10.0 + 20.0) / 3.0;
Assert.Equal(expectedTypicalPrice, result.Value, 10);
}
}
}
+1 -1
View File
@@ -190,4 +190,4 @@ public class VwmaIndicatorTests
Assert.True(valueAfterHigh > valueAtConstant + 50,
$"VWMA should increase as low-price bars drop out: {valueAtConstant} -> {valueAfterHigh}");
}
}
}
+1 -1
View File
@@ -452,4 +452,4 @@ public class VwmaTests
Assert.Equal(batchResult.Values[i], streamingResults[i], 10);
}
}
}
}
+1 -1
View File
@@ -399,4 +399,4 @@ public class VwmaValidationTests
Assert.True(shortDiff < longDiff, "Short period VWMA should track price more closely");
}
}
}
+1 -1
View File
@@ -85,4 +85,4 @@ public class WadIndicatorTests
Assert.Equal(2, indicator.LinesSeries[0].Count);
}
}
}
+1 -1
View File
@@ -257,4 +257,4 @@ public class WadTests
wad.Update(new TBar(DateTime.UtcNow, 100, 105, 95, 100, 1000));
Assert.True(wad.IsHot);
}
}
}