Keltner Channel Bands Great indicator for mean reversion strategies. Alerts you can set: Crossover EMA Crossunder EMA Crossover upper band Crossunder upper band Crossover lower band Crossunder lower band Have fun!
This script tells you the percentage of time an instrument's closing value is above and below a level of your choosing. The background color visually indicates periods where the instrument closed at or above the level (red) and below it (blue). For "stationary-ish" processes, you can get a loose feel for the mean, high, and low values. The historical information...
Tradingview Community, As I progress through my journey, I have come to the realization that it is time to give back. This script isn't a life changer, but it has the building blocks for a motivated individual to optimize the parameters and have a production script ready to go. Credit for the indicator is due to @rumpypumpydumpy I adapted this indicator to a...
Library "Moments" Based on Moments (Mean,Variance,Skewness,Kurtosis) . Rewritten for Pinescript v5. logReturns(src) Calculates log returns of a series (e.g log percentage change) Parameters: src : Source to use for the returns calculation (e.g. close). Returns: Log percentage returns of a series mean(src, length) Calculates the mean of a...
The augmented Dickey-Fuller test (ADF) is a statistical test for the tendency of a price series sample to mean revert . The current price of a mean-reverting series may tell us something about the next move (as opposed, for example, to a geometric Brownian motion). Thus, the ADF test allows us to spot market inefficiencies and potentially exploit this...
When you think of the question "take the mean of this dataset", you'd normally think of using the arithmetic mean because usually the norm is equal to 1; however, there are an infinite number of other types of means depending on the function norm (p). Pythagoras' is credited for the main types of means: his harmonic mean, his geometric mean, and his arithmetic...
This Indicator shows the Absolute Rate of Change in correlation to its Moving Average. Values over 3 (gray dotted line) can savely be considered as a breakout; values over 4.5 got a high mean-reverting chance (red dotted line). This Indicator can be used in all timeframes, however, i recommend to use it <30m, when you want search for meaningful Mean-Reverting...
Inspired by the Brownian Motion ("BM") model that could be applied to conducting Monte Carlo Simulations, this indicator plots out the Drift factor contributing to BM. Interpretation : If the Drift value is positive, then prices are possibly moving in an uptrend. Vice versa for negative drifts.
Some functions to handle Arithmetic Geometric Mean.
Purple means the concavity is down blue means concavity is up which is good. Yellow means increasing, Red means decreasing. Sup = Green Res = Red
Shows the coefficient of variation defined as standard deviation over mean (for the specified window).
This very simple strategy is an implementation of PJ Sutherlands' Jaws Mean reversion algorithm. It simply buys when a small moving average period (e.g. 2) is below a longer moving average period (e.g. 5) by a certain percentage and closes when the small period average crosses over the longer moving average. If you are going to use this, you may wish to apply...
My first try to implement Full Hurst Exponent. The Hurst exponent is used as a measure of long-term memory of time series. It relates to the autocorrelations of the time series and the rate at which these decrease as the lag between pairs of values increases The Hurst exponent is referred to as the "index of dependence" or "index of long-range dependence". It...
This is a simplified version of the Hurst Exponent indicator. In the meantime, I'm working on the full version. It's computationally intensive, so it's a challenge to squeeze it to PineScript limits. It will require some time to optimize it, so I decided to publish a simplified version for now. The Hurst exponent is used as a measure of long-term memory of time...
In this study, I present a method to expose NaN values to development environment. This exposure allows NaN values to be used by methods in scripts. I also show how to use values, even NaN values, as anchors from...
A simple script that shows the distance from a the mean, expressed as a percentage. Simple Moving Average, in this case. Informational only.
The following script is an application of the Z-Score (previous script). Z-Scores can be used in place of standard deviation (sigma) in 'Bollinger Bands'. The average of the sample (x-bar) over 21 days (N) 21 average trading days per month, fixed value The average of the population (mu) over 63 days (n) 63 days per quarter, default is set to 63 Z-Score...