mirror of
https://github.com/mihakralj/QuanTAlib.git
synced 2026-08-17 01:58:06 +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("Beta Function (BETA)", "BETA", overlay=false)
|
||||
|
||||
//@function Calculates the financial Beta indicator comparing src1 volatility to src2
|
||||
//@doc https://github.com/mihakralj/pinescript/blob/main/indicators/statistics/beta.md
|
||||
//@param src1 series float Series to analyze
|
||||
//@param src2 series float src2 series to compare against
|
||||
//@param period simple int Lookback period for calculation
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
indicator("Bias (BIAS)", "BIAS", overlay=false)
|
||||
|
||||
//@function Calculates the deviation of a signal from its moving average (BIAS).
|
||||
//@doc https://github.com/mihakralj/pinescript/blob/main/indicators/statistics/bias.md
|
||||
//@param src The source series.
|
||||
//@param len The lookback period for the SMA. Must be > 0.
|
||||
//@returns The BIAS value.
|
||||
|
||||
@@ -4,8 +4,6 @@
|
||||
indicator("Cumulative Moving Average", "CMA", overlay=true)
|
||||
|
||||
//@function Calculates Cumulative Moving Average (Running Average / Cumulative Mean)
|
||||
//@doc Calculates the arithmetic mean of ALL data points seen so far.
|
||||
//@doc Uses Welford's algorithm for numerical stability, O(1) per update.
|
||||
//@param source Series to calculate CMA from
|
||||
//@returns CMA value - running mean of all historical values
|
||||
cma(series float source) =>
|
||||
@@ -32,4 +30,4 @@ i_source = input.source(close, "Source")
|
||||
cma_value = cma(i_source)
|
||||
|
||||
// Plot
|
||||
plot(cma_value, "CMA", color=color.yellow, linewidth=2)
|
||||
plot(cma_value, "CMA", color=color.yellow, linewidth=2)
|
||||
|
||||
@@ -86,7 +86,6 @@ correlation(series float src1, series float src2, simple int len) =>
|
||||
na
|
||||
|
||||
//@function Calculates the cointegration of two series using the Engle-Granger method.
|
||||
//@doc https://github.com/mihakralj/pinescript/blob/main/indicators/statistics/cointegration.md
|
||||
//@param series_a series float The first series.
|
||||
//@param series_b series float The second series.
|
||||
//@param period int The lookback period for the regression and ADF test.
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
indicator("Pearson's Correlation (CORRELATION)", "CORRELATION", overlay=false)
|
||||
|
||||
//@function Calculates Pearson correlation coefficient using single pass with circular buffer
|
||||
//@doc https://github.com/mihakralj/pinescript/blob/main/indicators/statistics/correlation.md
|
||||
//@param src1 series float First series to analyze
|
||||
//@param src2 series float Second series to analyze
|
||||
//@param len simple int Lookback period for calculation
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
indicator("Covariance (COVARIANCE)", "COVARIANCE", overlay=false)
|
||||
|
||||
//@function Calculates covariance using single pass with circular buffer
|
||||
//@doc https://github.com/mihakralj/pinescript/blob/main/indicators/statistics/covariance.md
|
||||
//@param src1 series float First series to analyze
|
||||
//@param src2 series float Second series to analyze
|
||||
//@param len simple int Lookback period for calculation
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
indicator("Entropy (ENTROPY)", "ENTROPY", overlay=false)
|
||||
|
||||
//@function Calculate normalized Shannon entropy of a series over a lookback period.
|
||||
//@doc https://github.com/mihakralj/pinescript/blob/main/indicators/statistics/entropy.md
|
||||
//@param source series<float> Input data series. NA values are ignored.
|
||||
//@param length int Lookback period (>= 1).
|
||||
//@returns series<float> Normalized entropy value [0, 1], or na if insufficient data.
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
indicator("Geometric Mean (GEOMEAN)", "GEOMEAN", overlay=true)
|
||||
|
||||
//@function Calculates the Geometric Mean of a series over a lookback period.
|
||||
//@doc https://github.com/mihakralj/pinescript/blob/main/indicators/statistics/geomean.md
|
||||
//@param src series float Input data series (must contain positive values).
|
||||
//@param len simple int Lookback period (must be > 0).
|
||||
//@returns series float The Geometric Mean, or na if data is not suitable (e.g., non-positive values, insufficient data).
|
||||
|
||||
@@ -90,7 +90,6 @@ _covariance(series float src1, series float src2, simple int len, series float m
|
||||
|
||||
|
||||
//@function Calculates Granger Causality F-Statistic for Y ~ X with lag 1.
|
||||
//@doc https://github.com/mihakralj/pinescript/blob/main/indicators/statistics/granger.md
|
||||
//@param y_series series float The series to be predicted (dependent variable).
|
||||
//@param x_series series float The series hypothesized to cause y_series (independent variable).
|
||||
//@param period simple int Lookback period for calculations. Must be greater than 3.
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
indicator("Harmonic Mean (HARMEAN)", "HARMEAN", overlay=false, precision=6)
|
||||
|
||||
//@function Calculates the Harmonic Mean of a series over a lookback period.
|
||||
//@doc https://github.com/mihakralj/pinescript/blob/main/indicators/statistics/harmean.md
|
||||
//@param src series float Input data series (must contain positive values).
|
||||
//@param len simple int Lookback period (must be > 0).
|
||||
//@returns series float The Harmonic Mean, or na if data is not suitable (e.g., non-positive values, insufficient data).
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
indicator("Hurst Exponent (HURST)", "HURST", overlay=false, precision=4)
|
||||
|
||||
//@function Calculates the Hurst Exponent for a given series and lookback period.
|
||||
//@doc https://github.com/mihakralj/pinescript/blob/main/indicators/statistics/hurst.md
|
||||
//@param source series float The input series.
|
||||
//@param length int The lookback period for Hurst Exponent calculation.
|
||||
//@returns series float The Hurst Exponent value.
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
// The MIT License (MIT)
|
||||
// © mihakralj
|
||||
//@version=5
|
||||
//@version=6
|
||||
indicator("Interquartile Range (IQR)", "IQR", overlay=false, precision=4)
|
||||
|
||||
//@function Function to calculate percentile using linear interpolation
|
||||
//@doc https://github.com/mihakralj/pinescript/blob/main/indicators/statistics/iqr.md
|
||||
//@param src Source series for calculation
|
||||
//@param len Lookback period for data collection
|
||||
//@param p Percentile value (0-100)
|
||||
@@ -63,4 +62,4 @@ q3 = iqr(i_source, i_length, 75.0)
|
||||
iqr_value = q3 - q1
|
||||
|
||||
// Plot IQR
|
||||
plot(iqr_value, title="IQR", color=color.new(color.yellow, 0, color=color.yellow, linewidth=2), linewidth=2)
|
||||
plot(iqr_value, title="IQR", color=color.yellow, linewidth=2)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// The MIT License (MIT)
|
||||
// © mihakralj
|
||||
//@version=5
|
||||
//@version=6
|
||||
indicator("Jarque-Bera Test (JB)", "JB", overlay=false, precision=4)
|
||||
|
||||
// Helper function to get a window of series data into an array
|
||||
@@ -23,7 +23,6 @@ _central_moment(float[] arr, int moment_order, float mean_val) =>
|
||||
sum_pow_diff / n
|
||||
|
||||
//@function Calculates the Jarque-Bera statistic.
|
||||
//@doc https://github.com/mihakralj/pinescript/blob/main/indicators/statistics/jb.md
|
||||
//@param source series float The input series.
|
||||
//@param length simple int The lookback period (sample size). Min 10.
|
||||
//@returns series float The Jarque-Bera statistic. Higher values suggest deviation from normality.
|
||||
@@ -70,7 +69,7 @@ i_length = input.int(20, title="Lookback Period (Sample Size)", minval=10, maxva
|
||||
jb_value = jb_stat(i_source, i_length) // Call renamed function
|
||||
|
||||
// Plot
|
||||
plot(jb_value, "Jarque-Bera Statistic", color=color.new(color.teal, 0, color=color.yellow, linewidth=2), linewidth=2)
|
||||
plot(jb_value, "Jarque-Bera Statistic", color=color.teal, linewidth=2)
|
||||
|
||||
// Critical values for Chi-squared distribution with 2 degrees of freedom (approximate):
|
||||
// Significance Level | Critical Value
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
// The MIT License (MIT)
|
||||
// © mihakralj
|
||||
//@version=5
|
||||
//@version=6
|
||||
indicator("Kendall Rank Correlation (KENDALL)", "KENDALL", overlay=false, precision=4)
|
||||
|
||||
//@function Calculates Kendall's Tau-a rank correlation coefficient.
|
||||
//@doc https://github.com/mihakralj/pinescript/blob/main/indicators/statistics/kendall.md
|
||||
//@param source1 series float The first input series.
|
||||
//@param source2 series float The second input series.
|
||||
//@param length int The lookback period. Min 2, Max 60.
|
||||
@@ -59,4 +58,4 @@ i_source2 = request.security(i_source2_ticker, timeframe.period, close, lookahea
|
||||
kendall_value = kendall(i_source1, i_source2, i_period)
|
||||
|
||||
// Plot
|
||||
plot(kendall_value, "Kendall's Tau", color=color.new(color.yellow,0, color=color.yellow, linewidth=2), linewidth=2)
|
||||
plot(kendall_value, "Kendall's Tau", color=color.yellow, linewidth=2)
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
indicator("Kurtosis, tailedness (KURTOSIS)", "KURTOSIS", overlay=false, precision=8)
|
||||
|
||||
//@function Calculates the excess kurtosis of a series over a lookback period.
|
||||
//@doc https://github.com/mihakralj/pinescript/blob/main/indicators/statistics/kurtosis.md
|
||||
//@param src Source series.
|
||||
//@param len Lookback period. Must be greater than 1.
|
||||
//@returns The excess kurtosis value.
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
indicator("Linear Regression (LINREG)", "LINREG", overlay=false, precision=8)
|
||||
|
||||
//@function Calculates linear regression and slope over the specified period
|
||||
//@doc https://github.com/mihakralj/pinescript/blob/main/indicators/statistics/linreg.md
|
||||
//@param src Source series to calculate linear regression from
|
||||
//@param len Lookback period for the calculation
|
||||
//@returns Tuple containing [intercept, slope]
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
indicator("Median", "MEDIAN", overlay=false, precision=8)
|
||||
|
||||
//@function Calculates the median of a series over a lookback period.
|
||||
//@doc https://github.com/mihakralj/pinescript/blob/main/indicators/statistics/median.md
|
||||
//@param src series float Input data series.
|
||||
//@param len simple int Lookback period (must be > 0).
|
||||
//@returns series float The median of the series over the period, or na if insufficient valid data.
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
indicator("Mode", "MODE", overlay=false)
|
||||
|
||||
//@function Calculates the mode (most frequent value) of a series over a lookback period.
|
||||
//@doc https://github.com/mihakralj/pinescript/blob/main/indicators/statistics/mode.md
|
||||
//@param src series float Input data series.
|
||||
//@param len simple int Lookback period (must be > 0).
|
||||
//@returns series float The mode of the series over the period.
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
indicator("Percentile", "PERCENTILE", overlay=true, precision=8)
|
||||
|
||||
//@function Calculates the value at a given percentile for a series over a lookback period.
|
||||
//@doc https://github.com/mihakralj/pinescript/blob/main/indicators/statistics/percentile.md
|
||||
//@param src series float Input data series.
|
||||
//@param len simple int Lookback period (must be > 0).
|
||||
//@param p simple float Percentile to calculate (0-100). For example, 50 for median.
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
// The MIT License (MIT)
|
||||
// © mihakralj
|
||||
|
||||
//@version=6
|
||||
indicator("Quantile (QUANTILE)", shorttitle="QUANTILE", overlay=true, precision=8)
|
||||
|
||||
//@function Calculates the quantile of a series over a lookback period using linear interpolation.
|
||||
//@doc https://github.com/mihakralj/pinescript/blob/main/indicators/statistics/quantile.md
|
||||
//@param src {series float} The source series to calculate the quantile from.
|
||||
//@param len {simple int} The lookback period. Must be greater than 0.
|
||||
//@param q_level {simple float} The quantile level to calculate (between 0.0 and 1.0).
|
||||
|
||||
@@ -6,7 +6,6 @@ indicator("Skewness (SKEW)", "SKEW", overlay=false, precision=6)
|
||||
//@function Calculates the skewness of a source series over a specified period.
|
||||
// Skewness is a measure of the asymmetry of the probability distribution of a real-valued random variable about its mean.
|
||||
// This implementation calculates the population skewness (Fisher-Pearson coefficient g1).
|
||||
//@doc https://github.com/mihakralj/pinescript/blob/main/indicators/statistics/skew.md
|
||||
//@param src The source series.
|
||||
//@param len The lookback period. Must be > 2.
|
||||
//@returns The skewness value.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// The MIT License (MIT)
|
||||
// © mihakralj
|
||||
//@version=5
|
||||
//@version=6
|
||||
indicator("Spearman Rank Correlation (SPEARMAN)", "SPEARMAN", overlay=false, precision=4)
|
||||
|
||||
// @function Calculates ranks for values in an array.
|
||||
@@ -63,7 +63,6 @@ pearson_on_arrays(float[] x_arr, float[] y_arr) =>
|
||||
sum_xy_diff / denominator_sqrt
|
||||
|
||||
//@function Calculates Spearman Rank Correlation Coefficient.
|
||||
//@doc https://github.com/mihakralj/pinescript/blob/main/indicators/statistics/spearman.md
|
||||
//@param source1 series float The first input series.
|
||||
//@param source2 series float The second input series.
|
||||
//@param length simple int The lookback period. Min 2, Max 60.
|
||||
@@ -121,7 +120,7 @@ source2 = request.security(i_source2_ticker, timeframe.period, i_source2_data_ty
|
||||
spearman_value = spearman_corr(i_source1, source2, i_length)
|
||||
|
||||
// Plot
|
||||
plot(spearman_value, "Spearman's Rho", color=color.new(color.orange, 0, color=color.yellow, linewidth=2), linewidth=2)
|
||||
plot(spearman_value, "Spearman's Rho", color=color.orange, linewidth=2)
|
||||
hline(0, "Zero Line", color.gray, linestyle=hline.style_dashed)
|
||||
hline(0.5, "Moderate Positive Correlation", color.green, linestyle=hline.style_dotted)
|
||||
hline(-0.5, "Moderate Negative Correlation", color.red, linestyle=hline.style_dotted)
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
indicator("Standard Deviation (STDDEV)", "STDDEV", overlay=false)
|
||||
|
||||
//@function Calculates the standard deviation using a single pass with a circular buffer.
|
||||
//@doc https://github.com/mihakralj/pinescript/blob/main/indicators/statistics/stddev.md
|
||||
//@param src {series float} Source series.
|
||||
//@param len {int} Lookback length. `len` > 0.
|
||||
//@returns {series float} Standard deviation of `src` for `len` bars back. Returns `na` if not enough data.
|
||||
|
||||
@@ -4,8 +4,6 @@
|
||||
indicator("Rolling Sum", "SUM", overlay=false)
|
||||
|
||||
//@function Calculates Rolling Sum over a period using Kahan-Babuška algorithm
|
||||
//@doc Calculates the sum of the last n values with high numerical precision.
|
||||
//@doc Uses Kahan-Babuška summation for machine-epsilon accuracy.
|
||||
//@param source Series to calculate sum from
|
||||
//@param length Number of bars to sum
|
||||
//@returns Rolling sum of the last 'length' values
|
||||
@@ -56,4 +54,4 @@ sum_value = rolling_sum(i_source, i_length)
|
||||
// sum_builtin = math.sum(i_source, i_length)
|
||||
|
||||
// Plot
|
||||
plot(sum_value, "Sum", color=color.yellow, linewidth=2)
|
||||
plot(sum_value, "Sum", color=color.yellow, linewidth=2)
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
// The MIT License (MIT)
|
||||
// © mihakralj
|
||||
//@version=5
|
||||
//@version=6
|
||||
indicator("Theil Index (THEIL)", "THEIL", overlay=false, precision=6)
|
||||
|
||||
//@function Calculates Theil's T Index for a series over a lookback period.
|
||||
//@doc https://github.com/mihakralj/pinescript/blob/main/indicators/statistics/theil.md
|
||||
//@param src series float Input data series (must be positive values).
|
||||
//@param len simple int Lookback period (must be > 0).
|
||||
//@returns series float The Theil's T Index, or na if data is not suitable.
|
||||
@@ -45,4 +44,4 @@ i_length = input.int(14, title="Lookback Period", minval=1)
|
||||
theil_value = theil_t_index(i_source, i_length)
|
||||
|
||||
// Plot
|
||||
plot(theil_value, "Theil T Index", color=color.new(color.yellow, 0, color=color.yellow, linewidth=2), linewidth=2)
|
||||
plot(theil_value, "Theil T Index", color=color.yellow, linewidth=2)
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
indicator("Variance, Dispersion or Spread (VARIANCE)", "VARIANCE", overlay=false)
|
||||
|
||||
//@function variance
|
||||
//@doc https://github.com/mihakralj/pinescript/blob/main/indicators/statistics/variance.md
|
||||
//@param src {series float} Source series.
|
||||
//@param len {int} Lookback length. `len` > 0.
|
||||
//@returns {series float} Variance of `src` for `len` bars back. Returns 0 if not enough data.
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
indicator("Z-Score (ZSCORE)", "ZSCORE", overlay=false)
|
||||
|
||||
//@function Calculates the Z-Score of a series over a lookback period.
|
||||
//@doc https://github.com/mihakralj/pinescript/blob/main/indicators/statistics/zscore.md
|
||||
//@param src Source series.
|
||||
//@param len Lookback period. Must be greater than 1.
|
||||
//@returns The Z-Score value.
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
indicator("One-Sample t-Test (ZTEST)", "t-TEST", overlay=false)
|
||||
|
||||
//@function Calculates the t-statistic for a one-sample hypothesis test
|
||||
//@doc https://github.com/mihakralj/pinescript/blob/main/indicators/statistics/ztest.md
|
||||
//@param source Source series to test (use returns for meaningful results)
|
||||
//@param period Lookback period for calculating sample mean and standard deviation
|
||||
//@param mu0 Hypothesized population mean to test against
|
||||
|
||||
Reference in New Issue
Block a user