CVI - Chaikin

This commit is contained in:
Miha Kralj
2024-11-01 17:40:29 -07:00
3 changed files with 179 additions and 0 deletions
+16
View File
@@ -102,6 +102,22 @@ public class VolatilityUpdateTests
Assert.Equal(initialValue, finalValue, precision);
}
[Fact]
public void Cvi_Update()
{
var indicator = new Cvi(period: 14);
TBar r = GetRandomBar(true);
double initialValue = indicator.Calc(r);
for (int i = 0; i < RandomUpdates; i++)
{
indicator.Calc(GetRandomBar(IsNew: false));
}
double finalValue = indicator.Calc(new TBar(r.Time, r.Open, r.High, r.Low, r.Close, r.Volume, IsNew: false));
Assert.Equal(initialValue, finalValue, precision);
}
[Fact]
public void Tr_Update()
{