code reviews

This commit is contained in:
Miha Kralj
2026-01-18 22:23:50 -08:00
parent 86fe32a682
commit 4673f48a70
40 changed files with 1155 additions and 309 deletions
+5 -3
View File
@@ -184,7 +184,8 @@ public class JerkIndicatorTests
var now = DateTime.UtcNow;
// Cubic trend: changing acceleration = non-zero jerk
// Cubic trend: f(x) = x³ has third derivative = 6
// Using f(i) = i³, the discrete third differences converge to 6
for (int i = 0; i < 10; i++)
{
double price = 100 + i * i * i; // cubic growth
@@ -193,7 +194,8 @@ public class JerkIndicatorTests
}
double lastJerk = indicator.LinesSeries[0].GetValue(0);
Assert.True(lastJerk != 0);
// For f(x) = x³, discrete third difference = 6
Assert.Equal(6.0, lastJerk, 6);
}
[Fact]
@@ -215,4 +217,4 @@ public class JerkIndicatorTests
double lastJerk = indicator.LinesSeries[0].GetValue(0);
Assert.Equal(0, lastJerk, 6);
}
}
}
+3 -1
View File
@@ -1,3 +1,5 @@
using Xunit;
namespace QuanTAlib.Tests;
public class JerkTests
@@ -302,4 +304,4 @@ public class JerkTests
Assert.Equal(jerkResults[i], chainResults[i], precision: 9);
}
}
}
}