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
+2 -2
View File
@@ -102,7 +102,7 @@ public sealed class AtrValidationTests : IDisposable
// Calculate TA-Lib ATR
var retCode = TALib.Functions.Atr(hData, lData, cData, 0..^0, output, out var outRange, period);
Assert.Equal(Core.RetCode.Success, retCode);
Assert.Equal(TALib.Core.RetCode.Success, retCode);
int lookback = TALib.Functions.AtrLookback(period);
@@ -135,7 +135,7 @@ public sealed class AtrValidationTests : IDisposable
// Calculate TA-Lib ATR
var retCode = TALib.Functions.Atr(hData, lData, cData, 0..^0, output, out var outRange, period);
Assert.Equal(Core.RetCode.Success, retCode);
Assert.Equal(TALib.Core.RetCode.Success, retCode);
int lookback = TALib.Functions.AtrLookback(period);
+1 -1
View File
@@ -212,4 +212,4 @@ public class BbwIndicatorTests
Assert.Contains("github.com", indicator.SourceCodeLink, StringComparison.Ordinal);
Assert.Contains("Bbw.Quantower.cs", indicator.SourceCodeLink, StringComparison.Ordinal);
}
}
}
+1 -1
View File
@@ -426,4 +426,4 @@ public class BbwTests
double expectedBbw = (2.0 * 2.0 * 5.0) / 105.0;
Assert.Equal(expectedBbw, bbw.Last.Value, 1e-10);
}
}
}
+1 -1
View File
@@ -267,4 +267,4 @@ public sealed class BbwValidationTests : IDisposable
Assert.True(finiteCount > 100, $"Expected >100 finite BBW pairs, got {finiteCount}");
_output.WriteLine($"BBW Ooples structural: {finiteCount} finite pairs verified.");
}
}
}
+1 -1
View File
@@ -214,4 +214,4 @@ public class BbwnIndicatorTests
Assert.Contains("github.com", indicator.SourceCodeLink, StringComparison.Ordinal);
Assert.Contains("Bbwn.Quantower.cs", indicator.SourceCodeLink, StringComparison.Ordinal);
}
}
}
+1 -1
View File
@@ -485,4 +485,4 @@ public class BbwnTests
Assert.Equal(result1.Value, result3.Value, Tolerance);
}
}
}
+1 -1
View File
@@ -176,4 +176,4 @@ public class BbwnValidationTests
Assert.Equal(multiplier, bbwn.Multiplier);
Assert.Equal(lookback, bbwn.Lookback);
}
}
}
+1 -1
View File
@@ -214,4 +214,4 @@ public class BbwpIndicatorTests
Assert.Contains("github.com", indicator.SourceCodeLink, StringComparison.Ordinal);
Assert.Contains("Bbwp.Quantower.cs", indicator.SourceCodeLink, StringComparison.Ordinal);
}
}
}
+1 -1
View File
@@ -483,4 +483,4 @@ public class BbwpTests
Assert.Equal(result1.Value, result3.Value, Tolerance);
}
}
}
+1 -1
View File
@@ -222,4 +222,4 @@ public class BbwpValidationTests
Assert.Equal(bbwpStream.Last.Value, output[output.Length - 1], 1e-10);
}
}
}
+1 -1
View File
@@ -212,4 +212,4 @@ public class CcvIndicatorTests
Assert.Contains("github.com", indicator.SourceCodeLink, StringComparison.Ordinal);
Assert.Contains("Ccv.Quantower.cs", indicator.SourceCodeLink, StringComparison.Ordinal);
}
}
}
+1 -1
View File
@@ -433,4 +433,4 @@ public class CcvTests
Assert.True(sma.IsHot);
Assert.True(double.IsFinite(sma.Last.Value));
}
}
}
+1 -1
View File
@@ -301,4 +301,4 @@ public class CcvValidationTests
Assert.True(ccv20.Last.Value >= 0);
Assert.True(ccv50.Last.Value >= 0);
}
}
}
+1 -1
View File
@@ -305,4 +305,4 @@ public class CvIndicatorTests
double max = values.Max();
Assert.True(max > min, "CV should vary with changing volatility patterns");
}
}
}
+1 -1
View File
@@ -456,4 +456,4 @@ public class CvTests
Assert.True(sma.IsHot);
Assert.True(double.IsFinite(sma.Last.Value));
}
}
}
+1 -1
View File
@@ -451,4 +451,4 @@ public class CvValidationTests
Assert.True(cv.Last.Value >= 0, "Volatility cannot be negative");
Assert.True(cv.Last.Value < 500, "Volatility should be reasonable (< 500% annualized)");
}
}
}
+1 -1
View File
@@ -281,4 +281,4 @@ public class CviIndicatorTests
// With constant but different ranges, the absolute values may differ
// but both should be close to 0 (no rate of change)
}
}
}
+1 -1
View File
@@ -497,4 +497,4 @@ public class CviTests
Assert.Throws<ArgumentException>(() => Cvi.Batch(source, outputCorrect, 0, 2));
Assert.Throws<ArgumentException>(() => Cvi.Batch(source, outputCorrect, 2, 0));
}
}
}
+1 -1
View File
@@ -621,4 +621,4 @@ public class CviValidationTests
double mean = values.Average();
return values.Average(v => Math.Pow(v - mean, 2));
}
}
}
+1 -1
View File
@@ -308,4 +308,4 @@ public class EwmaIndicatorTests
Assert.True(shortIncrease > longIncrease,
"Shorter period should respond more strongly to shocks");
}
}
}
+1 -1
View File
@@ -550,4 +550,4 @@ public class EwmaTests
Assert.True(double.IsFinite(resultZero.Value));
Assert.True(resultZero.Value >= 0);
}
}
}
+1 -1
View File
@@ -492,4 +492,4 @@ public class EwmaValidationTests
Assert.True(shortIncrease > longIncrease,
"Shorter period should respond more strongly to shocks");
}
}
}
+1 -1
View File
@@ -301,4 +301,4 @@ public class GkvIndicatorTests
Assert.True(double.IsFinite(val));
Assert.True(val < 0.001, "Constant price should produce near-zero volatility");
}
}
}
+1 -1
View File
@@ -643,4 +643,4 @@ public class GkvTests
}
#endregion
}
}
+1 -1
View File
@@ -625,4 +625,4 @@ public class GkvValidationTests
double mean = values.Average();
return values.Average(v => Math.Pow(v - mean, 2));
}
}
}
+1 -1
View File
@@ -301,4 +301,4 @@ public class HlvIndicatorTests
Assert.True(double.IsFinite(val));
Assert.True(val < 0.001, "Constant price should produce near-zero volatility");
}
}
}
+1 -1
View File
@@ -646,4 +646,4 @@ public class HlvTests
}
#endregion
}
}
+1 -1
View File
@@ -644,4 +644,4 @@ public class HlvValidationTests
double mean = values.Average();
return values.Average(v => Math.Pow(v - mean, 2));
}
}
}
+1 -1
View File
@@ -324,4 +324,4 @@ public class HvIndicatorTests
Assert.True(double.IsFinite(val));
Assert.True(val > 0, "Varying returns should produce non-zero volatility");
}
}
}
+1 -1
View File
@@ -734,4 +734,4 @@ public class HvTests
}
#endregion
}
}
+1 -1
View File
@@ -667,4 +667,4 @@ public class HvValidationTests
double mean = values.Average();
return values.Average(v => Math.Pow(v - mean, 2));
}
}
}
@@ -173,4 +173,4 @@ public class JvoltyIndicatorTests
Assert.Contains("github.com", indicator.SourceCodeLink, StringComparison.Ordinal);
Assert.Contains("Jvolty.Quantower.cs", indicator.SourceCodeLink, StringComparison.Ordinal);
}
}
}
+1 -1
View File
@@ -650,4 +650,4 @@ public class JvoltyTests
Assert.InRange(lastValue, 1.0, double.MaxValue); // Volatility >= minimum (1.0)
}
#pragma warning restore S2699
}
}
@@ -195,4 +195,4 @@ public class JvoltynIndicatorTests
Assert.True(val <= 100.0, $"Bar {i}: value {val} should be <= 100");
}
}
}
}
+1 -1
View File
@@ -706,4 +706,4 @@ public class JvoltynTests
Assert.InRange(lastValue, 0.0, 100.0); // Normalized volatility in [0, 100]
}
#pragma warning restore S2699
}
}
@@ -206,4 +206,4 @@ public class MassiIndicatorTests
Assert.True(double.IsFinite(smallRangeVal));
Assert.True(double.IsFinite(largeRangeVal));
}
}
}
+1 -1
View File
@@ -724,4 +724,4 @@ public class MassiTests
// Both should produce same result
Assert.Equal(massi1.Last.Value, massi2.Last.Value, Tolerance);
}
}
}
@@ -275,4 +275,4 @@ public class MassiValidationTests
int finiteCount = values.Count(v => double.IsFinite(v));
Assert.True(finiteCount > 100, $"Expected >100 finite values, got {finiteCount}");
}
}
}
+1 -1
View File
@@ -155,4 +155,4 @@ public class NatrIndicatorTests
var indicator = new NatrIndicator();
Assert.Contains("percentage", indicator.Description, StringComparison.OrdinalIgnoreCase);
}
}
}
+1 -1
View File
@@ -598,4 +598,4 @@ public class NatrTests
Assert.True(double.IsFinite(natr.Last.Value), "Last value should be finite after Prime");
}
#pragma warning restore S2699
}
}
+3 -3
View File
@@ -150,7 +150,7 @@ public sealed class NatrValidationTests : IDisposable
// Calculate TA-Lib ATR
var retCode = TALib.Functions.Atr(hData, lData, cData, 0..^0, atrOutput, out var outRange, period);
Assert.Equal(Core.RetCode.Success, retCode);
Assert.Equal(TALib.Core.RetCode.Success, retCode);
int lookback = TALib.Functions.AtrLookback(period);
@@ -199,7 +199,7 @@ public sealed class NatrValidationTests : IDisposable
// Calculate TA-Lib ATR
var retCode = TALib.Functions.Atr(hData, lData, cData, 0..^0, atrOutput, out var outRange, period);
Assert.Equal(Core.RetCode.Success, retCode);
Assert.Equal(TALib.Core.RetCode.Success, retCode);
int lookback = TALib.Functions.AtrLookback(period);
@@ -348,4 +348,4 @@ public sealed class NatrValidationTests : IDisposable
}
_output.WriteLine("NATR Batch(TBarSeries) validated successfully against Ooples ATR");
}
}
}
+1 -1
View File
@@ -323,4 +323,4 @@ public class RsvIndicatorTests
Assert.True(double.IsFinite(val));
Assert.True(val > 0, "Trending market with volatility should produce positive RSV");
}
}
}
+1 -1
View File
@@ -714,4 +714,4 @@ public class RsvTests
}
#endregion
}
}
+1 -1
View File
@@ -710,4 +710,4 @@ public class RsvValidationTests
double mean = values.Average();
return values.Average(v => Math.Pow(v - mean, 2));
}
}
}
+1 -1
View File
@@ -342,4 +342,4 @@ public class RvIndicatorTests
// Different smoothing periods should produce different results
Assert.NotEqual(val1, val2);
}
}
}
+1 -1
View File
@@ -712,4 +712,4 @@ public class RvTests
}
#endregion
}
}
+1 -1
View File
@@ -558,4 +558,4 @@ public class RvValidationTests
double mean = values.Average();
return values.Average(v => Math.Pow(v - mean, 2));
}
}
}
+1 -1
View File
@@ -313,4 +313,4 @@ public class RviIndicatorTests
// In a neutral market, RVI should be near 50
Assert.True(val >= 30 && val <= 70, $"Neutral market should produce RVI near 50, got {val}");
}
}
}
+1 -1
View File
@@ -668,4 +668,4 @@ public class RviTests
}
#endregion
}
}
+1 -1
View File
@@ -616,4 +616,4 @@ public class RviValidationTests
return values.Average(v => Math.Pow(v - mean, 2));
}
}
}
+1 -1
View File
@@ -293,4 +293,4 @@ public class TrIndicatorTests
// TR = max(10, 60, 50) = 60
Assert.Equal(60.0, secondTr, 10);
}
}
}
+1 -1
View File
@@ -530,4 +530,4 @@ public class TrTests
}
#endregion
}
}
+2 -2
View File
@@ -672,7 +672,7 @@ public class TrValidationTests
double[] output = new double[high.Length];
var retCode = Functions.TRange<double>(high, low, close, 0..^0, output, out var outRange);
Assert.Equal(Core.RetCode.Success, retCode);
Assert.Equal(TALib.Core.RetCode.Success, retCode);
int lookback = Functions.TRangeLookback();
@@ -713,4 +713,4 @@ public class TrValidationTests
$"TR mismatch at {qIdx}: QuanTAlib={qOutput[qIdx]:G17}, Tulip={outputs[0][i]:G17}");
}
}
}
}
+1 -1
View File
@@ -335,4 +335,4 @@ public class UiIndicatorTests
// After 15 bars of rising prices past the old high, UI should be near zero or much lower
Assert.True(afterRecovery < duringDrawdown, "Recovery from drawdown should reduce UI value");
}
}
}
+1 -1
View File
@@ -611,4 +611,4 @@ public class UiTests
}
#endregion
}
}
+1 -1
View File
@@ -696,4 +696,4 @@ public class UiValidationTests
int finiteCount = values.Count(v => double.IsFinite(v));
Assert.True(finiteCount > 100, $"Expected >100 finite Ooples UI values, got {finiteCount}");
}
}
}
+1 -1
View File
@@ -326,4 +326,4 @@ public class VovIndicatorTests
// During volatility regime change, VOV should typically increase
Assert.True(transitionVal > 0, "Changing volatility regime should produce positive VOV");
}
}
}
+1 -1
View File
@@ -644,4 +644,4 @@ public class VovTests
}
#endregion
}
}
+1 -1
View File
@@ -623,4 +623,4 @@ public class VovValidationTests
Assert.Equal(0.5, result.Value, 8);
}
}
}
+1 -1
View File
@@ -381,4 +381,4 @@ public class VrIndicatorTests
// In steady state with consistent volatility, VR should hover around 1
Assert.True(avgVr >= 0.5 && avgVr <= 2.0, $"Average VR should be around 1, got {avgVr}");
}
}
}
+1 -1
View File
@@ -625,4 +625,4 @@ public class VrTests
}
#endregion
}
}
+1 -1
View File
@@ -421,4 +421,4 @@ public class VrValidationTests
}
#endregion
}
}
+1 -1
View File
@@ -337,4 +337,4 @@ public class YzvIndicatorTests
Assert.True(double.IsFinite(highVolVal));
Assert.True(highVolVal > lowVolVal, "High volatility regime should produce higher YZV");
}
}
}
+1 -1
View File
@@ -608,4 +608,4 @@ public class YzvTests
}
#endregion
}
}
+1 -1
View File
@@ -314,4 +314,4 @@ public class YzvValidationTests
}
#endregion
}
}