minor updates

This commit is contained in:
Miha Kralj
2023-01-08 19:28:45 -08:00
parent 6db1ba7562
commit 585bbdf129
7 changed files with 52 additions and 17 deletions
+4 -4
View File
@@ -65,7 +65,7 @@ public class PandasTA : IDisposable
}
}
/*
[Fact] void ADOSC() {
ADOSC_Series QL = new(bars);
var pta = df.ta.adosc(high: df.high, low: df.low, close: df.close, volume: df.volume);
@@ -122,7 +122,7 @@ public class PandasTA : IDisposable
Assert.InRange(PanTA_item! - QL_item, -Math.Exp(-digits), Math.Exp(-digits));
}
}
/*
[Fact]
void CMO() {
CMO_Series QL = new(bars.Close, period, false);
@@ -133,7 +133,7 @@ public class PandasTA : IDisposable
Assert.InRange(PanTA_item! - QL_item, -Math.Exp(-digits), Math.Exp(-digits));
}
}
*/
[Fact] void DEMA() {
DEMA_Series QL = new(bars.Close, period, false);
var pta = df.ta.dema(close: df.close, length: period);
@@ -428,5 +428,5 @@ public class PandasTA : IDisposable
Assert.InRange(PanTA_item! - QL_item, -Math.Exp(-digits), Math.Exp(-digits));
}
}
*/
}
+3 -3
View File
@@ -62,7 +62,7 @@ public class Ta_Lib
{
ADOSC_Series QL = new(bars, 3, 10, false);
Core.AdOsc(inhigh, inlow, inclose, involume, 0, bars.Count - 1, TALIB, out int outBegIdx, out _);
for (int i = QL.Length - 1; i > skip; i--)
for (int i = QL.Length - 1; i > skip*2; i--)
{
double QL_item = QL[i].v;
double TA_item = TALIB[i - outBegIdx];
@@ -244,11 +244,11 @@ public class Ta_Lib
{
MAMA_Series QL = new(bars.Close, fastlimit: 0.5, slowlimit: 0.05);
Core.Mama(inReal: inclose, startIdx: 0, endIdx: bars.Count - 1, outMama: TALIB, outFama: TALIB2, outBegIdx: out int outBegIdx, outNbElement: out _, optInFastLimit: 0.5, optInSlowLimit: 0.05);
for (int i = QL.Length - 1; i > skip * 15; i--)
for (int i = QL.Length - 1; i > skip * 10; i--)
{
double QL_item = QL[i].v;
double TA_item = TALIB[i - outBegIdx];
Assert.InRange(TA_item! - QL_item, -Math.Exp(-digits), Math.Exp(-digits));
Assert.InRange(TA_item! - QL_item, -Math.Exp(-digits-1), Math.Exp(-digits-1));
}
}
[Fact]