mirror of
https://github.com/mihakralj/QuanTAlib.git
synced 2026-08-17 18:18:04 +00:00
Add documentation links for various volatility indicators and channels
- Updated BBWN, BBWP, CCV, CV, CVI, EWMA, GKV, HLV, HV, Jvolty, JVOLTYN, MASSI, NATR, RSV, RV, RVI, TR, UI, VOV, VR, YZV indicators with documentation links. - Added documentation links for Aberration, Acceleration Bands, Andrews' Pitchfork, Adaptive Price Zone, ATR Bands, Bollinger Bands, Center of Gravity, Donchian Channels, Decay Min-Max Channel, Detrended Synthetic Price, EACP, EBSW, HOMOD, Jurik Volatility Bands, Keltner Channel, MA Envelope, Min-Max Channel, Price Channel, Regression Channels, Standard Deviation Channel, Stoller Average Range Channel, Super Trend Bands, Ultimate Bands, Ultimate Channel, VWAP Bands, and VWAP with Standard Deviation Bands.
This commit is contained in:
@@ -4,7 +4,6 @@
|
||||
indicator("Huber Loss (HUBER)", "HUBER")
|
||||
|
||||
//@function Calculates Huber Loss between two sources using SMA for averaging
|
||||
//@doc https://github.com/mihakralj/pinescript/blob/main/indicators/errors/huber.md
|
||||
//@param source1 First series to compare
|
||||
//@param source2 Second series to compare
|
||||
//@param period Lookback period for error averaging
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
indicator("Log-Cosh Loss", "LogCosh", overlay=false)
|
||||
|
||||
//@function Computes log(cosh(x)) in a numerically stable way
|
||||
//@doc For large |x|, cosh(x) ≈ exp(|x|)/2, so log(cosh(x)) ≈ |x| - log(2)
|
||||
//@param x The input value
|
||||
//@returns log(cosh(x))
|
||||
stable_logcosh(float x) =>
|
||||
@@ -14,9 +13,6 @@ stable_logcosh(float x) =>
|
||||
absX > 20.0 ? absX - LOG2 : math.log(math.cosh(x))
|
||||
|
||||
//@function Calculates Log-Cosh Loss
|
||||
//@doc Smooth approximation to absolute error, twice differentiable everywhere.
|
||||
//@doc Approximates L1 loss for large errors, L2 for small errors.
|
||||
//@doc Less sensitive to outliers than MSE.
|
||||
//@param actual Series of actual values
|
||||
//@param predicted Series of predicted/forecast values
|
||||
//@param length Rolling window for averaging
|
||||
@@ -42,4 +38,4 @@ logcosh_value = logcosh_loss(i_actual, i_predicted, i_length)
|
||||
|
||||
// Plot
|
||||
plot(logcosh_value, "Log-Cosh Loss", color=color.yellow, linewidth=2)
|
||||
hline(0, "Zero", color=color.gray, linestyle=hline.style_dotted)
|
||||
hline(0, "Zero", color=color.gray, linestyle=hline.style_dotted)
|
||||
|
||||
@@ -4,8 +4,6 @@
|
||||
indicator("Mean Arctangent Absolute Percentage Error", "MAAPE", overlay=false, format=format.percent)
|
||||
|
||||
//@function Calculates Mean Arctangent Absolute Percentage Error
|
||||
//@doc Uses arctangent to bound error between 0 and π/2, robust to outliers.
|
||||
//@doc Handles zero actual values gracefully (approaches π/2).
|
||||
//@param actual Series of actual values
|
||||
//@param predicted Series of predicted/forecast values
|
||||
//@param length Rolling window for averaging
|
||||
@@ -35,4 +33,4 @@ maape_value = maape(i_actual, i_predicted, i_length)
|
||||
// Plot
|
||||
plot(maape_value, "MAAPE", color=color.yellow, linewidth=2)
|
||||
hline(0, "Zero", color=color.gray, linestyle=hline.style_dotted)
|
||||
hline(math.pi / 2.0, "Max (π/2)", color=color.red, linestyle=hline.style_dotted)
|
||||
hline(math.pi / 2.0, "Max (π/2)", color=color.red, linestyle=hline.style_dotted)
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
indicator("Mean Absolute Error (MAE)", "MAE")
|
||||
|
||||
//@function Calculates Mean Absolute Error between two sources using SMA for averaging
|
||||
//@doc https://github.com/mihakralj/pinescript/blob/main/indicators/errors/mae.md
|
||||
//@param source1 First series to compare
|
||||
//@param source2 Second series to compare
|
||||
//@param period Lookback period for error averaging
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
indicator("Mean Absolute %Deviation (MAPD)", "MAPD")
|
||||
|
||||
//@function Calculates Mean Absolute Percentage Deviation between two sources using SMA for averaging
|
||||
//@doc https://github.com/mihakralj/pinescript/blob/main/indicators/errors/mapd.md
|
||||
//@param source1 First series to compare
|
||||
//@param source2 Second series to compare
|
||||
//@param period Lookback period for error averaging
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
indicator("Mean Absolute %Error (MAPE)", "MAPE")
|
||||
|
||||
//@function Calculates Mean Absolute Percentage Error between two sources using SMA for averaging
|
||||
//@doc https://github.com/mihakralj/pinescript/blob/main/indicators/errors/mape.md
|
||||
//@param source1 First series to compare (actual)
|
||||
//@param source2 Second series to compare (predicted)
|
||||
//@param period Lookback period for error averaging
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
indicator("Mean Absolute Scaled Error (MASE)", "MASE")
|
||||
|
||||
//@function Calculates Mean Absolute Scaled Error between two sources using SMA for averaging
|
||||
//@doc https://github.com/mihakralj/pinescript/blob/main/indicators/errors/mase.md
|
||||
//@param source1 First series to compare
|
||||
//@param source2 Second series to compare
|
||||
//@param period Lookback period for error averaging
|
||||
|
||||
@@ -4,8 +4,6 @@
|
||||
indicator("Median Absolute Error", "MdAE", overlay=false)
|
||||
|
||||
//@function Calculates Median Absolute Error
|
||||
//@doc Median of absolute errors, robust to outliers (50% breakdown point).
|
||||
//@doc Same units as original data, less sensitive to extreme errors than MAE.
|
||||
//@param actual Series of actual values
|
||||
//@param predicted Series of predicted/forecast values
|
||||
//@param length Rolling window for median calculation
|
||||
@@ -30,4 +28,4 @@ mdae_value = mdae(i_actual, i_predicted, i_length)
|
||||
|
||||
// Plot
|
||||
plot(mdae_value, "MdAE", color=color.yellow, linewidth=2)
|
||||
hline(0, "Zero", color=color.gray, linestyle=hline.style_dotted)
|
||||
hline(0, "Zero", color=color.gray, linestyle=hline.style_dotted)
|
||||
|
||||
@@ -4,8 +4,6 @@
|
||||
indicator("Median Absolute Percentage Error", "MdAPE", overlay=false, format=format.percent)
|
||||
|
||||
//@function Calculates Median Absolute Percentage Error
|
||||
//@doc Median of absolute percentage errors, robust to outliers.
|
||||
//@doc Scale-independent (expressed as percentage), handles zero actual with epsilon.
|
||||
//@param actual Series of actual values
|
||||
//@param predicted Series of predicted/forecast values
|
||||
//@param length Rolling window for median calculation
|
||||
@@ -34,4 +32,4 @@ mdape_value = mdape(i_actual, i_predicted, i_length)
|
||||
|
||||
// Plot
|
||||
plot(mdape_value, "MdAPE", color=color.yellow, linewidth=2)
|
||||
hline(0, "Zero", color=color.gray, linestyle=hline.style_dotted)
|
||||
hline(0, "Zero", color=color.gray, linestyle=hline.style_dotted)
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
indicator("Mean Error (ME)", "ME")
|
||||
|
||||
//@function Calculates Mean Error between two sources using SMA for averaging
|
||||
//@doc https://github.com/mihakralj/pinescript/blob/main/indicators/errors/me.md
|
||||
//@param source1 First series to compare (actual)
|
||||
//@param source2 Second series to compare (predicted)
|
||||
//@param period Lookback period for error averaging
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
indicator("Mean %Error (MPE)", "MPE")
|
||||
|
||||
//@function Calculates Mean Percentage Error between two sources using SMA for averaging
|
||||
//@doc https://github.com/mihakralj/pinescript/blob/main/indicators/errors/mpe.md
|
||||
//@param source1 First series to compare (actual)
|
||||
//@param source2 Second series to compare (predicted)
|
||||
//@param period Lookback period for error averaging
|
||||
|
||||
@@ -4,8 +4,6 @@
|
||||
indicator("Mean Relative Absolute Error", "MRAE", overlay=false)
|
||||
|
||||
//@function Calculates Mean Relative Absolute Error
|
||||
//@doc Average relative absolute error, normalized by actual value.
|
||||
//@doc Similar to MAPE but expressed as ratio (0-1) instead of percentage (0-100%).
|
||||
//@param actual Series of actual values
|
||||
//@param predicted Series of predicted/forecast values
|
||||
//@param length Rolling window for averaging
|
||||
@@ -35,4 +33,4 @@ mrae_value = mrae(i_actual, i_predicted, i_length)
|
||||
// Plot
|
||||
plot(mrae_value, "MRAE", color=color.yellow, linewidth=2)
|
||||
hline(0, "Perfect", color=color.green, linestyle=hline.style_dotted)
|
||||
hline(1, "100% Error", color=color.red, linestyle=hline.style_dotted)
|
||||
hline(1, "100% Error", color=color.red, linestyle=hline.style_dotted)
|
||||
|
||||
@@ -5,7 +5,6 @@ indicator("Mean Squared Error (MSE)", "MSE")
|
||||
|
||||
|
||||
//@function Calculates Mean Squared Error between two sources using SMA for averaging
|
||||
//@doc https://github.com/mihakralj/pinescript/blob/main/indicators/errors/mse.md
|
||||
//@param source1 First series to compare
|
||||
//@param source2 Second series to compare
|
||||
//@param period Lookback period for error averaging
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
indicator("Mean Squared Logarithmic Error (MSLE)", "MSLE")
|
||||
|
||||
//@function Calculates Mean Squared Logarithmic Error between two sources using SMA for averaging
|
||||
//@doc https://github.com/mihakralj/pinescript/blob/main/indicators/errors/msle.md
|
||||
//@param source1 First series to compare (actual)
|
||||
//@param source2 Second series to compare (predicted)
|
||||
//@param period Lookback period for error averaging
|
||||
|
||||
@@ -4,9 +4,6 @@
|
||||
indicator("Pseudo-Huber Loss", "PseudoHuber", overlay=false)
|
||||
|
||||
//@function Calculates Pseudo-Huber Loss (Charbonnier Loss)
|
||||
//@doc Smooth approximation to Huber loss, differentiable everywhere.
|
||||
//@doc Approximates L2 for small errors, L1 for large errors.
|
||||
//@doc δ (delta) controls the transition point between quadratic and linear behavior.
|
||||
//@param actual Series of actual values
|
||||
//@param predicted Series of predicted/forecast values
|
||||
//@param length Rolling window for averaging
|
||||
@@ -38,4 +35,4 @@ pseudohuber_value = pseudohuber(i_actual, i_predicted, i_length, i_delta)
|
||||
|
||||
// Plot
|
||||
plot(pseudohuber_value, "Pseudo-Huber", color=color.yellow, linewidth=2)
|
||||
hline(0, "Zero", color=color.gray, linestyle=hline.style_dotted)
|
||||
hline(0, "Zero", color=color.gray, linestyle=hline.style_dotted)
|
||||
|
||||
@@ -4,8 +4,6 @@
|
||||
indicator("Quantile Loss (Pinball Loss)", "QuantileLoss", overlay=false)
|
||||
|
||||
//@function Calculates Quantile Loss (Pinball Loss)
|
||||
//@doc Used for quantile regression, asymmetrically penalizes over/under-predictions.
|
||||
//@doc q=0.5 gives MAE; q>0.5 penalizes under-prediction more; q<0.5 penalizes over-prediction more.
|
||||
//@param actual Series of actual values
|
||||
//@param predicted Series of predicted/forecast values
|
||||
//@param length Rolling window for averaging
|
||||
@@ -33,4 +31,4 @@ quantile_value = quantile_loss(i_actual, i_predicted, i_length, i_quantile)
|
||||
|
||||
// Plot
|
||||
plot(quantile_value, "Quantile Loss", color=color.yellow, linewidth=2)
|
||||
hline(0, "Zero", color=color.gray, linestyle=hline.style_dotted)
|
||||
hline(0, "Zero", color=color.gray, linestyle=hline.style_dotted)
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
indicator("Relative Absolute Error (RAE)", "RAE")
|
||||
|
||||
//@function Calculates Relative Absolute Error between two sources using SMA for averaging
|
||||
//@doc https://github.com/mihakralj/pinescript/blob/main/indicators/errors/rae.md
|
||||
//@param source1 First series to compare (actual)
|
||||
//@param source2 Second series to compare (predicted)
|
||||
//@param period Lookback period for error averaging
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
indicator("Root Mean Squared Error (RMSE)", "RMSE")
|
||||
|
||||
//@function Calculates Root Mean Squared Error between two sources using SMA for averaging
|
||||
//@doc https://github.com/mihakralj/pinescript/blob/main/indicators/errors/rmse.md
|
||||
//@param source1 First series to compare
|
||||
//@param source2 Second series to compare
|
||||
//@param period Lookback period for error averaging
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
indicator("Root Mean Squared Logarithmic Error (RMSLE)", "RMSLE")
|
||||
|
||||
//@function Calculates Root Mean Squared Logarithmic Error between two sources using SMA for averaging
|
||||
//@doc https://github.com/mihakralj/pinescript/blob/main/indicators/errors/rmsle.md
|
||||
//@param source1 First series to compare (actual)
|
||||
//@param source2 Second series to compare (predicted)
|
||||
//@param period Lookback period for error averaging
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
indicator("Relative Squared Error (RSE)", "RSE")
|
||||
|
||||
//@function Calculates Relative Squared Error between two sources using SMA for averaging
|
||||
//@doc https://github.com/mihakralj/pinescript/blob/main/indicators/errors/rse.md
|
||||
//@param source1 First series to compare (actual)
|
||||
//@param source2 Second series to compare (predicted)
|
||||
//@param period Lookback period for error averaging
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
indicator("R² Coefficient of Determination (RSQUARED)", "RSQUARED")
|
||||
|
||||
//@function Calculates the R-squared (Coefficient of Determination) between two sources
|
||||
//@doc https://github.com/mihakralj/pinescript/blob/main/indicators/errors/rsquared.md
|
||||
//@param source1 First series to compare (actual)
|
||||
//@param source2 Second series to compare (predicted)
|
||||
//@param period Lookback period for averaging
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
indicator("Symmetric Mean Absolute %Error (SMAPE)", "SMAPE")
|
||||
|
||||
//@function Calculates Symmetric Mean Absolute Percentage Error between two sources using SMA for averaging
|
||||
//@doc https://github.com/mihakralj/pinescript/blob/main/indicators/errors/smape.md
|
||||
//@param source1 First series to compare (actual)
|
||||
//@param source2 Second series to compare (predicted)
|
||||
//@param period Lookback period for error averaging
|
||||
|
||||
@@ -4,8 +4,6 @@
|
||||
indicator("Theil's U Statistic", "TheilU", overlay=false)
|
||||
|
||||
//@function Calculates Theil's U Statistic (U1)
|
||||
//@doc Relative forecast accuracy measure, normalized RMSE.
|
||||
//@doc U=0: perfect; U=1: naive forecast; U>1: worse than naive.
|
||||
//@param actual Series of actual values
|
||||
//@param predicted Series of predicted/forecast values
|
||||
//@param length Rolling window for calculation
|
||||
@@ -42,4 +40,4 @@ theilu_value = theil_u(i_actual, i_predicted, i_length)
|
||||
// Plot
|
||||
plot(theilu_value, "Theil's U", color=color.yellow, linewidth=2)
|
||||
hline(0, "Perfect", color=color.green, linestyle=hline.style_dotted)
|
||||
hline(1, "Naive", color=color.red, linestyle=hline.style_dotted)
|
||||
hline(1, "Naive", color=color.red, linestyle=hline.style_dotted)
|
||||
|
||||
@@ -4,9 +4,6 @@
|
||||
indicator("Tukey's Biweight Loss", "TukeyBiweight", overlay=false)
|
||||
|
||||
//@function Calculates Tukey's Biweight (Bisquare) Loss
|
||||
//@doc Robust loss that completely rejects outliers beyond threshold c.
|
||||
//@doc ρ(x) = (c²/6) * (1 - (1 - (x/c)²)³) for |x| ≤ c; ρ(x) = c²/6 for |x| > c
|
||||
//@doc Common c values: 4.685 (95% efficiency), 6.0 (more permissive)
|
||||
//@param actual Series of actual values
|
||||
//@param predicted Series of predicted/forecast values
|
||||
//@param length Rolling window for averaging
|
||||
@@ -46,4 +43,4 @@ tukey_value = tukey_biweight(i_actual, i_predicted, i_length, i_c)
|
||||
|
||||
// Plot
|
||||
plot(tukey_value, "Tukey Biweight", color=color.yellow, linewidth=2)
|
||||
hline(0, "Zero", color=color.gray, linestyle=hline.style_dotted)
|
||||
hline(0, "Zero", color=color.gray, linestyle=hline.style_dotted)
|
||||
|
||||
@@ -4,9 +4,6 @@
|
||||
indicator("Weighted Mean Absolute Percentage Error", "WMAPE", overlay=false, format=format.percent)
|
||||
|
||||
//@function Calculates Weighted Mean Absolute Percentage Error
|
||||
//@doc Weights errors by actual value magnitude, industry standard for demand forecasting.
|
||||
//@doc WMAPE = (Σ|actual - predicted| / Σ|actual|) * 100
|
||||
//@doc More stable than MAPE for intermittent data with zero/low values.
|
||||
//@param actual Series of actual values
|
||||
//@param predicted Series of predicted/forecast values
|
||||
//@param length Rolling window for calculation
|
||||
@@ -38,4 +35,4 @@ wmape_value = wmape(i_actual, i_predicted, i_length)
|
||||
|
||||
// Plot
|
||||
plot(wmape_value, "WMAPE", color=color.yellow, linewidth=2)
|
||||
hline(0, "Perfect", color=color.green, linestyle=hline.style_dotted)
|
||||
hline(0, "Perfect", color=color.green, linestyle=hline.style_dotted)
|
||||
|
||||
@@ -4,9 +4,6 @@
|
||||
indicator("Weighted Root Mean Squared Error", "WRMSE", overlay=false)
|
||||
|
||||
//@function Calculates Weighted Root Mean Squared Error
|
||||
//@doc WRMSE extends RMSE by weighting each error differently.
|
||||
//@doc WRMSE = √(Σ(w * (actual - predicted)²) / Σ(w))
|
||||
//@doc Reduces to RMSE when all weights are equal.
|
||||
//@param actual Series of actual values
|
||||
//@param predicted Series of predicted/forecast values
|
||||
//@param weight Series of weights for each observation
|
||||
@@ -50,4 +47,4 @@ wrmse_value = wrmse(i_actual, i_predicted, weight, i_length)
|
||||
|
||||
// Plot
|
||||
plot(wrmse_value, "WRMSE", color=color.yellow, linewidth=2)
|
||||
hline(0, "Perfect", color=color.green, linestyle=hline.style_dotted)
|
||||
hline(0, "Perfect", color=color.green, linestyle=hline.style_dotted)
|
||||
|
||||
Reference in New Issue
Block a user