Update file paths for QuanTAlib packages in main_automation.yml

This commit is contained in:
Miha Kralj
2023-04-12 13:10:00 -07:00
parent badea98dc0
commit b99d451ea8
22 changed files with 403 additions and 253 deletions
+1 -1
View File
@@ -14,7 +14,7 @@ Sources:
https://phemex.com/academy/what-is-arnaud-legoux-moving-averages
https://www.prorealcode.com/prorealtime-indicators/alma-arnaud-legoux-moving-average/
TODO: Discrepancy with Pandas-TA (but passes the validation with Skender.GetAlma)
Discrepancy with Pandas-TA (but passes the validation with Skender.GetAlma)
</summary> */
+3 -3
View File
@@ -41,7 +41,7 @@ public class DEMA_Series : Single_TSeries_Indicator
_lastsum = _lastlastsum;
_lastema1 = _lastlastema1;
_lastema2 = _lastlastema2;
}
}
else {
_lastlastsum = _lastsum;
_lastlastema1 = _lastema1;
@@ -67,8 +67,8 @@ public class DEMA_Series : Single_TSeries_Indicator
}
_dema = 2*_ema1 - _ema2;
_lastema1 = _ema1;
_lastema2 = _ema2;
_lastema1 = Double.IsNaN(_ema1)?_lastema1:_ema1;
_lastema2 = Double.IsNaN(_ema2)?_lastema2:_ema2;
base.Add((TValue.t, _dema), update, _NaN);
}
+5 -7
View File
@@ -9,24 +9,22 @@ DWMA: Double Weighted Moving Average
</summary> */
public class DWMA_Series : Single_TSeries_Indicator {
private readonly System.Collections.Generic.List<double> _buffer1 = new();
private readonly System.Collections.Generic.List<double> _weights = new();
public DWMA_Series(TSeries source, int period, bool useNaN = false) : base(source, period, useNaN) {
for (int i = 0; i < this._p; i++) {
double _weight = (i + 1) * (i + 1);
this._weights.Add(_weight);
}
if (base._data.Count > 0) { base.Add(base._data); }
}
private readonly System.Collections.Generic.List<double> _buffer1 = new();
private readonly System.Collections.Generic.List<double> _weights = new();
public override void Add((System.DateTime t, double v) TValue, bool update) {
Add_Replace_Trim(_buffer1, TValue.v, _p, update);
double _wma1 = 0;
double _wsum = 0;
double _wma1 = 0, _wsum = 0;
for (int i = 0; i < _buffer1.Count; i++) {
_wma1 += _buffer1[i] * this._weights[i];
_wsum += this._weights[i];
_wma1 += _buffer1[i] * _weights[i];
_wsum += _weights[i];
}
_wma1 /= _wsum;
+1 -1
View File
@@ -60,7 +60,7 @@ public class EMA_Series : Single_TSeries_Indicator {
else {
_ema = _k * (TValue.v - _lastema) + _lastema;
}
_lastema = _ema;
_lastema = Double.IsNaN(_ema)?_lastema:_ema;
base.Add((TValue.t, _ema), update, _NaN);
}
+4 -2
View File
@@ -27,13 +27,14 @@ public class JMA_Series : Single_TSeries_Indicator {
public TSeries mma1 { get; }
public TSeries mma2 { get; }
private double upperBand, lowerBand, vsum, Kv, del1, del2;
private double upperBand, lowerBand, vsum, Kv;
private double prev_ma1, prev_det0, prev_det1, prev_vsum, prev_jma;
private double p_upperBand, p_lowerBand, p_Kv, p_prev_ma1, p_prev_det0, p_prev_det1, p_prev_vsum, p_prev_jma;
private readonly int _voltyS, _voltyL;
public JMA_Series(TSeries source, int period, double phase = 0.0, int vshort = 10, int vlong = 65, bool useNaN = false) : base(source, period, useNaN) {
upperBand = lowerBand = prev_ma1 = prev_det0 = prev_det1 = prev_vsum = prev_jma = Kv = del1 = del2 = 0.0;
upperBand = lowerBand = prev_ma1 = prev_det0 = prev_det1 = prev_vsum = prev_jma = Kv = 0.0;
Kv = 0;
pr = (phase * 0.01) + 1.5;
@@ -48,6 +49,7 @@ public class JMA_Series : Single_TSeries_Indicator {
}
public override void Add((System.DateTime t, double v) TValue, bool update) {
double del1 = 0.0, del2 = 0.0;
if (this.Count == 0) { prev_ma1 = prev_jma = TValue.v; }
if (update) {
upperBand = p_upperBand;
+1 -1
View File
@@ -33,7 +33,7 @@ public class MAMA_Series : Single_TSeries_Indicator
public override void Add((System.DateTime t, double v) TValue, bool update)
{
if (!update) {
// roll forward (oldx = x)
pr.io = pr.i6; pr.i6 = pr.i5; pr.i5 = pr.i4; pr.i4 = pr.i3; pr.i3 = pr.i2; pr.i2 = pr.i1; pr.i1 = pr.i;
+1 -11
View File
@@ -13,16 +13,6 @@ Sources:
https://technicalindicators.net/indicators-technical-analysis/150-t3-moving-average
http://www.binarytribune.com/forex-trading-indicators/t3-moving-average-indicator/
Calculation:
Volume Factor is typically 0.7 (but also 0.618);
Ema1 = Ema (Close);
Ema2 = Ema (Ema1);
Ema3 = Ema (Ema2);
Ema4 = Ema (Ema3);
Ema5 = Ema (Ema4);
Ema6 = Ema (Ema5);
T3 = (a*a*a) * Ema6 + (3*a*a + 3*a*a*a) * Ema5 + (6*a*a 3*a 3*a*a*a) * Ema4 + (1 + 3*a + a*a*a + 3*a*a) * Ema3
</summary> */
public class T3_Series : Single_TSeries_Indicator {
private readonly double _k, _k1m, _c1, _c2, _c3, _c4;
@@ -35,7 +25,7 @@ public class T3_Series : Single_TSeries_Indicator {
private double _lastema1, _lastema2, _lastema3, _lastema4, _lastema5, _lastema6;
private double _llastema1, _llastema2, _llastema3, _llastema4, _llastema5, _llastema6;
private bool _useSMA;
private readonly bool _useSMA;
public T3_Series(TSeries source, int period, double vfactor = 0.7, bool useNaN = false, bool useSMA = true) : base(source, period, useNaN) {
double _a = vfactor; //0.7; //0.618
+1 -8
View File
@@ -9,13 +9,6 @@ TRIX: Triple Exponential Average
has become a popular technical analysis tool to aid chartists in spotting diversions
and directional cues in stock trading patterns.
Calculation:
Ema1 = Ema (Close);
Ema2 = Ema (Ema1);
Ema3 = Ema (Ema2);
TRIX = (Ema3-Ema3[1]) / Ema3[1]
Sources:
https://www.investopedia.com/terms/t/trix.asp
@@ -29,7 +22,7 @@ public class TRIX_Series : Single_TSeries_Indicator
private double _lastema1, _lastema2, _lastema3;
private double _llastema1, _llastema2, _llastema3;
private bool _useSMA;
private readonly bool _useSMA;
public TRIX_Series(TSeries source, int period, bool useNaN = false, bool useSMA = true) : base(source, period, useNaN)
{