macos dev update

This commit is contained in:
Miha
2024-10-26 23:54:55 -07:00
parent e4f718a365
commit c21b96152c
28 changed files with 458 additions and 345 deletions
+33
View File
@@ -0,0 +1,33 @@
✔️ AFIRMA - Adaptive FIR Moving Average
✔️ ALMA - Arnaud Legoux Moving Average
✔️ DEMA - Double Exponential Moving Average
✔️ DSMA - Dynamic Simple Moving Average
✔️ DWMA - Dynamic Weighted Moving Average
✔️ EMA - Exponential Moving Average
✔️ EPMA - Endpoint Moving Average
✔️ FRAMA - Fractal Adaptive Moving Average
✔️ FWMA - Forward Weighted Moving Average
✔️ GMA - Gaussian Moving Average
✔️ HMA - Hull Moving Average
✔️ HTIT - Hilbert Transform Instantaneous Trendline
✔️ HWMA - Hann Weighted Moving Average
✔️ JMA - Jurik Moving Average
✔️ KAMA - Kaufman Adaptive Moving Average
✔️ LTMA - Linear Time Moving Average
✔️ MAAF - Moving Average Adaptive Filter
✔️ MAMA - MESA Adaptive Moving Average
✔️ MGDI - McGinley Dynamic Indicator
✔️ MMA - Modified Moving Average
✔️ PWMA - Parabolic Weighted Moving Average
✔️ QEMA - Quick Exponential Moving Average
✔️ REMA - Regularized Exponential Moving Average
✔️ RMA - Running Moving Average
✔️ SINEMA - Sine-weighted Moving Average
✔️ SMA - Simple Moving Average
✔️ SMMA - Smoothed Moving Average
✔️ T3 - Triple Exponential Moving Average (T3)
✔️ TEMA - Triple Exponential Moving Average
✔️ TRIMA - Triangular Moving Average
✔️ VIDYA - Variable Index Dynamic Average
✔️ WMA - Weighted Moving Average
✔️ ZLEMA - Zero-Lag Exponential Moving Average
@@ -1,12 +1,12 @@
namespace QuanTAlib;
public class Huberloss : AbstractBase
public class Huber : AbstractBase
{
private readonly CircularBuffer _actualBuffer;
private readonly CircularBuffer _predictedBuffer;
private readonly double _delta;
public Huberloss(int period, double delta = 1.0)
public Huber(int period, double delta = 1.0)
{
if (period < 1)
{
@@ -24,7 +24,7 @@ public class Huberloss : AbstractBase
Init();
}
public Huberloss(object source, int period, double delta = 1.0) : this(period, delta)
public Huber(object source, int period, double delta = 1.0) : this(period, delta)
{
var pubEvent = source.GetType().GetEvent("Pub");
pubEvent?.AddEventHandler(source, new ValueSignal(Sub));
+16
View File
@@ -0,0 +1,16 @@
✔️ HUBER - Huber Loss
✔️ MAE - Mean Absolute Error
✔️ MAPD - Mean Absolute Percentage Deviation
✔️ MAPE - Mean Absolute Percentage Error
✔️ MASE - Mean Absolute Scaled Error
✔️ MDA - Mean Directional Accuracy
✔️ ME - Mean Error
✔️ MPE - Mean Percentage Error
✔️ MSE - Mean Squared Error
✔️ MSLE - Mean Squared Logarithmic Error
✔️ RAE - Relative Absolute Error
✔️ RMSE - Root Mean Squared Error
✔️ RMSLE - Root Mean Squared Logarithmic Error
✔️ RSE - Relative Squared Error
✔️ RSQUARED - R-Squared (Coefficient of Determination)
✔️ SMAPE - Symmetric Mean Absolute Percentage Error
+16
View File
@@ -0,0 +1,16 @@
ADX - Average Directional Movement Index
ADXR - Average Directional Movement Index
APO - Absolute Price Oscillator
DMI - Directional Movement Index
DMX - Jurik Directional Movement Index
DPO - Detrended Price Oscillator
MACD - Moving Average Convergence/Divergence
MOM - Momentum
PMO - Price Momentum Oscillator
PO - Price Oscillator
PPO - Percentage Price Oscillator
PRS - Price Relative Strength
ROC - Rate of Change
TRIX - 1-day ROC of TEMA
VEL - Jurik Signal Velocity
VORTEX - Vortex Indicator
+11 -2
View File
@@ -20,6 +20,17 @@ public class Cmo : AbstractBase
Name = $"CMO({period})";
}
/// <summary>
/// Initializes a new instance of the CMO class with a data source.
/// </summary>
/// <param name="source">The source object that publishes data.</param>
/// <param name="period">The number of data points to consider.</param>
public Cmo(object source, int period) : this(period)
{
var pubEvent = source.GetType().GetEvent("Pub");
pubEvent?.AddEventHandler(source, new ValueSignal(Sub));
}
protected override void ManageState(bool isNew)
{
if (isNew)
@@ -54,7 +65,6 @@ public class Cmo : AbstractBase
{
_sumH.Add(0, Input.IsNew);
_sumL.Add(-diff, Input.IsNew);
}
// Calculate sums for the specified period only
@@ -67,4 +77,3 @@ public class Cmo : AbstractBase
0.0;
}
}
@@ -22,6 +22,17 @@ public class Rsi : AbstractBase
Name = $"RSI({period})";
}
/// <summary>
/// Initializes a new instance of the RSI class with a data source.
/// </summary>
/// <param name="source">The source object that publishes data.</param>
/// <param name="period">The number of data points to consider.</param>
public Rsi(object source, int period) : this(period)
{
var pubEvent = source.GetType().GetEvent("Pub");
pubEvent?.AddEventHandler(source, new ValueSignal(Sub));
}
protected override void ManageState(bool isNew)
{
if (isNew)
@@ -53,10 +64,7 @@ public class Rsi : AbstractBase
_avgLoss.Calc(loss, IsNew: Input.IsNew);
double rsi = (_avgLoss.Value > 0) ? 100 - (100 / (1 + (_avgGain.Value / _avgLoss.Value))) : 100;
return rsi;
}
}
@@ -24,6 +24,19 @@ public class Rsx : AbstractBase
Name = $"RSX({period})";
}
/// <summary>
/// Initializes a new instance of the RSX class with a data source.
/// </summary>
/// <param name="source">The source object that publishes data.</param>
/// <param name="period">The number of data points to consider.</param>
/// <param name="phase">The phase parameter.</param>
/// <param name="factor">The factor parameter.</param>
public Rsx(object source, int period, int phase = 0, double factor = 0.55) : this(period, phase, factor)
{
var pubEvent = source.GetType().GetEvent("Pub");
pubEvent?.AddEventHandler(source, new ValueSignal(Sub));
}
protected override void ManageState(bool isNew)
{
if (isNew)
@@ -58,7 +71,5 @@ public class Rsx : AbstractBase
double rsx = _rsx.Calc(rsi, Input.IsNew);
return rsx;
}
}
+29
View File
@@ -0,0 +1,29 @@
AC - Acceleration Oscillator
AO - Awesome Oscillator
AROON - Aroon oscillator
BOP - Balance of Power
CCI - Commodity Channel Index
CFO - Chande Forcast Oscillator
✔️ CMO - Chande Momentum Oscillator
CHOP - Choppiness Index
COG - Ehler's Center of Gravity
COPPOCK - Coppock Curve
CRSI - Connor RSI
CTI - Ehler's Correlation Trend Indicator
DOSC - Derivative Oscillator
EFI - Elder Ray's Force Index
FISHER - Fisher Transform
FOSC - Forecast Oscillator
GATOR - Williams Alliator Oscillator
KDJ - KDJ Indicator (trend reversal)
KRI - Kairi Relative Index
✔️ RSI - Relative Strength Index
✔️ RSX - Jurik Trend Strength Index
RVGI - Relative Vigor Index
SMI - Stochastic Momentum Index
SRSI - Stochastic RSI
STC - Schaff Trend Cycle
STOCH - Stochastic Oscillator
TSI - True Strength Index
UO - Ultimate Oscillator
WILLR - Larry Williams' %R
+20
View File
@@ -0,0 +1,20 @@
BETA - Beta coefficient
CORR - Correlation Coefficient
✔️ CURVATURE - Rate of Change in Direction or Slope
✔️ ENTROPY - Measure of Uncertainty or Disorder
HUBER - Huber Loss
HURST - Hurst Exponent
✔️ KURTOSIS - Measure of Tails/Peakedness
✔️ MAX - Maximum with exponential decay
✔️ MEDIAN - Middle value
✔️ MIN - Minimum with exponential decay
✔️ MODE - Most Frequent Value
✔️ PERCENTILE - Rank Order
RSQUARED - Coefficient of Determination R-Squared
✔️ SKEW - Skewness, asymmetry of distribution
✔️ SLOPE - Rate of Change, Linear Regression
✔️ STDDEV - Standard Deviation, Measure of Spread
THEIL - Theil's U Statistics
TSF - Time Series Forecast
✔️ VARIANCE - Average of Squared Deviations
✔️ ZSCORE - Standardized Score
@@ -9,7 +9,7 @@ namespace QuanTAlib;
/// both annualized and non-annualized volatility measures. The calculation uses a sample
/// standard deviation formula and assumes 252 trading days in a year for annualization.
/// </remarks>
public class Historical : AbstractBase
public class Hv : AbstractBase
{
private readonly int Period;
private readonly bool IsAnnualized;
@@ -25,7 +25,7 @@ public class Historical : AbstractBase
/// <exception cref="ArgumentOutOfRangeException">
/// Thrown when period is less than 2.
/// </exception>
public Historical(int period, bool isAnnualized = true)
public Hv(int period, bool isAnnualized = true)
{
if (period < 2)
{
@@ -46,7 +46,7 @@ public class Historical : AbstractBase
/// <param name="source">The source object to subscribe to for value updates.</param>
/// <param name="period">The period over which to calculate historical volatility.</param>
/// <param name="isAnnualized">Whether to annualize the volatility (default is true).</param>
public Historical(object source, int period, bool isAnnualized = true) : this(period, isAnnualized)
public Hv(object source, int period, bool isAnnualized = true) : this(period, isAnnualized)
{
var pubEvent = source.GetType().GetEvent("Pub");
pubEvent?.AddEventHandler(source, new ValueSignal(Sub));
@@ -9,7 +9,7 @@ namespace QuanTAlib;
/// both annualized and non-annualized volatility measures. The calculation uses a rolling
/// sum of squared returns for efficiency and assumes 252 trading days in a year for annualization.
/// </remarks>
public class Realized : AbstractBase
public class Rv : AbstractBase
{
private readonly int Period;
private readonly bool IsAnnualized;
@@ -25,7 +25,7 @@ public class Realized : AbstractBase
/// <exception cref="ArgumentOutOfRangeException">
/// Thrown when period is less than 2.
/// </exception>
public Realized(int period, bool isAnnualized = true)
public Rv(int period, bool isAnnualized = true)
{
if (period < 2)
{
@@ -39,6 +39,18 @@ public class Realized : AbstractBase
Init();
}
/// <summary>
/// Initializes a new instance of the Realized class with a data source.
/// </summary>
/// <param name="source">The source object that publishes data.</param>
/// <param name="period">The period over which to calculate realized volatility.</param>
/// <param name="isAnnualized">Whether to annualize the volatility (default is true).</param>
public Rv(object source, int period, bool isAnnualized = true) : this(period, isAnnualized)
{
var pubEvent = source.GetType().GetEvent("Pub");
pubEvent?.AddEventHandler(source, new ValueSignal(Sub));
}
/// <summary>
/// Initializes the Realized instance by clearing buffers and resetting calculation variables.
/// </summary>
@@ -113,4 +125,4 @@ public class Realized : AbstractBase
IsHot = _index >= WarmupPeriod;
return volatility;
}
}
}
+34
View File
@@ -0,0 +1,34 @@
ADR - Average Daily Range
AP - Andrew's Pitchfork
✔️ ATR - Average True Range
ATRP - Average True Range Percent
ATRS - ATR Trailing Stop
BB - Bollinger Bands®
CCV - Close-to-Close Volatility
CE - Chandelier Exit
CV - Conditional Volatility (ARCH/GARCH)
CVI - Chaikin's Volatility
DC - Donchian Channels
FCB - Fractal Chaos Bands
GKV - Garman-Klass Volatility
HLV - High-Low Volatility
✔️ HV - Historical Volatility
ICH - Ichimoku Cloud
✔️ JVOLTY - Jurik Volatility
KC - Keltner Channels
NATR - Normalized Average True Range
PCH - Price Channel Indicator
PSAR - Parabolic Stop and Reverse
PV - Parkinson Volatility
RSV - Rogers-Satchell Volatility
✔️ RV - Realized Volatility
RVI - Relative Volatility Index
STARC - Starc Bands
SV - Stochastic Volatility
TR - True Range
UI - Ulcer Index
VC - Volatility Cone
VOV - Volatility of Volatility
VR - Volatility Ratio
VS - Volatility Stop
YZV - Yang-Zhang Volatility
+18
View File
@@ -0,0 +1,18 @@
ADL - Chaikin Accumulation Distribution Line
ADOSC - Chaikin Accumulation Distribution Oscillator
AOBV - Archer On-Balance Volume
CMF - Chaikin Money Flow
EOM - Ease of Movement
KVO - Klinger Volume Oscillator
MFI - Money Flow Index
NVI - Negative Volume Index
OBV - On-Balance Volume
PVI - Positive Volume Index
PVOL - Price-Volume
PVO - Percentage Volume Oscillator
PVR - Price Volume Rank
PVT - Price Volume Trend
TVI - Trade Volume Index
VP - Volume Profile
VWAP - Volume Weighted Average Price
VWMA - Volume Weighted Moving Average