This commit is contained in:
Miha Kralj
2023-01-05 16:40:08 -08:00
parent bfcbf8d686
commit 7a0279b3d5
10 changed files with 273 additions and 183 deletions
+39
View File
@@ -0,0 +1,39 @@
namespace QuanTAlib;
using System;
using System.Collections.Generic;
/* <summary>
DECAY:
Linear decay can be modeled by a straight line with a negative slope of 1/period.
The value decreases in a straight line from the last maximum to 0.
Decay = Last Max - distance/period
Exponential decay is modeled as an exponential curve with diminishing factor of
1-1/p
</summary> */
public class DECAY_Series : Single_TSeries_Indicator {
private bool _exp;
private double _pdecay, _ppdecay;
private readonly double _dfactor;
public DECAY_Series(TSeries source, int period = 10, bool exponential= false, bool useNaN = false) : base(source, period, false) {
_exp = exponential;
_dfactor = (_exp)? 1.0 - 1.0 / (double)_p : 1/(double)_p;
_pdecay = _ppdecay = 0;
if (source.Count > 0) { base.Add(this._data); }
}
public override void Add((DateTime t, double v) TValue, bool update) {
if (update) { _pdecay = _ppdecay; }
else { _ppdecay = _pdecay; }
if (this.Count == 0) { _pdecay = TValue.v; }
double _decay = Math.Max(TValue.v, Math.Max((_exp)?_pdecay*_dfactor:_pdecay-_dfactor, 0));
_pdecay = _decay;
base.Add((TValue.t, _decay), update, _NaN);
}
}
+1 -1
View File
@@ -10,7 +10,7 @@ FMA: Fibonacci Moving Average
Sources: Sources:
https://kaabar-sofien.medium.com/the-fibonacci-moving-average-the-full-guide-60e718117595 https://kaabar-sofien.medium.com/the-fibonacci-moving-average-the-full-guide-60e718117595
https://www.tradingview.com/script/6pxgp2vh-Fibonacci-Moving-Average-FMA/ https://usethinkscript.com/threads/fibonacci-moving-average.8099/
</summary> */ </summary> */
+7 -8
View File
@@ -39,17 +39,17 @@ public class KAMA_Series : Single_TSeries_Indicator
{ {
if (update){ if (update){
_buffer[_buffer.Count - 1] = TValue.v; _buffer[_buffer.Count - 1] = TValue.v;
this._lastkama = this._lastlastkama; _lastkama = _lastlastkama;
} else { }
else {
_buffer.Add(TValue.v); _buffer.Add(TValue.v);
_lastlastkama = _lastkama;
} }
if (_buffer.Count > _p + 1) { _buffer.RemoveAt(0); } if (_buffer.Count > _p + 1) { _buffer.RemoveAt(0); }
double _kama = 0; double _kama = 0;
if (this.Count < this._p) { if (this.Count < this._p) { _kama = TValue.v; }
for (int i = 0; i < this._buffer.Count; i++) { _kama += this._buffer[i]; } else {
_kama /= this._buffer.Count;
} else {
double _change = Math.Abs(_buffer[_buffer.Count - 1] - _buffer[(_buffer.Count > _p + 1) ? 1 : 0]); double _change = Math.Abs(_buffer[_buffer.Count - 1] - _buffer[(_buffer.Count > _p + 1) ? 1 : 0]);
double _sumpv = 0; double _sumpv = 0;
for (int i = 1; i < _buffer.Count; i++) for (int i = 1; i < _buffer.Count; i++)
@@ -58,8 +58,7 @@ public class KAMA_Series : Single_TSeries_Indicator
double _sc = (_er * (_scFast - _scSlow)) + _scSlow; double _sc = (_er * (_scFast - _scSlow)) + _scSlow;
_kama = (_lastkama + (_sc * _sc * (TValue.v - _lastkama))); _kama = (_lastkama + (_sc * _sc * (TValue.v - _lastkama)));
} }
_lastlastkama = _lastkama;
_lastkama = _kama; _lastkama = _kama;
base.Add((TValue.t, _kama), update, _NaN); base.Add((TValue.t, _kama), update, _NaN);
} }
} }
+2 -1
View File
@@ -21,7 +21,8 @@ public class SMA_Series : Single_TSeries_Indicator {
private int _len, _oldlen; private int _len, _oldlen;
public SMA_Series(TSeries source, int period = 0, bool useNaN = false) : base(source, period, false) { public SMA_Series(TSeries source, int period = 0, bool useNaN = false) : base(source, period, false) {
Reset(); _sum = _oldsum = 0;
_len = _oldlen = 0;
if (this._data.Count > 0) { base.Add(this._data); } if (this._data.Count > 0) { base.Add(this._data); }
} }
+4 -2
View File
@@ -26,13 +26,15 @@ public class ZLEMA_Series : Single_TSeries_Indicator
private readonly double _k, _k1m; private readonly double _k, _k1m;
private double _lastema, _lastema_o; private double _lastema, _lastema_o;
private int _llag; private int _llag;
private readonly bool _useSMA;
public ZLEMA_Series(TSeries source, int period, bool useNaN = false) : base(source, period, useNaN) public ZLEMA_Series(TSeries source, int period, bool useNaN = false, bool useSMA = true) : base(source, period, useNaN)
{ {
this._k = 2.0 / (this._p + 1); this._k = 2.0 / (this._p + 1);
this._k1m = 1.0 - this._k; this._k1m = 1.0 - this._k;
this._lastema = this._lastema_o = double.NaN; this._lastema = this._lastema_o = double.NaN;
_llag = (int)((_p-1) * 0.5); _llag = (int)((_p-1) * 0.5);
_useSMA = useSMA;
if (_data.Count > 0) { base.Add(_data); } if (_data.Count > 0) { base.Add(_data); }
} }
@@ -47,7 +49,7 @@ public class ZLEMA_Series : Single_TSeries_Indicator
double _zl = TValue.v + (TValue.v - _data[_lag].v); double _zl = TValue.v + (TValue.v - _data[_lag].v);
double _ema = 0; double _ema = 0;
if (this.Count < this._p) { if (this.Count < this._p && _useSMA) {
Add_Replace_Trim(_buffer, _zl, _p, update); Add_Replace_Trim(_buffer, _zl, _p, update);
_ema = _buffer.Average(); _ema = _buffer.Average();
} else { } else {
+12 -1
View File
@@ -114,7 +114,18 @@ public class Update {
Assert.Equal(lastLen, QL.Count); // same size Assert.Equal(lastLen, QL.Count); // same size
Assert.Equal(lastCalc, QL.Last()); // same data Assert.Equal(lastCalc, QL.Last()); // same data
} }
[Fact] public void DEMA() { [Fact]
public void DECAY() {
DECAY_Series QL = new(source: bars.Close, period: period);
var lastData = bars.Close.Last();
var lastCalc = QL.Last();
int lastLen = QL.Count;
QL.Add((DateTime.Today, 0), update: true);
QL.Add(lastData, update: true);
Assert.Equal(lastLen, QL.Count); // same size
Assert.Equal(lastCalc, QL.Last()); // same data
}
[Fact] public void DEMA() {
DEMA_Series QL = new(source: bars.Close, period: period); DEMA_Series QL = new(source: bars.Close, period: period);
var lastData = bars.Close.Last(); var lastData = bars.Close.Last();
var lastCalc = QL.Last(); var lastCalc = QL.Last();
+77 -69
View File
@@ -1,4 +1,3 @@
/*
using Xunit; using Xunit;
using System; using System;
using QuanTAlib; using QuanTAlib;
@@ -60,8 +59,8 @@ public class PandasTA : IDisposable
var pta = df.ta.ad(high: df.high, low: df.low, close:df.close, volume:df.volume); var pta = df.ta.ad(high: df.high, low: df.low, close:df.close, volume:df.volume);
for (int i = QL.Length; i > QL.Length-sample; i--) for (int i = QL.Length; i > QL.Length-sample; i--)
{ {
double QL_item = Math.Round(QL[i-1].v, digits: digits); double QL_item = QL[i-1].v;
double PanTA_item = Math.Round((double)pta[i-1], digits: digits); double PanTA_item = (double)pta[i-1];
Assert.InRange(PanTA_item! - QL_item, -Math.Exp(-digits), Math.Exp(-digits)); Assert.InRange(PanTA_item! - QL_item, -Math.Exp(-digits), Math.Exp(-digits));
} }
@@ -71,8 +70,8 @@ public class PandasTA : IDisposable
var pta = df.ta.adosc(high: df.high, low: df.low, close: df.close, volume: df.volume); var pta = df.ta.adosc(high: df.high, low: df.low, close: df.close, volume: df.volume);
for (int i = QL.Length; i > QL.Length-sample; i--) for (int i = QL.Length; i > QL.Length-sample; i--)
{ {
double QL_item = Math.Round(QL[i - 1].v, digits: digits); double QL_item = QL[i - 1].v;
double PanTA_item = Math.Round((double)pta[i - 1], digits: digits); double PanTA_item = (double)pta[i - 1];
Assert.InRange(PanTA_item! - QL_item, -Math.Exp(-digits), Math.Exp(-digits)); Assert.InRange(PanTA_item! - QL_item, -Math.Exp(-digits), Math.Exp(-digits));
} }
} }
@@ -81,8 +80,8 @@ public class PandasTA : IDisposable
var pta = df.ta.atr(high: df.high, low: df.low, close: df.close, length: period); var pta = df.ta.atr(high: df.high, low: df.low, close: df.close, length: period);
for (int i = QL.Length; i > QL.Length-sample; i--) for (int i = QL.Length; i > QL.Length-sample; i--)
{ {
double QL_item = Math.Round(QL[i - 1].v, digits: digits); double QL_item = QL[i - 1].v;
double PanTA_item = Math.Round((double)pta[i - 1], digits: digits); double PanTA_item = (double)pta[i - 1];
Assert.InRange(PanTA_item! - QL_item, -Math.Exp(-digits), Math.Exp(-digits)); Assert.InRange(PanTA_item! - QL_item, -Math.Exp(-digits), Math.Exp(-digits));
} }
} }
@@ -91,30 +90,40 @@ public class PandasTA : IDisposable
var pta = df.ta.bias(close: df.close, length: period); var pta = df.ta.bias(close: df.close, length: period);
for (int i = QL.Length; i > QL.Length-sample; i--) for (int i = QL.Length; i > QL.Length-sample; i--)
{ {
double QL_item = Math.Round(QL[i - 1].v, digits: digits); double QL_item = QL[i - 1].v;
double PanTA_item = Math.Round((double)pta[i - 1], digits: digits); double PanTA_item = (double)pta[i - 1];
Assert.InRange(PanTA_item! - QL_item, -Math.Exp(-digits), Math.Exp(-digits)); Assert.InRange(PanTA_item! - QL_item, -Math.Exp(-digits), Math.Exp(-digits));
} }
} }
[Fact]
void CCI() {
CCI_Series QL = new(bars, period, false);
var pta = df.ta.cci(close: df.close, length: period);
for (int i = QL.Length; i > QL.Length - sample; i--) {
double QL_item = QL[i - 1].v;
double PanTA_item = (double)pta[i - 1];
Assert.InRange(PanTA_item! - QL_item, -Math.Exp(-digits), Math.Exp(-digits));
}
}
/*
[Fact] [Fact]
void CMO() { void CMO() {
CMO_Series QL = new(bars.Close, period, false); CMO_Series QL = new(bars.Close, period, false);
var pta = df.ta.cmo(close: df.close, length: period); var pta = df.ta.cmo(close: df.close, length: period);
for (int i = QL.Length; i > QL.Length - sample; i--) { for (int i = QL.Length; i > QL.Length - sample; i--) {
double QL_item = Math.Round(QL[i - 1].v, digits: digits); double QL_item = QL[i - 1].v;
double PanTA_item = Math.Round((double)pta[i - 1], digits: digits); double PanTA_item = (double)pta[i - 1];
Assert.InRange(PanTA_item! - QL_item, -Math.Exp(-digits), Math.Exp(-digits)); Assert.InRange(PanTA_item! - QL_item, -Math.Exp(-digits), Math.Exp(-digits));
} }
} }
*/
[Fact] void DEMA() { [Fact] void DEMA() {
DEMA_Series QL = new(bars.Close, period, false); DEMA_Series QL = new(bars.Close, period, false);
var pta = df.ta.dema(close: df.close, length: period); var pta = df.ta.dema(close: df.close, length: period);
for (int i = QL.Length; i > QL.Length-sample; i--) for (int i = QL.Length; i > QL.Length-sample; i--)
{ {
double QL_item = Math.Round(QL[i - 1].v, digits: digits); double QL_item = QL[i - 1].v;
double PanTA_item = Math.Round((double)pta[i - 1], digits: digits); double PanTA_item = (double)pta[i - 1];
Assert.InRange(PanTA_item! - QL_item, -Math.Exp(-digits), Math.Exp(-digits)); Assert.InRange(PanTA_item! - QL_item, -Math.Exp(-digits), Math.Exp(-digits));
} }
} }
@@ -123,8 +132,8 @@ public class PandasTA : IDisposable
var pta = df.ta.ema(close: df.close, length: period); var pta = df.ta.ema(close: df.close, length: period);
for (int i = QL.Length; i > QL.Length-sample; i--) for (int i = QL.Length; i > QL.Length-sample; i--)
{ {
double QL_item = Math.Round(QL[i - 1].v, digits: digits); double QL_item = QL[i - 1].v;
double PanTA_item = Math.Round((double)pta[i - 1], digits: digits); double PanTA_item = (double)pta[i - 1];
Assert.InRange(PanTA_item! - QL_item, -Math.Exp(-digits), Math.Exp(-digits)); Assert.InRange(PanTA_item! - QL_item, -Math.Exp(-digits), Math.Exp(-digits));
} }
} }
@@ -133,8 +142,8 @@ public class PandasTA : IDisposable
var pta = df.ta.entropy(close: df.close, length: period); var pta = df.ta.entropy(close: df.close, length: period);
for (int i = QL.Length; i > QL.Length-sample; i--) for (int i = QL.Length; i > QL.Length-sample; i--)
{ {
double QL_item = Math.Round(QL[i - 1].v, digits: digits); double QL_item = QL[i - 1].v;
double PanTA_item = Math.Round((double)pta[i - 1], digits: digits); double PanTA_item = (double)pta[i - 1];
Assert.InRange(PanTA_item! - QL_item, -Math.Exp(-digits), Math.Exp(-digits)); Assert.InRange(PanTA_item! - QL_item, -Math.Exp(-digits), Math.Exp(-digits));
} }
} }
@@ -142,8 +151,8 @@ public class PandasTA : IDisposable
var pta = df.ta.hl2(high: df.high, low: df.low); var pta = df.ta.hl2(high: df.high, low: df.low);
for (int i = bars.HL2.Length; i > bars.HL2.Length-sample; i--) for (int i = bars.HL2.Length; i > bars.HL2.Length-sample; i--)
{ {
double QL_item = Math.Round(bars.HL2[i - 1].v, digits: digits); double QL_item = bars.HL2[i - 1].v;
double PanTA_item = Math.Round((double)pta[i - 1], digits: digits); double PanTA_item = (double)pta[i - 1];
Assert.InRange(PanTA_item! - QL_item, -Math.Exp(-digits), Math.Exp(-digits)); Assert.InRange(PanTA_item! - QL_item, -Math.Exp(-digits), Math.Exp(-digits));
} }
} }
@@ -151,8 +160,8 @@ public class PandasTA : IDisposable
var pta = df.ta.hlc3(high: df.high, low: df.low, close: df.close); var pta = df.ta.hlc3(high: df.high, low: df.low, close: df.close);
for (int i = bars.HLC3.Length; i > bars.HLC3.Length-sample; i--) for (int i = bars.HLC3.Length; i > bars.HLC3.Length-sample; i--)
{ {
double QL_item = Math.Round(bars.HLC3[i - 1].v, digits: digits); double QL_item = bars.HLC3[i - 1].v;
double PanTA_item = Math.Round((double)pta[i - 1], digits: digits); double PanTA_item = (double)pta[i - 1];
Assert.InRange(PanTA_item! - QL_item, -Math.Exp(-digits), Math.Exp(-digits)); Assert.InRange(PanTA_item! - QL_item, -Math.Exp(-digits), Math.Exp(-digits));
} }
} }
@@ -161,8 +170,8 @@ public class PandasTA : IDisposable
var pta = df.ta.hma(close: df.close, length: period); var pta = df.ta.hma(close: df.close, length: period);
for (int i = QL.Length; i > QL.Length-sample; i--) for (int i = QL.Length; i > QL.Length-sample; i--)
{ {
double QL_item = Math.Round(QL[i - 1].v, digits: digits); double QL_item = QL[i - 1].v;
double PanTA_item = Math.Round((double)pta[i - 1], digits: digits); double PanTA_item = (double)pta[i - 1];
Assert.InRange(PanTA_item! - QL_item, -Math.Exp(-digits), Math.Exp(-digits)); Assert.InRange(PanTA_item! - QL_item, -Math.Exp(-digits), Math.Exp(-digits));
} }
@@ -183,8 +192,8 @@ public class PandasTA : IDisposable
var pta = df.ta.kama(close: df.close, length: period); var pta = df.ta.kama(close: df.close, length: period);
for (int i = QL.Length; i > QL.Length-sample; i--) for (int i = QL.Length; i > QL.Length-sample; i--)
{ {
double QL_item = Math.Round(QL[i - 1].v, digits: digits); double QL_item = QL[i - 1].v;
double PanTA_item = Math.Round((double)pta[i - 1], digits: digits); double PanTA_item = (double)pta[i - 1];
Assert.InRange(PanTA_item! - QL_item, -Math.Exp(-digits), Math.Exp(-digits)); Assert.InRange(PanTA_item! - QL_item, -Math.Exp(-digits), Math.Exp(-digits));
} }
} }
@@ -193,8 +202,8 @@ public class PandasTA : IDisposable
var pta = df.ta.kurtosis(close: df.close, length: period); var pta = df.ta.kurtosis(close: df.close, length: period);
for (int i = QL.Length; i > QL.Length-sample; i--) for (int i = QL.Length; i > QL.Length-sample; i--)
{ {
double QL_item = Math.Round(QL[i - 1].v, digits: digits); double QL_item = QL[i - 1].v;
double PanTA_item = Math.Round((double)pta[i - 1], digits: digits); double PanTA_item = (double)pta[i - 1];
Assert.InRange(PanTA_item! - QL_item, -Math.Exp(-digits), Math.Exp(-digits)); Assert.InRange(PanTA_item! - QL_item, -Math.Exp(-digits), Math.Exp(-digits));
} }
} }
@@ -217,8 +226,8 @@ public class PandasTA : IDisposable
var pta = df.ta.mad(close: df.close, length: period); var pta = df.ta.mad(close: df.close, length: period);
for (int i = QL.Length; i > QL.Length-sample; i--) for (int i = QL.Length; i > QL.Length-sample; i--)
{ {
double QL_item = Math.Round(QL[i - 1].v, digits: digits); double QL_item = QL[i - 1].v;
double PanTA_item = Math.Round((double)pta[i - 1], digits: digits); double PanTA_item = (double)pta[i - 1];
Assert.InRange(PanTA_item! - QL_item, -Math.Exp(-digits), Math.Exp(-digits)); Assert.InRange(PanTA_item! - QL_item, -Math.Exp(-digits), Math.Exp(-digits));
} }
} }
@@ -227,8 +236,8 @@ public class PandasTA : IDisposable
var pta = df.ta.median(close: df.close, length: period); var pta = df.ta.median(close: df.close, length: period);
for (int i = QL.Length; i > QL.Length-sample; i--) for (int i = QL.Length; i > QL.Length-sample; i--)
{ {
double QL_item = Math.Round(QL[i - 1].v, digits: digits); double QL_item = QL[i - 1].v;
double PanTA_item = Math.Round((double)pta[i - 1], digits: digits); double PanTA_item = (double)pta[i - 1];
Assert.InRange(PanTA_item! - QL_item, -Math.Exp(-digits), Math.Exp(-digits)); Assert.InRange(PanTA_item! - QL_item, -Math.Exp(-digits), Math.Exp(-digits));
} }
} }
@@ -237,8 +246,8 @@ public class PandasTA : IDisposable
var pta = df.ta.obv(close: df.close, volume: df.volume); var pta = df.ta.obv(close: df.close, volume: df.volume);
for (int i = QL.Length; i > QL.Length-sample; i--) for (int i = QL.Length; i > QL.Length-sample; i--)
{ {
double QL_item = Math.Round(QL[i - 1].v, digits: digits); double QL_item = QL[i - 1].v;
double PanTA_item = Math.Round((double)pta[i - 1], digits: digits); double PanTA_item = (double)pta[i - 1];
Assert.InRange(PanTA_item! - QL_item, -Math.Exp(-digits), Math.Exp(-digits)); Assert.InRange(PanTA_item! - QL_item, -Math.Exp(-digits), Math.Exp(-digits));
} }
} }
@@ -246,8 +255,8 @@ public class PandasTA : IDisposable
var pta = df.ta.ohlc4(open: df.open, high: df.high, low: df.low, close: df.close); var pta = df.ta.ohlc4(open: df.open, high: df.high, low: df.low, close: df.close);
for (int i = bars.OHLC4.Length; i > bars.OHLC4.Length-sample; i--) for (int i = bars.OHLC4.Length; i > bars.OHLC4.Length-sample; i--)
{ {
double QL_item = Math.Round(bars.OHLC4[i - 1].v, digits: digits); double QL_item = bars.OHLC4[i - 1].v;
double PanTA_item = Math.Round((double)pta[i - 1], digits: digits); double PanTA_item = (double)pta[i - 1];
Assert.InRange(PanTA_item! - QL_item, -Math.Exp(-digits), Math.Exp(-digits)); Assert.InRange(PanTA_item! - QL_item, -Math.Exp(-digits), Math.Exp(-digits));
} }
} }
@@ -256,8 +265,8 @@ public class PandasTA : IDisposable
var pta = df.ta.rma(close: df.close, length: period); var pta = df.ta.rma(close: df.close, length: period);
for (int i = QL.Length; i > QL.Length-sample; i--) for (int i = QL.Length; i > QL.Length-sample; i--)
{ {
double QL_item = Math.Round(QL[i - 1].v, digits: digits); double QL_item = QL[i - 1].v;
double PanTA_item = Math.Round((double)pta[i - 1], digits: digits); double PanTA_item = (double)pta[i - 1];
Assert.InRange(PanTA_item! - QL_item, -Math.Exp(-digits), Math.Exp(-digits)); Assert.InRange(PanTA_item! - QL_item, -Math.Exp(-digits), Math.Exp(-digits));
} }
} }
@@ -266,8 +275,8 @@ public class PandasTA : IDisposable
var pta = df.ta.rsi(close: df.close, length: period); var pta = df.ta.rsi(close: df.close, length: period);
for (int i = QL.Length; i > QL.Length-sample; i--) for (int i = QL.Length; i > QL.Length-sample; i--)
{ {
double QL_item = Math.Round(QL[i - 1].v, digits: digits); double QL_item = QL[i - 1].v;
double PanTA_item = Math.Round((double)pta[i - 1], digits: digits); double PanTA_item = (double)pta[i - 1];
Assert.InRange(PanTA_item! - QL_item, -Math.Exp(-digits), Math.Exp(-digits)); Assert.InRange(PanTA_item! - QL_item, -Math.Exp(-digits), Math.Exp(-digits));
} }
} }
@@ -276,8 +285,8 @@ public class PandasTA : IDisposable
var pta = df.ta.stdev(close: df.close, length: period, ddof: 0); var pta = df.ta.stdev(close: df.close, length: period, ddof: 0);
for (int i = QL.Length; i > QL.Length-sample; i--) for (int i = QL.Length; i > QL.Length-sample; i--)
{ {
double QL_item = Math.Round(QL[i - 1].v, digits: digits); double QL_item = QL[i - 1].v;
double PanTA_item = Math.Round((double)pta[i - 1], digits: digits); double PanTA_item = (double)pta[i - 1];
Assert.InRange(PanTA_item! - QL_item, -Math.Exp(-digits), Math.Exp(-digits)); Assert.InRange(PanTA_item! - QL_item, -Math.Exp(-digits), Math.Exp(-digits));
} }
} }
@@ -286,8 +295,8 @@ public class PandasTA : IDisposable
var pta = df.ta.sma(close: df.close, length: period); var pta = df.ta.sma(close: df.close, length: period);
for (int i = QL.Length; i > QL.Length-sample; i--) for (int i = QL.Length; i > QL.Length-sample; i--)
{ {
double QL_item = Math.Round(QL[i - 1].v, digits: digits); double QL_item = QL[i - 1].v;
double PanTA_item = Math.Round((double)pta[i - 1], digits: digits); double PanTA_item = (double)pta[i - 1];
Assert.InRange(PanTA_item! - QL_item, -Math.Exp(-digits), Math.Exp(-digits)); Assert.InRange(PanTA_item! - QL_item, -Math.Exp(-digits), Math.Exp(-digits));
} }
} }
@@ -296,8 +305,8 @@ public class PandasTA : IDisposable
var pta = df.ta.stdev(close: df.close, length: period, ddof: 1); var pta = df.ta.stdev(close: df.close, length: period, ddof: 1);
for (int i = QL.Length; i > QL.Length-sample; i--) for (int i = QL.Length; i > QL.Length-sample; i--)
{ {
double QL_item = Math.Round(QL[i - 1].v, digits: digits); double QL_item = QL[i - 1].v;
double PanTA_item = Math.Round((double)pta[i - 1], digits: digits); double PanTA_item = (double)pta[i - 1];
Assert.InRange(PanTA_item! - QL_item, -Math.Exp(-digits), Math.Exp(-digits)); Assert.InRange(PanTA_item! - QL_item, -Math.Exp(-digits), Math.Exp(-digits));
} }
} }
@@ -306,8 +315,8 @@ public class PandasTA : IDisposable
var pta = df.ta.variance(close: df.close, length: period, ddof: 1); var pta = df.ta.variance(close: df.close, length: period, ddof: 1);
for (int i = QL.Length; i > QL.Length-sample; i--) for (int i = QL.Length; i > QL.Length-sample; i--)
{ {
double QL_item = Math.Round(QL[i - 1].v, digits: digits); double QL_item = QL[i - 1].v;
double PanTA_item = Math.Round((double)pta[i - 1], digits: digits); double PanTA_item = (double)pta[i - 1];
Assert.InRange(PanTA_item! - QL_item, -Math.Exp(-digits), Math.Exp(-digits)); Assert.InRange(PanTA_item! - QL_item, -Math.Exp(-digits), Math.Exp(-digits));
} }
} }
@@ -317,8 +326,8 @@ public class PandasTA : IDisposable
var pta = df.ta.t3(close: df.close, length: period, a: 0.7); var pta = df.ta.t3(close: df.close, length: period, a: 0.7);
for (int i = QL.Length; i > QL.Length-sample; i--) for (int i = QL.Length; i > QL.Length-sample; i--)
{ {
double QL_item = Math.Round(QL[i - 1].v, digits: digits); double QL_item = QL[i - 1].v;
double PanTA_item = Math.Round((double)pta[i - 1], digits: digits); double PanTA_item = (double)pta[i - 1];
Assert.InRange(PanTA_item! - QL_item, -Math.Exp(-digits), Math.Exp(-digits)); Assert.InRange(PanTA_item! - QL_item, -Math.Exp(-digits), Math.Exp(-digits));
} }
} }
@@ -327,8 +336,8 @@ public class PandasTA : IDisposable
var pta = df.ta.tema(close: df.close, length: period); var pta = df.ta.tema(close: df.close, length: period);
for (int i = QL.Length; i > QL.Length-sample; i--) for (int i = QL.Length; i > QL.Length-sample; i--)
{ {
double QL_item = Math.Round(QL[i - 1].v, digits: digits); double QL_item = QL[i - 1].v;
double PanTA_item = Math.Round((double)pta[i - 1], digits: digits); double PanTA_item = (double)pta[i - 1];
Assert.InRange(PanTA_item! - QL_item, -Math.Exp(-digits), Math.Exp(-digits)); Assert.InRange(PanTA_item! - QL_item, -Math.Exp(-digits), Math.Exp(-digits));
} }
} }
@@ -337,8 +346,8 @@ public class PandasTA : IDisposable
var pta = df.ta.true_range(high: df.high, low: df.low, close: df.close); var pta = df.ta.true_range(high: df.high, low: df.low, close: df.close);
for (int i = QL.Length; i > QL.Length-sample; i--) for (int i = QL.Length; i > QL.Length-sample; i--)
{ {
double QL_item = Math.Round(QL[i - 1].v, digits: digits); double QL_item = QL[i - 1].v;
double PanTA_item = Math.Round((double)pta[i - 1], digits: digits); double PanTA_item = (double)pta[i - 1];
Assert.InRange(PanTA_item! - QL_item, -Math.Exp(-digits), Math.Exp(-digits)); Assert.InRange(PanTA_item! - QL_item, -Math.Exp(-digits), Math.Exp(-digits));
} }
} }
@@ -348,8 +357,8 @@ public class PandasTA : IDisposable
var pta = df.ta.trima(close: df.close, length: 11); var pta = df.ta.trima(close: df.close, length: 11);
for (int i = QL.Length; i > QL.Length-sample; i--) for (int i = QL.Length; i > QL.Length-sample; i--)
{ {
double QL_item = Math.Round(QL[i - 1].v, digits: digits); double QL_item = QL[i - 1].v;
double PanTA_item = Math.Round((double)pta[i - 1], digits: digits); double PanTA_item = (double)pta[i - 1];
Assert.InRange(PanTA_item! - QL_item, -Math.Exp(-digits), Math.Exp(-digits)); Assert.InRange(PanTA_item! - QL_item, -Math.Exp(-digits), Math.Exp(-digits));
} }
} }
@@ -357,8 +366,8 @@ public class PandasTA : IDisposable
TRIX_Series QL = new(bars.Close, period); TRIX_Series QL = new(bars.Close, period);
var pta = df.ta.trix(close: df.close, length: period).to_numpy(); var pta = df.ta.trix(close: df.close, length: period).to_numpy();
for (int i = QL.Length; i > QL.Length - sample; i--) { for (int i = QL.Length; i > QL.Length - sample; i--) {
double QL_item = Math.Round(QL[i - 1].v, digits: digits); double QL_item = QL[i - 1].v;
double PanTA_item = Math.Round((double)pta[i - 1][0], digits: digits); double PanTA_item = (double)pta[i - 1][0];
Assert.InRange(PanTA_item! - QL_item, -Math.Exp(-digits), Math.Exp(-digits)); Assert.InRange(PanTA_item! - QL_item, -Math.Exp(-digits), Math.Exp(-digits));
} }
} }
@@ -367,8 +376,8 @@ public class PandasTA : IDisposable
var pta = df.ta.variance(close: df.close, length: period, ddof:0); var pta = df.ta.variance(close: df.close, length: period, ddof:0);
for (int i = QL.Length; i > QL.Length-sample; i--) for (int i = QL.Length; i > QL.Length-sample; i--)
{ {
double QL_item = Math.Round(QL[i - 1].v, digits: digits); double QL_item = QL[i - 1].v;
double PanTA_item = Math.Round((double)pta[i - 1], digits: digits); double PanTA_item = (double)pta[i - 1];
Assert.InRange(PanTA_item! - QL_item, -Math.Exp(-digits), Math.Exp(-digits)); Assert.InRange(PanTA_item! - QL_item, -Math.Exp(-digits), Math.Exp(-digits));
} }
} }
@@ -377,8 +386,8 @@ public class PandasTA : IDisposable
var pta = df.ta.wma(close: df.close, length: period); var pta = df.ta.wma(close: df.close, length: period);
for (int i = QL.Length; i > QL.Length-sample; i--) for (int i = QL.Length; i > QL.Length-sample; i--)
{ {
double QL_item = Math.Round(QL[i - 1].v, digits: digits); double QL_item = QL[i - 1].v;
double PanTA_item = Math.Round((double)pta[i - 1], digits: digits); double PanTA_item = (double)pta[i - 1];
Assert.InRange(PanTA_item! - QL_item, -Math.Exp(-digits), Math.Exp(-digits)); Assert.InRange(PanTA_item! - QL_item, -Math.Exp(-digits), Math.Exp(-digits));
} }
} }
@@ -387,8 +396,8 @@ public class PandasTA : IDisposable
var pta = df.ta.zlma(close: df.close, length: period); var pta = df.ta.zlma(close: df.close, length: period);
for (int i = QL.Length; i > QL.Length-sample; i--) for (int i = QL.Length; i > QL.Length-sample; i--)
{ {
double QL_item = Math.Round(QL[i - 1].v, digits: digits); double QL_item = QL[i - 1].v;
double PanTA_item = Math.Round((double)pta[i - 1], digits: digits); double PanTA_item = (double)pta[i - 1];
Assert.InRange(PanTA_item! - QL_item, -Math.Exp(-digits), Math.Exp(-digits)); Assert.InRange(PanTA_item! - QL_item, -Math.Exp(-digits), Math.Exp(-digits));
} }
} }
@@ -397,11 +406,10 @@ public class PandasTA : IDisposable
var pta = df.ta.zscore(close: df.close, length: period, ddof: 0); var pta = df.ta.zscore(close: df.close, length: period, ddof: 0);
for (int i = QL.Length; i > QL.Length-sample; i--) for (int i = QL.Length; i > QL.Length-sample; i--)
{ {
double QL_item = Math.Round(QL[i - 1].v, digits: digits); double QL_item = QL[i - 1].v;
double PanTA_item = Math.Round((double)pta[i - 1], digits: digits); double PanTA_item = (double)pta[i - 1];
Assert.InRange(PanTA_item! - QL_item, -Math.Exp(-digits), Math.Exp(-digits)); Assert.InRange(PanTA_item! - QL_item, -Math.Exp(-digits), Math.Exp(-digits));
} }
} }
} }
*/
+71 -70
View File
@@ -22,7 +22,7 @@ public class Ta_Lib
bars = new(Bars: 5000, Volatility: 0.8, Drift: 0.0, Precision: 3); bars = new(Bars: 5000, Volatility: 0.8, Drift: 0.0, Precision: 3);
period = rnd.Next(28) + 3; period = rnd.Next(28) + 3;
skip = period+2; skip = period+2;
digits = 10; digits = 9;
TALIB = new double[bars.Count]; TALIB = new double[bars.Count];
TALIB2 = new double[bars.Count]; TALIB2 = new double[bars.Count];
@@ -40,8 +40,8 @@ public class Ta_Lib
Core.Add(inopen, inclose, 0, bars.Count - 1, TALIB, out int outBegIdx, out _); Core.Add(inopen, inclose, 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; i--)
{ {
double QL_item = Math.Round(QL[i].v, digits: digits); double QL_item = QL[i].v;
double TA_item = Math.Round(TALIB[i - outBegIdx], digits: digits); 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), Math.Exp(-digits));
} }
} }
@@ -52,8 +52,8 @@ public class Ta_Lib
Core.Ad(inhigh, inlow, inclose, involume, 0, bars.Count - 1, TALIB, out int outBegIdx, out _); Core.Ad(inhigh, inlow, inclose, involume, 0, bars.Count - 1, TALIB, out int outBegIdx, out _);
for (int i = QL.Length - 1; i > 0; i--) for (int i = QL.Length - 1; i > 0; i--)
{ {
double QL_item = Math.Round(QL[i].v, digits: digits); double QL_item = QL[i].v;
double TA_item = Math.Round(TALIB[i - outBegIdx], digits: digits); 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), Math.Exp(-digits));
} }
} }
@@ -64,8 +64,8 @@ public class Ta_Lib
Core.AdOsc(inhigh, inlow, inclose, involume, 0, bars.Count - 1, TALIB, out int outBegIdx, out _); 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; i--)
{ {
double QL_item = Math.Round(QL[i].v, digits: digits); double QL_item = QL[i].v;
double TA_item = Math.Round(TALIB[i - outBegIdx], digits: digits); 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), Math.Exp(-digits));
} }
} }
@@ -76,11 +76,12 @@ public class Ta_Lib
Core.Atr(inhigh, inlow, inclose, 0, bars.Count - 1, TALIB, out int outBegIdx, out _, period); Core.Atr(inhigh, inlow, inclose, 0, bars.Count - 1, TALIB, out int outBegIdx, out _, period);
for (int i = QL.Length - 1; i > skip; i--) for (int i = QL.Length - 1; i > skip; i--)
{ {
double QL_item = Math.Round(QL[i].v, digits: digits); double QL_item = QL[i].v;
double TA_item = Math.Round(TALIB[i - outBegIdx], digits: digits); 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), Math.Exp(-digits));
} }
} }
[Fact] [Fact]
public void BBANDS() public void BBANDS()
{ {
@@ -109,32 +110,32 @@ public class Ta_Lib
Core.Cci(inhigh, inlow, inclose, 0, bars.Count - 1, TALIB, out int outBegIdx, out _, period); Core.Cci(inhigh, inlow, inclose, 0, bars.Count - 1, TALIB, out int outBegIdx, out _, period);
for (int i = QL.Length - 1; i > skip; i--) for (int i = QL.Length - 1; i > skip; i--)
{ {
double QL_item = Math.Round(QL[i].v, digits: digits); double QL_item = QL[i].v;
double TA_item = Math.Round(TALIB[i - outBegIdx], digits: digits); 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), Math.Exp(-digits));
} }
} }
/* CMO in TA-LIB is not valid
[Fact] [Fact]
public void CMO() { public void CMO() {
CMO_Series QL = new(bars.Close, period, false); CMO_Series QL = new(bars.Close, period, false);
Core.Cmo(inclose, 0, bars.Count - 1, TALIB, out int outBegIdx, out _, period); Core.Cmo(inclose, 0, bars.Count - 1, TALIB, out int outBegIdx, out _, period);
for (int i = QL.Length - 1; i > skip; i--) { for (int i = QL.Length - 1; i > skip; i--) {
double QL_item = Math.Round(QL[i].v, digits: digits); double QL_item = QL[i].v;
double TA_item = Math.Round(TALIB[i - outBegIdx], digits: digits); 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), Math.Exp(-digits));
} }
} }
*/
[Fact] [Fact]
public void CORR() public void CORR()
{ {
CORR_Series QL = new(bars.Open, bars.Close, period); CORR_Series QL = new(bars.Open, bars.Close, period);
Core.Correl(inopen, inclose, 0, bars.Count - 1, TALIB, out int outBegIdx, out _, optInTimePeriod: period); Core.Correl(inopen, inclose, 0, bars.Count - 1, TALIB, out int outBegIdx, out _, optInTimePeriod: period);
for (int i = QL.Length - 1; i > skip; i--) for (int i = QL.Length - 1; i > skip; i--)
{ {
double QL_item = Math.Round(QL[i].v, digits: digits); double QL_item = QL[i].v;
double TA_item = Math.Round(TALIB[i - outBegIdx], digits: digits); 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), Math.Exp(-digits));
} }
} }
@@ -145,8 +146,8 @@ public class Ta_Lib
Core.Dema(inclose, 0, bars.Count - 1, TALIB, out int outBegIdx, out _, period); Core.Dema(inclose, 0, bars.Count - 1, TALIB, out int outBegIdx, out _, period);
for (int i = QL.Length - 1; i > period*10; i--) for (int i = QL.Length - 1; i > period*10; i--)
{ {
double QL_item = Math.Round(QL[i].v, digits: digits); double QL_item = QL[i].v;
double TA_item = Math.Round(TALIB[i - outBegIdx], digits: digits); 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), Math.Exp(-digits));
} }
} }
@@ -157,8 +158,8 @@ public class Ta_Lib
Core.Div(inopen, inclose, 0, bars.Count - 1, TALIB, out int outBegIdx, out _); Core.Div(inopen, inclose, 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; i--)
{ {
double QL_item = Math.Round(QL[i].v, digits: digits); double QL_item = QL[i].v;
double TA_item = Math.Round(TALIB[i - outBegIdx], digits: digits); 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), Math.Exp(-digits));
} }
} }
@@ -169,8 +170,8 @@ public class Ta_Lib
Core.Ema(inclose, 0, bars.Count - 1, TALIB, out int outBegIdx, out _, period); Core.Ema(inclose, 0, bars.Count - 1, TALIB, out int outBegIdx, out _, period);
for (int i = QL.Length - 1; i > skip; i--) for (int i = QL.Length - 1; i > skip; i--)
{ {
double QL_item = Math.Round(QL[i].v, digits: digits); double QL_item = QL[i].v;
double TA_item = Math.Round(TALIB[i - outBegIdx], digits: digits); 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), Math.Exp(-digits));
} }
} }
@@ -181,8 +182,8 @@ public class Ta_Lib
Core.MedPrice(inhigh, inlow, 0, bars.Count - 1, TALIB, out int outBegIdx, out _); Core.MedPrice(inhigh, inlow, 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; i--)
{ {
double QL_item = Math.Round(QL[i].v, digits: digits); double QL_item = QL[i].v;
double TA_item = Math.Round(TALIB[i - outBegIdx], digits: digits); 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), Math.Exp(-digits));
} }
} }
@@ -193,8 +194,8 @@ public class Ta_Lib
Core.TypPrice(inhigh, inlow, inclose, 0, bars.Count - 1, TALIB, out int outBegIdx, out _); Core.TypPrice(inhigh, inlow, inclose, 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; i--)
{ {
double QL_item = Math.Round(QL[i].v, digits: digits); double QL_item = QL[i].v;
double TA_item = Math.Round(TALIB[i - outBegIdx], digits: digits); 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), Math.Exp(-digits));
} }
} }
@@ -205,8 +206,8 @@ public class Ta_Lib
Core.WclPrice(inhigh, inlow, inclose, 0, bars.Count - 1, TALIB, out int outBegIdx, out _); Core.WclPrice(inhigh, inlow, inclose, 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; i--)
{ {
double QL_item = Math.Round(QL[i].v, digits: digits); double QL_item = QL[i].v;
double TA_item = Math.Round(TALIB[i - outBegIdx], digits: digits); 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), Math.Exp(-digits));
} }
} }
@@ -245,8 +246,8 @@ public class Ta_Lib
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); 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 * 15; i--)
{ {
double QL_item = Math.Round(QL[i].v, digits: digits); double QL_item = QL[i].v;
double TA_item = Math.Round(TALIB[i - outBegIdx], digits: digits); 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), Math.Exp(-digits));
} }
} }
@@ -257,8 +258,8 @@ public class Ta_Lib
Core.Max(inclose, 0, bars.Count - 1, TALIB, out int outBegIdx, out _, period); Core.Max(inclose, 0, bars.Count - 1, TALIB, out int outBegIdx, out _, period);
for (int i = QL.Length - 1; i > skip; i--) for (int i = QL.Length - 1; i > skip; i--)
{ {
double QL_item = Math.Round(QL[i].v, digits: digits); double QL_item = QL[i].v;
double TA_item = Math.Round(TALIB[i - outBegIdx], digits: digits); 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), Math.Exp(-digits));
} }
} }
@@ -269,8 +270,8 @@ public class Ta_Lib
Core.MidPoint(inclose, 0, bars.Count - 1, TALIB, out int outBegIdx, out _, period); Core.MidPoint(inclose, 0, bars.Count - 1, TALIB, out int outBegIdx, out _, period);
for (int i = QL.Length - 1; i > skip; i--) for (int i = QL.Length - 1; i > skip; i--)
{ {
double QL_item = Math.Round(QL[i].v, digits: digits); double QL_item = QL[i].v;
double TA_item = Math.Round(TALIB[i - outBegIdx], digits: digits); 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), Math.Exp(-digits));
} }
} }
@@ -281,8 +282,8 @@ public class Ta_Lib
Core.MidPrice(inhigh, inlow, 0, bars.Count - 1, TALIB, out int outBegIdx, out _, period); Core.MidPrice(inhigh, inlow, 0, bars.Count - 1, TALIB, out int outBegIdx, out _, period);
for (int i = QL.Length - 1; i > skip; i--) for (int i = QL.Length - 1; i > skip; i--)
{ {
double QL_item = Math.Round(QL[i].v, digits: digits); double QL_item = QL[i].v;
double TA_item = Math.Round(TALIB[i - outBegIdx], digits: digits); 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), Math.Exp(-digits));
} }
} }
@@ -293,8 +294,8 @@ public class Ta_Lib
Core.Min(inclose, 0, bars.Count - 1, TALIB, out int outBegIdx, out _, period); Core.Min(inclose, 0, bars.Count - 1, TALIB, out int outBegIdx, out _, period);
for (int i = QL.Length - 1; i > skip; i--) for (int i = QL.Length - 1; i > skip; i--)
{ {
double QL_item = Math.Round(QL[i].v, digits: digits); double QL_item = QL[i].v;
double TA_item = Math.Round(TALIB[i - outBegIdx], digits: digits); 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), Math.Exp(-digits));
} }
} }
@@ -305,8 +306,8 @@ public class Ta_Lib
Core.Mult(inopen, inclose, 0, bars.Count - 1, TALIB, out int outBegIdx, out _); Core.Mult(inopen, inclose, 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; i--)
{ {
double QL_item = Math.Round(QL[i].v, digits: digits); double QL_item = QL[i].v;
double TA_item = Math.Round(TALIB[i - outBegIdx], digits: digits); 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), Math.Exp(-digits));
} }
} }
@@ -317,8 +318,8 @@ public class Ta_Lib
Core.Obv(inclose, involume, 0, bars.Count - 1, TALIB, out int outBegIdx, out _); Core.Obv(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; i--)
{ {
double QL_item = Math.Round(QL[i].v, digits: digits); double QL_item = QL[i].v;
double TA_item = Math.Round(TALIB[i - outBegIdx], digits: digits); 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), Math.Exp(-digits));
} }
} }
@@ -329,8 +330,8 @@ public class Ta_Lib
Core.AvgPrice(inopen, inhigh, inlow, inclose, 0, bars.Count - 1, TALIB, out int outBegIdx, out _); Core.AvgPrice(inopen, inhigh, inlow, inclose, 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; i--)
{ {
double QL_item = Math.Round(QL[i].v, digits: digits); double QL_item = QL[i].v;
double TA_item = Math.Round(TALIB[i - outBegIdx], digits: digits); 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), Math.Exp(-digits));
} }
} }
@@ -341,8 +342,8 @@ public class Ta_Lib
Core.Rsi(inclose, 0, bars.Count - 1, TALIB, out int outBegIdx, out _, period); Core.Rsi(inclose, 0, bars.Count - 1, TALIB, out int outBegIdx, out _, period);
for (int i = QL.Length - 1; i > skip; i--) for (int i = QL.Length - 1; i > skip; i--)
{ {
double QL_item = Math.Round(QL[i].v, digits: digits); double QL_item = QL[i].v;
double TA_item = Math.Round(TALIB[i - outBegIdx], digits: digits); 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), Math.Exp(-digits));
} }
} }
@@ -353,8 +354,8 @@ public class Ta_Lib
Core.StdDev(inclose, 0, bars.Count - 1, TALIB, out int outBegIdx, out _, period); Core.StdDev(inclose, 0, bars.Count - 1, TALIB, out int outBegIdx, out _, period);
for (int i = QL.Length - 1; i > skip; i--) for (int i = QL.Length - 1; i > skip; i--)
{ {
double QL_item = Math.Round(QL[i].v, digits: digits); double QL_item = QL[i].v;
double TA_item = Math.Round(TALIB[i - outBegIdx], digits: digits); 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), Math.Exp(-digits));
} }
} }
@@ -365,8 +366,8 @@ public class Ta_Lib
Core.Sma(inclose, 0, bars.Count - 1, TALIB, out int outBegIdx, out _, period); Core.Sma(inclose, 0, bars.Count - 1, TALIB, out int outBegIdx, out _, period);
for (int i = QL.Length - 1; i > skip; i--) for (int i = QL.Length - 1; i > skip; i--)
{ {
double QL_item = Math.Round(QL[i].v, digits: digits); double QL_item = QL[i].v;
double TA_item = Math.Round(TALIB[i - outBegIdx], digits: digits); 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), Math.Exp(-digits));
} }
} }
@@ -377,8 +378,8 @@ public class Ta_Lib
Core.Sub(inopen, inclose, 0, bars.Count - 1, TALIB, out int outBegIdx, out _); Core.Sub(inopen, inclose, 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; i--)
{ {
double QL_item = Math.Round(QL[i].v, digits: digits); double QL_item = QL[i].v;
double TA_item = Math.Round(TALIB[i - outBegIdx], digits: digits); 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), Math.Exp(-digits));
} }
} }
@@ -389,8 +390,8 @@ public class Ta_Lib
Core.Sum(inclose, 0, bars.Count - 1, TALIB, out int outBegIdx, out _, period); Core.Sum(inclose, 0, bars.Count - 1, TALIB, out int outBegIdx, out _, period);
for (int i = QL.Length - 1; i > skip; i--) for (int i = QL.Length - 1; i > skip; i--)
{ {
double QL_item = Math.Round(QL[i].v, digits: digits); double QL_item = QL[i].v;
double TA_item = Math.Round(TALIB[i - outBegIdx], digits: digits); 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), Math.Exp(-digits));
} }
} }
@@ -401,8 +402,8 @@ public class Ta_Lib
Core.T3(inReal: inclose, startIdx: 0, endIdx: bars.Count - 1, outReal: TALIB, outBegIdx: out int outBegIdx, outNbElement: out _, optInTimePeriod: period, optInVFactor: 0.7); Core.T3(inReal: inclose, startIdx: 0, endIdx: bars.Count - 1, outReal: TALIB, outBegIdx: out int outBegIdx, outNbElement: out _, optInTimePeriod: period, optInVFactor: 0.7);
for (int i = QL.Length - 1; i > period*10; i--) for (int i = QL.Length - 1; i > period*10; i--)
{ {
double QL_item = Math.Round(QL[i].v, digits: digits); double QL_item = QL[i].v;
double TA_item = Math.Round(TALIB[i - outBegIdx], digits: digits); 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), Math.Exp(-digits));
} }
} }
@@ -413,8 +414,8 @@ public class Ta_Lib
Core.Tema(inclose, 0, bars.Count - 1, TALIB, out int outBegIdx, out _, period); Core.Tema(inclose, 0, bars.Count - 1, TALIB, out int outBegIdx, out _, period);
for (int i = QL.Length - 1; i > skip * 15; i--) for (int i = QL.Length - 1; i > skip * 15; i--)
{ {
double QL_item = Math.Round(QL[i].v, digits: digits); double QL_item = QL[i].v;
double TA_item = Math.Round(TALIB[i - outBegIdx], digits: digits); 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), Math.Exp(-digits));
} }
} }
@@ -425,8 +426,8 @@ public class Ta_Lib
Core.TRange(inhigh, inlow, inclose, 0, bars.Count - 1, TALIB, out int outBegIdx, out _); Core.TRange(inhigh, inlow, inclose, 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; i--)
{ {
double QL_item = Math.Round(QL[i].v, digits: digits); double QL_item = QL[i].v;
double TA_item = Math.Round(TALIB[i - outBegIdx], digits: digits); 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), Math.Exp(-digits));
} }
} }
@@ -437,8 +438,8 @@ public class Ta_Lib
Core.Trima(inclose, 0, bars.Count - 1, TALIB, out int outBegIdx, out _, period); Core.Trima(inclose, 0, bars.Count - 1, TALIB, out int outBegIdx, out _, period);
for (int i = QL.Length - 1; i > skip; i--) for (int i = QL.Length - 1; i > skip; i--)
{ {
double QL_item = Math.Round(QL[i].v, digits: digits); double QL_item = QL[i].v;
double TA_item = Math.Round(TALIB[i - outBegIdx], digits: digits); 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), Math.Exp(-digits));
} }
} }
@@ -447,8 +448,8 @@ public class Ta_Lib
TRIX_Series QL = new(bars.Close, period, useNaN: false, useSMA: true); TRIX_Series QL = new(bars.Close, period, useNaN: false, useSMA: true);
Core.Trix(inclose, 0, bars.Count - 1, TALIB, out int outBegIdx, out _, period); Core.Trix(inclose, 0, bars.Count - 1, TALIB, out int outBegIdx, out _, period);
for (int i = QL.Length - 1; i > period*10; i--) { for (int i = QL.Length - 1; i > period*10; i--) {
double QL_item = Math.Round(QL[i].v, digits: digits); double QL_item = QL[i].v;
double TA_item = Math.Round(TALIB[i - outBegIdx], digits: digits); 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), Math.Exp(-digits));
} }
} }
@@ -459,8 +460,8 @@ public class Ta_Lib
Core.Var(inclose, 0, bars.Count - 1, TALIB, out int outBegIdx, out _, period); Core.Var(inclose, 0, bars.Count - 1, TALIB, out int outBegIdx, out _, period);
for (int i = QL.Length - 1; i > skip * 15; i--) for (int i = QL.Length - 1; i > skip * 15; i--)
{ {
double QL_item = Math.Round(QL[i].v, digits: digits); double QL_item = QL[i].v;
double TA_item = Math.Round(TALIB[i - outBegIdx], digits: digits); 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), Math.Exp(-digits));
} }
} }
@@ -471,8 +472,8 @@ public class Ta_Lib
Core.Wma(inclose, 0, bars.Count - 1, TALIB, out int outBegIdx, out _, period); Core.Wma(inclose, 0, bars.Count - 1, TALIB, out int outBegIdx, out _, period);
for (int i = QL.Length - 1; i > skip; i--) for (int i = QL.Length - 1; i > skip; i--)
{ {
double QL_item = Math.Round(QL[i].v, digits: digits); double QL_item = QL[i].v;
double TA_item = Math.Round(TALIB[i - outBegIdx], digits: digits); 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), Math.Exp(-digits));
} }
} }
+51 -22
View File
@@ -82,7 +82,8 @@ public class Tulip_Test
ATR_Series QL = new(bars, period, false); ATR_Series QL = new(bars, period, false);
Tulip.Indicators.atr.Run(inputs: arrin, options: new double[] { period }, outputs: arrout); Tulip.Indicators.atr.Run(inputs: arrin, options: new double[] { period }, outputs: arrout);
for (int i = QL.Length - 1; i > skip; i--) //Tulip ATR doesn't use warm-up SMA, compensating with 200 warming bars
for (int i = QL.Length - 1; i > 200+skip; i--)
{ {
double QL_item = QL[i].v; double QL_item = QL[i].v;
double TU_item = arrout[0][i - period + 1]; double TU_item = arrout[0][i - period + 1];
@@ -112,19 +113,21 @@ public class Tulip_Test
Assert.InRange(TU_item! - QL_item, -Math.Exp(-digits), Math.Exp(-digits)); Assert.InRange(TU_item! - QL_item, -Math.Exp(-digits), Math.Exp(-digits));
} }
} }
/*
[Fact] [Fact]
public void CCI() { public void CCI() {
double[][] arrin = { inopen, inhigh, inlow, inclose, involume }; double[][] arrin = { inhigh, inlow, inclose };
double[][] arrout = { outdata }; double[][] arrout = { outdata };
CCI_Series QL = new(bars, period, useNaN: false); CCI_Series QL = new(bars, period, useNaN: false);
Tulip.Indicators.cci.Run(inputs: arrin, options: new double[] { period }, outputs: arrout); Tulip.Indicators.cci.Run(inputs: arrin, options: new double[] { period }, outputs: arrout);
for (int i = QL.Length - 1; i > skip; i--) { for (int i = QL.Length - 1; i > skip; i--) {
double QL_item = QL[i].v; double QL_item = QL[i].v;
double TU_item = arrout[0][i - period-1]; double TU_item = outdata[i - period + 1];
Assert.InRange(TU_item! - QL_item, -Math.Exp(-digits), Math.Exp(-digits)); Assert.Equal(QL_item,TU_item);
//Assert.InRange(TU_item! - QL_item, -Math.Exp(-digits), Math.Exp(-digits));
} }
} }
*/
[Fact] [Fact]
public void CMO() { public void CMO() {
double[][] arrin = { inclose }; double[][] arrin = { inclose };
@@ -138,12 +141,24 @@ public class Tulip_Test
} }
} }
[Fact] [Fact]
public void DECAY() {
double[][] arrin = { inclose };
double[][] arrout = { outdata };
DECAY_Series QL = new(bars.Close, period, useNaN: false);
Tulip.Indicators.decay.Run(inputs: arrin, options: new double[] { period }, outputs: arrout);
for (int i = QL.Length - 1; i > skip + 200; i--) {
double QL_item = QL[i].v;
double TU_item = arrout[0][i];
Assert.InRange(TU_item! - QL_item, -Math.Exp(-digits), Math.Exp(-digits));
}
}
[Fact]
public void DEMA() { public void DEMA() {
double[][] arrin = { inclose }; double[][] arrin = { inclose };
double[][] arrout = { outdata }; double[][] arrout = { outdata };
DEMA_Series QL = new(bars.Close, period, useNaN: false, useSMA: false); DEMA_Series QL = new(bars.Close, period, useNaN: false, useSMA: false);
Tulip.Indicators.dema.Run(inputs: arrin, options: new double[] { period }, outputs: arrout); Tulip.Indicators.dema.Run(inputs: arrin, options: new double[] { period }, outputs: arrout);
for (int i = QL.Length - 1; i > skip*2; i--) { for (int i = QL.Length - 1; i > skip+200; i--) {
double QL_item = QL[i].v; double QL_item = QL[i].v;
double TU_item = arrout[0][i-(period+period-2)]; double TU_item = arrout[0][i-(period+period-2)];
Assert.InRange(TU_item! - QL_item, -Math.Exp(-digits), Math.Exp(-digits)); Assert.InRange(TU_item! - QL_item, -Math.Exp(-digits), Math.Exp(-digits));
@@ -162,6 +177,18 @@ public class Tulip_Test
} }
} }
[Fact] [Fact]
public void EDECAY() {
double[][] arrin = { inclose };
double[][] arrout = { outdata };
DECAY_Series QL = new(bars.Close, period, exponential: true, useNaN: false);
Tulip.Indicators.edecay.Run(inputs: arrin, options: new double[] { period }, outputs: arrout);
for (int i = QL.Length - 1; i > skip + 200; i--) {
double QL_item = QL[i].v;
double TU_item = arrout[0][i];
Assert.InRange(TU_item! - QL_item, -Math.Exp(-digits), Math.Exp(-digits));
}
}
[Fact]
public void EMA() public void EMA()
{ {
double[][] arrin = { inclose }; double[][] arrin = { inclose };
@@ -218,14 +245,15 @@ public class Tulip_Test
[Fact] [Fact]
public void HMA() { public void HMA() {
int p = 10;
double[][] arrin = { inclose }; double[][] arrin = { inclose };
double[][] arrout = { outdata }; double[][] arrout = { outdata };
HMA_Series QL = new(bars.Close, period, false); HMA_Series QL = new(bars.Close, p, false);
Tulip.Indicators.hma.Run(inputs: arrin, options: new double[] { period }, outputs: arrout); Tulip.Indicators.hma.Run(inputs: arrin, options: new double[] { p }, outputs: arrout);
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 QL_item = QL[i].v;
double TU_item = arrout[0][i - period - 1]; double TU_item = arrout[0][i - p - 1];
Assert.InRange(TU_item! - QL_item, -Math.Exp(-digits), Math.Exp(-digits)); Assert.InRange(TU_item! - QL_item, -Math.Exp(-digits-2), Math.Exp(-digits-2));
} }
} }
@@ -313,7 +341,7 @@ public class Tulip_Test
Tulip.Indicators.obv.Run(inputs: arrin, options: new double[] { period }, outputs: arrout); Tulip.Indicators.obv.Run(inputs: arrin, options: new double[] { period }, outputs: arrout);
for (int i = QL.Length - 1; i > skip; i--) { for (int i = QL.Length - 1; i > skip; i--) {
double QL_item = QL[i].v; double QL_item = QL[i].v;
double TU_item = arrout[0][i - period]; double TU_item = arrout[0][i] + arrin[1][0];
Assert.InRange(TU_item! - QL_item, -Math.Exp(-digits), Math.Exp(-digits)); Assert.InRange(TU_item! - QL_item, -Math.Exp(-digits), Math.Exp(-digits));
} }
} }
@@ -424,9 +452,9 @@ public class Tulip_Test
double[][] arrout = { outdata }; double[][] arrout = { outdata };
TEMA_Series QL = new(bars.Close, period, false); TEMA_Series QL = new(bars.Close, period, false);
Tulip.Indicators.tema.Run(inputs: arrin, options: new double[] { period }, outputs: arrout); Tulip.Indicators.tema.Run(inputs: arrin, options: new double[] { period }, outputs: arrout);
for (int i = QL.Length - 1; i > skip; i--) { for (int i = QL.Length - 1; i > skip+200; i--) {
double QL_item = QL[i].v; double QL_item = QL[i].v;
double TU_item = arrout[0][i - period + 1]; double TU_item = arrout[0][i - (period-1)*3];
Assert.InRange(TU_item! - QL_item, -Math.Exp(-digits), Math.Exp(-digits)); Assert.InRange(TU_item! - QL_item, -Math.Exp(-digits), Math.Exp(-digits));
} }
} }
@@ -448,10 +476,10 @@ public class Tulip_Test
double[][] arrout = { outdata }; double[][] arrout = { outdata };
TRIX_Series QL = new(bars.Close, period); TRIX_Series QL = new(bars.Close, period);
Tulip.Indicators.trix.Run(inputs: arrin, options: new double[] { period }, outputs: arrout); Tulip.Indicators.trix.Run(inputs: arrin, options: new double[] { period }, outputs: arrout);
for (int i = QL.Length - 1; i > period*10; i--) { for (int i = QL.Length - 1; i > period+200; i--) {
double QL_item = QL[i].v; double QL_item = QL[i].v;
double TU_item = arrout[0][i - (period*3) + 2]; double TU_item = arrout[0][i - (period*3) + 2];
Assert.InRange(TU_item! - QL_item, -Math.Exp(-digits), Math.Exp(-digits)); Assert.InRange(TU_item! - QL_item, -Math.Exp(-digits+2), Math.Exp(-digits+2));
} }
} }
[Fact] [Fact]
@@ -479,15 +507,16 @@ public class Tulip_Test
} }
} }
[Fact] [Fact]
public void ZLEMA() { public void ZLEMA() {
int p = 4;
double[][] arrin = { inclose }; double[][] arrin = { inclose };
double[][] arrout = { outdata }; double[][] arrout = { outdata };
ZLEMA_Series QL = new(bars.Close, period, false); ZLEMA_Series QL = new(bars.Close, p, false);
Tulip.Indicators.zlema.Run(inputs: arrin, options: new double[] { period }, outputs: arrout); Tulip.Indicators.zlema.Run(inputs: arrin, options: new double[] { p }, outputs: arrout);
for (int i = QL.Length - 1; i > skip; i--) { for (int i = QL.Length - 1; i > skip+20; i--) {
double QL_item = QL[i].v; double QL_item = QL[i].v;
double TU_item = arrout[0][i - period + 1]; double TU_item = outdata[i];
Assert.InRange(TU_item! - QL_item, -Math.Exp(-digits), Math.Exp(-digits)); Assert.InRange(TU_item! - QL_item, -Math.Exp(-digits-2), Math.Exp(-digits-2));
} }
} }
} }
+9 -9
View File
@@ -29,9 +29,9 @@
|BIAS - Bias|`BIAS_Series`|||✔️bias| |BIAS - Bias|`BIAS_Series`|||✔️bias|
|CORR - Pearson's Correlation Coefficient|`CORR_Series`|✔️CORREL|✔️GetCorrelation|| |CORR - Pearson's Correlation Coefficient|`CORR_Series`|✔️CORREL|✔️GetCorrelation||
|COVAR - Covariance|`COVAR_Series`||✔️GetCorrelation|| |COVAR - Covariance|`COVAR_Series`||✔️GetCorrelation||
|DECAY - Linear Decay|||||decay| |DECAY - Linear Decay|`DECAY_Series`|||decay|✔️decay|
|EDECAY - Exponential Decay|||||edecay| |EDECAY - Exponential Decay|`DECAY_Series`|||decay|✔️edecay|
|ENTROPY - Entropy|`ENTROPY_Series`|||✔️entropy| |ENTROPY - Entropy|`ENTROPY_Series`|||entropy||
|KURTOSIS - Kurtosis|`KURT_Series`|||✔️kurtosis| |KURTOSIS - Kurtosis|`KURT_Series`|||✔️kurtosis|
|LINREG - Linear Regression|`LINREG_Series`||✔️GetSlope||✔️linregslope| |LINREG - Linear Regression|`LINREG_Series`||✔️GetSlope||✔️linregslope|
|MAD - Mean Absolute Deviation|`MAD_Series`||✔️GetSmaAnalysis|✔️mad| |MAD - Mean Absolute Deviation|`MAD_Series`||✔️GetSmaAnalysis|✔️mad|
@@ -52,7 +52,7 @@
|||||| ||||||
|AFIRMA - Autoregressive Finite Impulse Response Moving Average||||| |AFIRMA - Autoregressive Finite Impulse Response Moving Average|||||
|ALMA - Arnaud Legoux Moving Average|`ALMA_Series`||✔️GetAlma|alma| |ALMA - Arnaud Legoux Moving Average|`ALMA_Series`||✔️GetAlma|alma|
|DEMA - Double EMA Average|`DEMA_Series`|✔️DEMA|✔️GetDema|✔️dema|dema| |DEMA - Double EMA Average|`DEMA_Series`|✔️DEMA|✔️GetDema|✔️dema|✔️dema|
|DWMA - Double WMA Average|`DWMA_Series`||||| |DWMA - Double WMA Average|`DWMA_Series`|||||
|⭐EMA - Exponential Moving Average|`EMA_Series`|✔️EMA|✔️GetEma|✔️ema|✔️ema| |⭐EMA - Exponential Moving Average|`EMA_Series`|✔️EMA|✔️GetEma|✔️ema|✔️ema|
|EPMA - Endpoint Moving Average|||GetEpma|| |EPMA - Endpoint Moving Average|||GetEpma||
@@ -80,8 +80,8 @@
|SSF - Ehler's Super Smoother Filter||||ssf| |SSF - Ehler's Super Smoother Filter||||ssf|
|SUPERTREND - Supertrend||||supertrend| |SUPERTREND - Supertrend||||supertrend|
|SWMA - Symmetric Weighted Moving Average||||swma| |SWMA - Symmetric Weighted Moving Average||||swma|
|T3 - Tillson T3 Moving Average|`T3_Series`|✔️T3|✔️GetT3|✔️t3| |T3 - Tillson T3 Moving Average|`T3_Series`|✔️T3|✔️GetT3|✔️t3||
|TEMA - Triple EMA Average|`TEMA_Series`|✔️TEMA|✔️GetTema|✔️tema|tema| |TEMA - Triple EMA Average|`TEMA_Series`|✔️TEMA|✔️GetTema|✔️tema|✔️tema|
|⭐TRIMA - Triangular Moving Average|`TRIMA_Series`|✔️TRIMA||✔️trima|✔️trima| |⭐TRIMA - Triangular Moving Average|`TRIMA_Series`|✔️TRIMA||✔️trima|✔️trima|
|TSF - Time Series Forecast||TSF||| |TSF - Time Series Forecast||TSF|||
|VIDYA - Variable Index Dynamic Average||||vidya|vidya| |VIDYA - Variable Index Dynamic Average||||vidya|vidya|
@@ -93,10 +93,10 @@
|||||| ||||||
|⭐ADL - Chaikin Accumulation Distribution Line|`ADL_Series`|✔️AD|✔️GetAdl|✔️ad|✔️ad| |⭐ADL - Chaikin Accumulation Distribution Line|`ADL_Series`|✔️AD|✔️GetAdl|✔️ad|✔️ad|
|⭐ADOSC - Chaikin Accumulation Distribution Oscillator|`ADOSC_Series`|✔️ADOSC||✔️adosc|✔️adosc| |⭐ADOSC - Chaikin Accumulation Distribution Oscillator|`ADOSC_Series`|✔️ADOSC||✔️adosc|✔️adosc|
|ATR - Average True Range|`ATR_Series`|✔️ATR|GetAtr|✔️atr|✔️atr| |ATR - Average True Range|`ATR_Series`|✔️ATR|✔️GetAtr|✔️atr|✔️atr|
|ATRP - Average True Range Percent|`ATRP_Series`||GetAtr|| |ATRP - Average True Range Percent|`ATRP_Series`||✔️GetAtr||
|BETA - Beta coefficient||BETA|GetBeta|| |BETA - Beta coefficient||BETA|GetBeta||
|BBANDS - Bollinger Bands®|`BBANDS_Series`|✔️BBANDS|✔️GetBollingerBands||✔️bbands| |BBANDS - Bollinger Bands®|`BBANDS_Series`|✔️BBANDS|✔️GetBollingerBands|bbands|✔️bbands|
|CHAND - Chandelier Exit|||GetChandelier|| |CHAND - Chandelier Exit|||GetChandelier||
|CRSI - Connor RSI|||GetConnorsRsi|| |CRSI - Connor RSI|||GetConnorsRsi||
|CVI - Chaikins Volatility|||||cvi| |CVI - Chaikins Volatility|||||cvi|