Volume and Price Z-Score [Multi-Asset] - By LeviathanThis script offers in-depth Z-Score analytics on price and volume for 200 symbols. Utilizing visualizations such as scatter plots, histograms, and heatmaps, it enables traders to uncover potential trade opportunities, discern market dynamics, pinpoint outliers, delve into the relationship between price and volume, and much more.
A Z-Score is a statistical measurement indicating the number of standard deviations a data point deviates from the dataset's mean. Essentially, it provides insight into a value's relative position within a group of values (mean).
- A Z-Score of zero means the data point is exactly at the mean.
- A positive Z-Score indicates the data point is above the mean.
- A negative Z-Score indicates the data point is below the mean.
For instance, a Z-Score of 1 indicates that the data point is 1 standard deviation above the mean, while a Z-Score of -1 indicates that the data point is 1 standard deviation below the mean. In simple terms, the more extreme the Z-Score of a data point, the more “unusual” it is within a larger context.
If data is normally distributed, the following properties can be observed:
- About 68% of the data will lie within ±1 standard deviation (z-score between -1 and 1).
- About 95% will lie within ±2 standard deviations (z-score between -2 and 2).
- About 99.7% will lie within ±3 standard deviations (z-score between -3 and 3).
Datasets like price and volume (in this context) are most often not normally distributed. While the interpretation in terms of percentage of data lying within certain ranges of z-scores (like the ones mentioned above) won't hold, the z-score can still be a useful measure of how "unusual" a data point is relative to the mean.
The aim of this indicator is to offer a unique way of screening the market for trading opportunities by conveniently visualizing where current volume and price activity stands in relation to the average. It also offers features to observe the convergent/divergent relationships between asset’s price movement and volume, observe a single symbol’s activity compared to the wider market activity and much more.
Here is an overview of a few important settings.
Z-SCORE TYPE
◽️ Z-Score Type: Current Z-Score
Calculates the z-score by comparing current bar’s price and volume data to the mean (moving average with any custom length, default is 20 bars). This indicates how much the current bar’s price and volume data deviates from the average over the specified period. A positive z-score suggests that the current bar's price or volume is above the mean of the last 20 bars (or the custom length set by the user), while a negative z-score means it's below that mean.
Example: Consider an asset whose current price and volume both show deviations from their 20-bar averages. If the price's Z-Score is +1.5 and the volume's Z-Score is +2.0, it means the asset's price is 1.5 standard deviations above its average, and its trading volume is 2 standard deviations above its average. This might suggest a significant upward move with strong trading activity.
◽️ Z-Score Type: Average Z-Score
Calculates the custom-length average of symbol's z-score. Think of it as a smoothed version of the Current Z-Score. Instead of just looking at the z-score calculated on the latest bar, it considers the average behavior over the last few bars. By doing this, it helps reduce sudden jumps and gives a clearer, steadier view of the market.
Example: Instead of a single bar, imagine the average price and volume of an asset over the last 5 bars. If the price's 5-bar average Z-Score is +1.0 and the volume's is +1.5, it tells us that, over these recent bars, both the price and volume have been consistently above their longer-term averages, indicating sustained increase.
◽️ Z-Score Type: Relative Z-Score
Calculates a relative z-score by comparing symbol’s current bar z-score to the mean (average z-score of all symbols in the group). This is essentially a z-score of a z-score, and it helps in understanding how a particular symbol's activity stands out not just in its own historical context, but also in relation to the broader set of symbols being analyzed. In other words, while the primary z-score tells you how unusual a bar's activity is for that specific symbol, the relative z-score informs you how that "unusualness" ranks when compared to the entire group's deviations. This can be particularly useful in identifying symbols that are outliers even among outliers, indicating exceptionally unique behaviors or opportunities.
Example: If one asset's price Z-Score is +2.5 and volume Z-Score is +3.0, but the group's average Z-Scores are +0.5 for price and +1.0 for volume, this asset’s Relative Z-Score would be high and therefore stand out. This means that asset's price and volume activities are notably high, not just by its own standards, but also when compared to other symbols in the group.
DISPLAY TYPE
◽️ Display Type: Scatter Plot
The Scatter Plot is a visual tool designed to represent values for two variables, in this case the Z-Scores of price and volume for multiple symbols. Each symbol has it's own dot with x and y coordinates:
X-Axis: Represents the Z-Score of price. A symbol further to the right indicates a higher positive deviation in its price from its average, while a symbol to the left indicates a negative deviation.
Y-Axis: Represents the Z-Score of volume. A symbol positioned higher up on the plot suggests a higher positive deviation in its trading volume from its average, while one lower down indicates a negative deviation.
Here are some guideline insights of plot positioning:
- Top-Right Quadrant (High Volume-High Price): Symbols in this quadrant indicate a scenario where both the trading volume and price are higher than their respective mean.
- Top-Left Quadrant (High Volume-Low Price): Symbols here reflect high trading volumes but prices lower than the mean.
- Bottom-Left Quadrant (Low Volume-Low Price): Assets in this quadrant have both low trading volume and price compared to their mean.
- Bottom-Right Quadrant (Low Volume-High Price): Symbols positioned here have prices that are higher than their mean, but the trading volume is low compared to the mean.
The plot also integrates a set of concentric squares which serve as visual guides:
- 1st Square (1SD): Encapsulates symbols that have Z-Scores within ±1 standard deviation for both price and volume. Symbols within this square are typically considered to be displaying normal behavior or within expected range.
- 2nd Square (2SD): Encapsulates those with Z-Scores within ±2 standard deviations. Symbols within this boundary, but outside the 1 SD square, indicate a moderate deviation from the norm.
- 3rd Square (3SD): Represents symbols with Z-Scores within ±3 standard deviations. Any symbol outside this square is deemed to be a significant outlier, exhibiting extreme behavior in terms of either its price, its volume, or both.
By assessing the position of symbols relative to these squares, traders can swiftly identify which assets are behaving typically and which are showing unusual activity. This visualization simplifies the process of spotting potential outliers or unique trading opportunities within the market. The farther a symbol is from the center, the more it deviates from its typical behavior.
◽️ Display Type: Columns
In this visualization, z-scores are represented using columns, where each symbol is presented horizontally. Each symbol has two distinct nodes:
- Left Node: Represents the z-score of volume.
- Right Node: Represents the z-score of price.
The height of these nodes can vary along the y-axis between -4 and 4, based on the z-score value:
- Large Positive Columns: Signify a high or positive z-score, indicating that the price or volume is significantly above its average.
- Large Negative Columns: Represent a low or negative z-score, suggesting that the price or volume is considerably below its average.
- Short Columns Near 0: Indicate that the price or volume is close to its mean, showcasing minimal deviation.
This columnar representation provides a clear, intuitive view of how each symbol's price and volume deviate from their respective averages.
◽️ Display Type: Circles
In this visualization style, z-scores are depicted using circles. Each symbol is horizontally aligned and represented by:
- Solid Circle: Represents the z-score of price.
- Transparent Circle: Represents the z-score of volume.
The vertical position of these circles on the y-axis ranges between -4 and 4, reflecting the z-score value:
- Circles Near the Top: Indicate a high or positive z-score, suggesting the price or volume is well above its average.
- Circles Near the Bottom: Represent a low or negative z-score, pointing to the price or volume being notably below its average.
- Circles Around the Midline (0): Highlight that the price or volume is close to its mean, with minimal deviation.
◽️ Display Type: Delta Columns
There's also an option to utilize Z-Score Delta Columns. For each symbol, a single column is presented, depicting the difference between the z-score of price and the z-score of volume.
The z-score delta essentially captures the disparity between how much the price and volume deviate from their respective mean:
- Positive Delta: Indicates that the z-score of price is greater than the z-score of volume. This suggests that the price has deviated more from its average than the volume has from its own average. Such a scenario could point to price movements being more significant or pronounced compared to the changes in volume.
- Negative Delta: Represents that the z-score of volume is higher than the z-score of price. This might mean that there are substantial volume changes, yet the price hasn't moved as dramatically. This can be indicative of potential build-up in trading interest without an equivalent impact on price.
- Delta Close to 0: Means that the z-scores for price and volume are almost equal, indicating their deviations from the average are in sync.
◽️ Display Type: Z-Volume/Z-Price Heatmap
This visualization offers a heatmap either for volume z-scores or price z-scores across all symbols. Here's how it's presented:
Each symbol is allocated its own horizontal row. Within this row, bar-by-bar data is displayed using a color gradient to represent the z-score values. The heatmap employs a user-defined gradient scale, where a chosen "cold" color represents low z-scores and a chosen "hot" color signifies high z-scores. As the z-score increases or decreases, the colors transition smoothly along this gradient, providing an intuitive visual indication of the z-score's magnitude.
- Cold Colors: Indicate values significantly below the mean (negative z-score)
- Mild Colors: Represent values close to the mean, suggesting minimal deviation.
- Hot Colors: Indicate values significantly above the mean (positive z-score)
This heatmap format provides a rapid, visually impactful means to discern how each symbol's price or volume is behaving relative to its average. The color-coded rows allow you to quickly spot outliers.
VOLUME TYPE
The "Volume Type" input allows you to choose the nature of volume data that will be factored into the volume z-score calculation. The interpretation of indicator’s data changes based on this input. You can opt between:
- Volume (Regular Volume): This is the classic measure of trading volume, which represents the volume traded in a given time period - bar.
- OBV (On-Balance Volume): OBV is a momentum indicator that accumulates volume on up bars and subtracts it on down bars, making it a cumulative indicator that sort of measures buying and selling pressure.
Interpretation Implications:
- For Volume Type: Regular Volume:
Positive Z-Score: Indicates that the trading volume is above its average, meaning there's unusually high trading activity .
Negative Z-Score: Suggests that the trading volume is below its average, signifying unusually low trading activity.
- For Volume Type: OBV:
Positive Z-Score: Signifies that “buying pressure” is above its average.
Negative Z-Score: Signifies that “selling pressure” is above its average.
When comparing Z-Score of OBV to Z-Score of price, we can observe several scenarios. If Z-Price and Z-Volume are convergent (have similar z-scores), we can say that the directional price movement is supported by volume. If Z-Price and Z-Volume are divergent (have very different z-scores or one of them being zero), it suggests a potential misalignment between price movement and volume support, which might hint at possible reversals or weakness.
Meanreversion
Stablecoin Supply Ratio Oscillator
The Stablecoin Supply Ratio Oscillator (SSRO) is a cryptocurrency indicator designed for mean reversion analysis and sentiment assessment. It calculates the ratio of CRYPTO:BTCUSD 's market capitalization to the sum of stablecoins' market capitalization and z-scores the result, offering insights into market sentiment and potential turning points.
Methodology:
The SSRO is calculated as follows-
method ssro(float src, array stblsrc, int len) =>
float ssr = src / stblsrc.sum() // Source of the underlying divided by the sum of stablecoin sources
(ssr - ta.sma(ssr, len)) / ta.stdev(ssr, len) // Z-Score Transformed
This ratio is Z-Scored to provide a standardized measure, allowing users to identify periods of market fear or greed based on the allocation of capital between the underlying and Stablecoins ( CRYPTOCAP:USDT , CRYPTOCAP:USDC , CRYPTO:TUSD , CRYPTOCAP:BUSD , CRYPTOCAP:DAI , CRYPTOCAP:USDD , CRYPTOCAP:FRAX ). The z-scored values indicate potential areas of discount (buying opportunities) or premium (selling opportunities) relative to historical patterns.
Customization:
Underlying Asset: SSRO is customizable to different underlying assets, offering a versatile tool for various cryptocurrencies.
Calculation Length: Users can adjust the length of the calculation, tailoring the indicator to short or long-term analysis.
Visualization: SSRO can be displayed as candles, providing a visual representation of premium and discount areas.
Interpretation:
Market Sentiment: Lower SSRO values may indicate market fear, suggesting a preference for stablecoins as a relatively safer haven for capital. Conversely, higher values may suggest market greed, as more capital is allocated to the underlying asset.
Utility and Use Cases:
1. Mean Reversion Analysis: SSRO identifies potential mean reversion opportunities, guiding traders on optimal entry and exit points.
2. Sentiment Analysis: The indicator provides insights into market sentiment, aiding traders in understanding market dynamics.
3. Macro Analysis: The majority of cryptos follow \ correlate to CRYPTO:BTCUSD , Therefore by assessing premium and discount areas of CRYPTO:BTCUSD relative to the chosen underlying asset, users gain insights into potential market tops and bottoms.
4. Divergence Analysis: SSRO divergence from price trends can signal potential reversals, providing traders with additional confirmation for their decisions.
The Stablecoin Supply Ratio Oscillator is a valuable tool for cryptocurrency traders, offering a nuanced perspective on market sentiment and mean reversion opportunities. Its customization options and visual representation make it a versatile and powerful addition to the crypto analyst's toolkit.
[dharmatech] KBDR Mean ReversionBased on the criteria described in the book "Mean Revision Trading" by Nishant Pant.
Bullish signal criteria:
Bollinger Bands must be outside Keltner Channel
Price near bottom bband
DI+ increasing
DI- decreasing
RSI near bottom and increasing
Bearish signal criteria:
Bollinger Bands must be outside Keltner Channel
Price near upper bband
DI+ decreasing
DI- increasing
RSI near upper and decreasing
A single triangle indicates that all 4 criteria are met.
If letters appear with the triangle, this indicates that there was a partial criteria match.
K : bbands outside Keltner
B : bbands criteria met
D : DI criteria met
R : RSI criteria met
You can use the settings to turn off partial signals. For example:
"Partial 3" means show signals where 3 of the criteria are met.
If you want more insight into the underlying criteria, load these indicators as well:
Bollinger Bands (built-in to TradingView)
Keltner Channels (built-in to TradingView)
RSI (built-in to TradingView)
ADX and DI
Warning:
Not meant to be used as a stand-alone buy/sell signal.
It regularly provides signals which would not be profitable.
It's meant to be used in conjunction with other analysis.
Think of this as a time-saving tool. Instead of manually checking RSI, DI+/DI-, bbands, distance, etc. this does all of that for you on the fly.
Dynamic GANN Square Of 9 BandsDynamic GANN Square Of 9 Bands
Created on 3 Sept 2023
Adjust Increment Value:
Customize increment to match symbol and price characteristics for accuracy.
Green Line:
200 EMA. Identifies trend direction; moves with the prevailing trend.
Red Lines:
Mark prominent reversal levels closer to the red range; ideal for mean reversion strategies.
Crossing red levels may indicate trend continuation to the next red level.
Grey Lines:
Show immediate target reversal levels; watch for potential reversals.
Key Features:
Levels are different from Standard Deviation Lines.
Levels remain fixed and parallel, unaffected by volatility.
Despite its dynamism, it can serve as a leading indicator, revealing potential trend changes.
Primarily designed for trend-following strategies.
Additional Tips:
Use additional confirmations
Manage predefined risk and quantity
Additional Resources:
GANN Square Of 9 Pivots:
Bollinger Band Percentile SuiteThe Bollinger Band Percentile Suite (𝐵𝐵𝒫𝒸𝓉 𝒮𝓊𝒾𝓉𝑒) is a comprehensive and customizable toolkit built upon the foundation of the %B indicator. The methodology behind this toolkit remains consistent with the original %B indicator, while introducing a host of powerful features to enhance its functionality and adaptability.
Key Features and Customization:
The 𝐵𝐵𝒫𝒸𝓉 offers a wide array of customizable options to suit your trading preferences and strategies. It includes a variety of 14 moving average types that can be chosen as the basis for the Bollinger Band calculation. Additionally, traders have the flexibility to set their upper and lower boundaries for mean reversion detection, allowing for analysis tailored to the user's preference.
Deviation Calculation:
The toolkit provides an option to choose between standard and weighted deviation calculation methods. This added customization ensures that the indicator's behavior aligns with your unique trading style and preferences.
Signals and Reversals:
The 𝐵𝐵𝒫𝒸𝓉 excels in identifying potential overbought and oversold market conditions. It highlights these levels on the chart and marks potential reversal signals with small circles positioned either at the top or bottom of the indicator pane, providing traders with actionable insights.
Trend and Color Coding:
Incorporating a color-coded approach, the BBpct Suite enhances your understanding of market dynamics. It offers bar coloring options based on trend, allowing traders to identify bullish or bearish market conditions as the percentile goes above or below the midline.
Extremities and Reversions:
Recognizing extreme market conditions is crucial for traders. The 𝐵𝐵𝒫𝒸𝓉 includes color-coded indicators for extremities, indicating when the percentile ventures above or below the predefined thresholds. Moreover, it promptly identifies reversions by marking the moment the percentile crosses under the upper threshold (overbought) or over the lower threshold (oversold).
The Bollinger Band Percentile Suite equips traders with a versatile toolkit to gain valuable insights into market overbought and oversold conditions, and potential reversal signals. Its extensive customization options and array of features empower traders to make well-informed decisions based on their unique trading strategies and risk tolerance.
Please note that while the BBpct Suite provides robust analysis, it is advisable to combine its insights with other technical indicators and tools for a comprehensive trading approach.
Example Chart:
Extreme Entry with Mean Reversion and Trend FilterThis non-repainting indicator is an improved version of my previous work, a more versatile tool designed to provide traders with dynamic and adaptive entry signals while incorporating a mean reversion and trend filtering mechanism. By combining RSI overbought/oversold, regular divergence and confirmatory momentum oscillator such as CCI or MOM, this indicator generates more precise and timely signals for entering trades.
The indicator offers a comprehensive set of entry conditions for both Buy and Sell entries:
• For Buy entries, it checks for oversold conditions based on RSI levels, and detects bullish divergence patterns while oversold and it identifies upward crossovers in the selected entry signal source (CCI or Momentum).
• Similarly, for Sell entries, it identifies downward crossovers of the CCI or Mom, after the recent overbought conditions, and bearish divergence patterns inside the overbought RSI.
To refine the entry signals even further, the indicator utilizes a mean reversion filter. Traders can choose to display signals that occur inside or outside the upper and lower mean reversion bands:
• Range Entries are indicating potential buying opportunities near the lower band and selling opportunities near the upper band. This is based on the concept of mean reversion, which suggests that prices tend to return to the average when they reach the upper or lower bands. By focusing on these signals, traders can take advantage of price movements that have a higher probability of reversing towards the mean.
• Extreme Entries, on the other hand, represent signals that occur outside of the bands, signaling potential pullbacks during strong trends. By entering positions only at extreme highs or lows, traders can avoid getting caught in the middle of the trend. This approach helps traders capitalize more favorable trading opportunities which have a high reward-risk ratio.
Trend Filter acts as a directional bias for the entry signals. When enabled, long and short entry conditions are filtered based on the relationship between the closing price and the EMA.
Traders have the flexibility to customize, tweak the indicator filter and values in the settings according to their preferences strategies and traded assets, tailoring the signals to their specific needs. The script sets alert conditions to trigger alerts for buy, sell, or both entry signals. This indicator can be used in conjunction with price action or other technical analysis tools for confirmation and better trading decisions.
I created this indicator for my own use, and I share this for informational purposes only. It does not constitute financial advice so use at your own risk and consider your financial situation before making any trading decisions. The indicator's accuracy is not guaranteed, and past performance is not indicative of future results.
I appreciate your feedback on this indicator. As I am new to script development, I am open to comments and suggestions to improve it. If you encounter any issues while using this indicator, please let me know in the comments section. If you find it helpful, I kindly ask for your support in boosting it. Thank you for your cooperation.
Reversion Zone IndexThe Reversion Zone Index (RZI) is an indicator that combines the Commodity Channel Index (CCI), Choppiness Index (CI), and Bollinger Bands Percentage (BBPct) to identify mean reversion signals in the market. It is plotted as an Exponential Moving Average (EMA) smoothed oscillator with overbought and oversold zones, and mean reversion signals are represented by red and green arrows.
The three indicators are combined to benefit from their complementary aspects and create a more comprehensive view of mean reversion conditions. Here's a brief overview of each indicator's benefits:
1. Commodity Channel Index (CCI): CCI measures the current price level relative to its average over a specified period. It helps identify overbought and oversold conditions, as well as potential trend retracements. By incorporating CCI, the RZI gains insights into momentum and potential turning points.
2. Choppiness Index (CI): CI quantifies the market's choppiness or trendiness by analyzing the range between the highest high and lowest low over a specific period. It indicates whether the market is in a trending or ranging phase. CI provides valuable information about the market state, which can be useful in mean reversion analysis.
3. Bollinger Bands Percentage (BBPct): BBPct measures the current price's position relative to the Bollinger Bands. It calculates the percentage difference between the current price and the bands, identifying potential overbought or oversold conditions. BBPct helps gauge the market's deviation from its typical behavior and highlights potential reversal opportunities.
The RZI combines the three indicators by taking an average of their values and applying further calculations. It smooths the combined oscillator using an EMA to reduce noise and enhance the visibility of the trends. Smoothing with EMA provides a more responsive representation of the overall trend and helps filter out short-term fluctuations.
The overbought and oversold zones are marked on the chart as reference levels. When the combined oscillator is above the overbought zone or below the oversold zone, it suggests a potential mean reversion signal. Red and green arrows are displayed to visually indicate these mean retracement signals.
The RZI is a valuable tool for identifying mean reversion opportunities in the market. It incorporates multiple indicators, each providing unique insights into different aspects of mean reversion, such as momentum, volatility, and price positioning. Traders can use this indicator to spot potential turning points and time their trades accordingly.
Edri Extreme Points Buy & SellEDRI EXTREME POINTS BUY & SELL INDICATOR
This Buy and Sell (non-repainting) indicator uses signals based on the combined CCI/Momentum and RSI indicators and optional regular divergence.
The idea of the indicator is to look for a potential reversal after the price reached extreme points (overbought or oversold) and signals an entry when the price shows signs of momentum for reversal.
Optionally, it considers finding a divergence while RSI is at the extreme levels to improve the predictability of a possible reversal.
Additionally, the indicator includes a simple Mean Reversion visual on the chart to assist users in identifying extreme price levels and potential reversal opportunities. It features upper and lower bands that can be optionally plotted, showing calculated values where price bounces at those extreme levels.
The purpose of these bands is to help traders avoid getting trapped in the middle of a trend and to guide them to buy low and sell high. (It's important to note that this is purely a visual aid and does not impact the generation of trade signals.)
By utilizing the Mean Reversion bands alongside the entry conditions, traders can gain insights into potential price reversals and make more informed decisions about when to enter or exit trades.
Buy and Sell Entry conditions:
• The indicator looks at the CCI/Momentum indicator to turn positive (if buy) or negative (if sell) after the RSI was overbought or oversold in the recent past.
• It also checks if there is a 3-period regular bullish divergence in the RSI (if buy), or regular bearish divergence (if sell) and consider these in the entry condition.
• If these conditions are met, this indicator suggests that it may be a good time to enter a trade.
In summary this is how this indicator works:
• The indicator takes input settings such as the choice between using CCI or Momentum as the entry signal source, length parameters for CCI/Momentum, RSI levels for overbought and oversold conditions, RSI length, and options to plot mean reversion bands on the chart.
• It calculates the CCI and Momentum and RSI values based on user-defined length..
• It checks for regular bullish and bearish divergences (3 periods) in the RSI if the option is enabled.
• The script plots shapes on the chart to indicate the buy and sell signals based on the entry conditions.
• If the mean reversion bands option is enabled, it calculates the mean reversion, standard deviation, upper band, and lower band values.
• It also plots the upper band, mean reversion line, and lower band on the chart if the mean reversion bands option is enabled.
• This indicator includes alert conditions to generate alerts for the buy and sell signals.
• On top of that, users can opt to use only one alert for both buy and sell signals. (This can save Trading view subscribers with limited alerts.)
Important! Please do not consider everything you read here as financial advice. Additionally, do not rely solely on indicators for making your trading decisions. It is important to note that no indicator or strategy is perfect. Therefore, it is always recommended to backtest everything and practice proper risk management.
I appreciate your feedback on this indicator. As I am new to script development, I am open to comments and suggestions to improve it. If you encounter any issues while using this indicator, please let me know in the comments section. If you find it helpful, I kindly ask for your support in boosting it. Thank you for your cooperation.
Z-Score Heikin-Ashi TransformedThe Z-Score Heikin-Ashi Transformed (𝘡 𝘏-𝘈) indicator is a powerful technical tool that combines the principles of Z-Score and Heikin Ashi to provide traders with a smoothed representation of price movements and a standardized measure of market volatility.
The 𝘡 𝘏-𝘈 indicator applies the Z-Score calculation to price data and then transforms the resulting Z-Scores using the Heikin Ashi technique. Understanding the individual components of Z-Score and Heikin Ashi will provide a foundation for comprehending the methodology and unique features of this indicator.
Z-Score:
Z-Score is a statistical measure that quantifies the distance between a data point and the mean, relative to the standard deviation. It provides a standardized value that allows traders to compare different data points on a common scale. In the context of the 𝘡 𝘏-𝘈 indicator, Z-Score is calculated based on price data, enabling the identification of extreme price movements and the assessment of their significance.
Heikin Ashi:
Heikin Ashi is a popular charting technique that aims to filter out market noise and provide a smoother representation of price trends. It involves calculating each candlestick based on the average of the previous candle's open, close, high, and low prices. This approach results in a chart that reduces the impact of short-term price fluctuations and reveals the underlying trend more clearly.
Methodology:
The 𝘡 𝘏-𝘈 indicator starts by calculating the Z-Score of the price data, which provides a standardized measure of how far each price point deviates from the mean. Next, the resulting Z-Scores are transformed using the Heikin Ashi technique. Each Z-Score value is modified according to the Heikin Ashi formula, which incorporates the average of the previous Heikin Ashi candle's open and close prices. This transformation smooths out the Z-Score values and reduces the impact of short-term price fluctuations, providing a clearer view of market trends.
This tool enables traders to identify significant price movements and assess their relative strength compared to historical data. Positive transformed Z-Scores indicate that prices are above the average, suggesting potential overbought conditions, while negative transformed Z-Scores indicate prices below the average, suggesting potential oversold conditions. Traders can utilize this information to identify potential reversals, confirm trend strength, and generate trading signals.
Utility:
The indicator offers valuable insights into price volatility and trend analysis. By combining the standardized measure of Z-Score with the smoothing effect of Heikin Ashi, traders can make more informed trading decisions and improve their understanding of market dynamics. 𝘡 𝘏-𝘈 can be used in various trading strategies, including identifying overbought or oversold conditions, confirming trend reversals, and establishing entry and exit points.
Note that the 𝘡 𝘏-𝘈 should be used in conjunction with other technical indicators and analysis tools to validate signals and avoid false positives. Additionally, traders are encouraged to conduct thorough backtesting and experimentation with different parameter settings to optimize the effectiveness of the indicator for their specific trading approach.
Key Features:
Optional Reversion Doritos
Adjustable Reversion Threshold
2 Adjustable EMAs
Example Charts:
See Also:
On Balance Volume Heikin-Ashi Transformed
Rough AverageThe Rough Average indicator is a unique technical tool that calculates a modified average to provide insights into market conditions. It incorporates a combination of mathematical operations and existing indicators to offer traders a different perspective on price movements.
The Rough Average indicator aims to capture market dynamics through a specific calculation method. It utilizes two main components: a check for the approximate scale of the price and a profile calculation based on the Relative Strength Index (RSI) of the closing price.
Methodology:
Approximate Scale: The indicator determines the approximate scale of the price by analyzing the magnitude of the closing price. This step involves a mathematical process that identifies the power of 10 that best represents the scale. This function reduces overall lag and gives a better smoothing to the output of the calculation
Profile Calculation: The indicator calculates a profile value by summing the absolute values of the RSI of the closing price over a specified period. The RSI provides insights into the strength or weakness of price movements. The profile calculation considers a range of prices based on the determined scale.
Indicator Calculation:
The Rough Average is derived by applying the Exponential Moving Average (EMA) to the calculated profile. The EMA is a smoothing technique that emphasizes recent price data. The resulting value represents the modified average of the indicator.
Utility:
The Rough Average indicator offers traders an alternative perspective on market conditions. By utilizing a modified average calculation, it can reveal potential trends, reversals, or periods of market strength or weakness. Traders can use the Rough Average to complement their analysis and identify possible trading opportunities.
It is important to note that the effectiveness of the Rough Average indicator may vary depending on the specific market and trading strategy. It is recommended to combine its analysis with other technical indicators and conduct thorough testing before making trading decisions.
Key Features:
Customizable OB\OS Levels
Bar coloring methods: Trend, Reversions, Extremities
Example Charts:
Regularized-Moving-Average Oscillator SuiteThe Regularized-MA Oscillator Suite is a versatile indicator that transforms any moving average into an oscillator. It comprises up to 13 different moving average types, including KAMA, T3, and ALMA. This indicator serves as a valuable tool for both trend following and mean reversion strategies, providing traders and investors with enhanced insights into market dynamics.
Methodology:
The Regularized MA Oscillator Suite calculates the moving average (MA) based on user-defined parameters such as length, moving average type, and custom smoothing factors. It then derives the mean and standard deviation of the MA using a normalized period. Finally, it computes the Z-Score by subtracting the mean from the MA and dividing it by the standard deviation.
KAMA (Kaufman's Adaptive Moving Average):
KAMA is a unique moving average type that dynamically adjusts its smoothing period based on market volatility. It adapts to changing market conditions, providing a smoother response during periods of low volatility and a quicker response during periods of high volatility. This allows traders to capture trends effectively while reducing noise.
T3 (Tillson's Exponential Moving Average):
T3 is an exponential moving average that incorporates additional smoothing techniques to reduce lag and provide a more responsive indicator. It aims to maintain a balance between responsiveness and smoothness, allowing traders to identify trend reversals with greater accuracy.
ALMA (Arnaud Legoux Moving Average):
ALMA is a moving average type that utilizes a combination of linear regression and exponential moving average techniques. It offers a unique way of calculating the moving average by providing a smoother and more accurate representation of price trends. ALMA reduces lag and noise, enabling traders to identify trend changes and potential entry or exit points more effectively.
Z-Score:
The Z-Score calculation in the Regularized-MA Oscillator Suite standardizes the values of the moving average. It measures the deviation of each data point from the mean in terms of standard deviations. By normalizing the moving average through the Z-Score, the indicator enables traders to assess the relative position of price in relation to its mean and volatility. This information can be valuable for identifying overbought and oversold conditions, as well as potential trend reversals.
Utility:
The Regularized-MA Oscillator Suite with its unique moving average types and Z-Score calculation offers traders and investors powerful analytical tools. It can be used for trend following strategies by analyzing the oscillator's position relative to the midline. Traders can also employ it as a mean reversion tool by identifying peak values above user-defined deviations. These features assist in identifying potential entry and exit points, enhancing trading decisions and market analysis.
Key Features:
Variety of 13 MA types.
Potential reversal point bubbles.
Bar coloring methods - Trend (Midline cross), Extremities, Reversions, Slope
Example Charts:
David Varadi Intermediate OscillatorThe David Varadi Intermediate Oscillator (DVI) is a composite momentum oscillator designed to generate trading signals based on two key factors: the magnitude of returns over different time windows and the stretch, which measures the relative number of up versus down days. By combining these factors, the DVI aims to provide a reliable and objective assessment of market trends and momentum.
Methodology:
To calculate the DVI, a specific formula is applied. The magnitude component involves averaging smoothed returns over various lengths, weighted according to user-defined parameters. This calculation helps determine the magnitude of price changes. The stretch component follows a similar process, averaging smoothed returns over different lengths to gauge market momentum. Users have the flexibility to adjust the weights and lengths to suit their trading preferences and styles.
Utility:
The DVI offers versatility in its applications. It can be used for both momentum trading and trend analysis due to its smooth and consistent signals. Unlike some other oscillators, the DVI provides longer and uncorrelated signals, allowing traders to effectively combine trend-following and mean-reversion strategies. For example, the DVI is adept at identifying overbought levels above the 200-day moving average, serving as a useful tool for determining exit points during price strength and even potential shorting opportunities. Traders can develop simple trading systems based on the DVI, buying above the 200-day moving average and selling when the DVI exceeds a specified threshold. Conversely, they can consider short positions below the 200-day moving average and cover when the DVI falls below a specific threshold. The DVI's objective approach to analyzing market momentum makes it a valuable resource for traders seeking to identify trading opportunities.
Key Features:
Bar coloring: based on Trend, Extremeties or Reversions
Reversions: Potential reversal points marked with triangles above\below oscillator
Extremity Hues: Highlighting oxcillator reaching traditional OB\OS levels
Example Charts:
Adaptive Mean Reversion IndicatorThe Adaptive Mean Reversion Indicator is a tool for identifying mean reversion trading opportunities in the market. The indicator employs a dynamic approach by adapting its parameters based on the detected market regime, ensuring optimal performance in different market conditions.
To determine the market regime, the indicator utilizes a volatility threshold. By comparing the average true range (ATR) over a 14-period to the specified threshold, it determines whether the market is trending or ranging. This information is crucial as it sets the foundation for parameter optimization.
The parameter optimization process is an essential step in the indicator's calculation. It dynamically adjusts the lookback period and threshold level based on the identified market regime. In trending markets, a longer lookback period and higher threshold level are chosen to capture extended trends. In ranging markets, a shorter lookback period and lower threshold level are used to identify mean reversion opportunities within a narrower price range.
The mean reversion calculation lies at the core of this indicator. It starts with computing the mean value using the simple moving average (SMA) over the selected lookback period. This represents the average price level. The deviation is then determined by calculating the standard deviation of the closing prices over the same lookback period. The upper and lower bands are derived by adding and subtracting the threshold level multiplied by the deviation from the mean, respectively. These bands serve as dynamic levels that define potential overbought and oversold areas.
In real-time, the indicator's adaptability shines through. If the market is trending, the adaptive mean is set to the calculated mean value. The adaptive upper and lower bands are adjusted by scaling the threshold level with a factor of 0.75. This adjustment allows the indicator to be less sensitive to minor price fluctuations during trending periods, providing more robust mean reversion signals. In ranging market conditions, the regular mean, upper band, and lower band are used as they are more suited to capture mean reversion within a confined price range.
The signal generation component of the indicator identifies potential trading opportunities based on the relationship between the current close price and the adaptive upper and lower bands. If the close price is above the adaptive upper band, it suggests a potential short entry opportunity (-1). Conversely, if the close price is below the adaptive lower band, it indicates a potential long entry opportunity (1). When the close price is within the range defined by the adaptive upper and lower bands, no clear trading signal is generated (0).
To further strengthen the quality of signals, the indicator introduces a confluence condition based on the RSI. When the RSI exceeds the threshold levels of 70 or falls below the threshold level of 30, it indicates a strong momentum condition. By incorporating this confluence condition, the indicator ensures that mean reversion signals align with the prevailing market momentum. It reduces the likelihood of false signals and provides traders with added confidence when entering trades.
The indicator offers alert conditions to notify traders of potential trading opportunities. Alert conditions are set to trigger when a potential long entry signal (1) or a potential short entry signal (-1) aligns with the confluence condition. These alerts allow traders to stay informed about favorable mean reversion setups, even when they are not actively monitoring the charts. By leveraging alerts, traders can efficiently manage their time and take advantage of market opportunities.
To enhance visual interpretation, the indicator incorporates background coloration that provides valuable insights into the prevailing market conditions. When the indicator generates a potential short entry signal (-1) that aligns with the confluence condition, the background color is set to lime. This color suggests a bullish trend that is potentially reaching an exhaustion point and about to revert downwards. Similarly, when the indicator generates a potential long entry signal (1) that aligns with the confluence condition, the background color is set to fuchsia. This color represents a bearish trend that is potentially reaching an exhaustion point and about to revert upwards. By employing background coloration, the indicator enables traders to quickly identify market conditions that may offer mean reversion opportunities with a directional bias.
The indicator further enhances visual clarity by incorporating bar coloring that aligns with the prevailing market conditions and signals. When the indicator generates a potential short entry signal (-1) that aligns with the confluence condition, the bar color is set to lime. This color signifies a bullish trend that is potentially reaching an exhaustion point, indicating a high probability of a downward reversion. Conversely, when the indicator generates a potential long entry signal (1) that aligns with the confluence condition, the bar color is set to fuchsia. This color represents a bearish trend that is potentially reaching an exhaustion point, indicating a high probability of an upward reversion. By using distinct bar colors, the indicator provides traders with a clear visual distinction between bullish and bearish trends, facilitating easier identification of mean reversion opportunities within the context of the broader trend.
While the "Adaptive Mean Reversion Indicator" offers a robust framework for identifying mean reversion opportunities, it's important to remember that no indicator is foolproof. Traders should exercise caution and employ risk management strategies. Additionally, it is recommended to use this indicator in conjunction with other technical analysis tools and fundamental factors to make well-informed trading decisions. Regular backtesting and refinement of the indicator's parameters are crucial to ensure its effectiveness in different market conditions.
Intraday Mean Reversion Money Performance indicatorThe diagram shows Money Performance when buying stocks for 10 000 at every buy signal from the Intraday Mean Reversion indicator.
The indicator is best used in combination with Intraday Mean Reversion Main Indicator
The rules for trading are: Buy on Open price if the Intraday Mean Reversion Main indicator gives a buy signal. Sell on the daily close price.
According to my knowledge it is not possible to create a PineScript strategy based on these rules, because the indicator is used on Day to Day graph. Therefore this indicator can be used to analyze Money performance of this strategy.
The lines show the performance of the Intraday Mean Reversion Strategy, based on the different levels in the strategy (from 0.5 Standard deviation to 1.1 standard deviation)
Using this indicator it is possible to find stocks that often reverse towards mean after open.
Use this strategy on stocks with high positive performance. Do not use on stocks with negative performance.
Intraday Mean Reversion MainThe Intraday Mean Reversion Indicator works well on certain stocks. It should be used for day trading stocks but need to be applied on the Day to Day timeframe.
The logic behind the indicator is that stocks that opens substantially lower than yesterdays close, very often bounces back during the day and closes higher than the open price, thus the name Intraday Mean reversal. The stock so to speak, reverses to the mean.
The indicator has 7 levels to choose from:
0.5 * standard deviation
0.6 * standard deviation
0.7 * standard deviation
0.8 * standard deviation
0.9 * standard deviation
1.0 * standard deviation
1.1 * standard deviation
The script can easily be modified to test other levels as well, but according to my experience these levels work the best.
The info box shows the performance of one of these levels, chosen by the user.
Every Yellow bar in the graph shows a buy signal. That is: The stocks open is substantially lower (0.5 - 1.1 standard deviations) than yesterdays close. This means we have a buy signal.
The Multiplier shows which multiplier is chosen, the sum shows the profit following the strategy if ONE stock is bought on every buy signal. The Ratio shows the ratio between winning and losing trades if we followed the strategy historically.
We want to find stocks that have a high ratio and a positive sum. That is More Ups than downs. A ratio over 0.5 is good, but of course we want a margin of safety so, 0.75 is a better choice but harder to find.
If we find a stock that meets our criteria then the strategy will be to buy as early as possible on the open, and sell as close as possible on the close!
[TT] Sectors Dist % From MA- The script shows the distance in percentages from the 200 MA (or any other MA period) , for the 11 SP500 sectors.
- It works based on the current time frames.
Could be useful when working with mean reversion strategies to detect extremes zones and overbought/oversold conditions in the given sectors compared others.
BBPullback1.0.2This is a simple strategy script based on Bollinger Bands pullbacks.
The strategy is simple, as follows:
For LONGS: At the close of any candle, it check to see if this candle is an UP candle where the low broke below the lower Bollinger Band. If so, we call this the trigger candle. For the next bar, we issue a BUY signal if the price breaks above the high of the trigger candle. The stoploss is the low of the trigger candle. We take profit when the price goes above the middle Bollinger Band (the mean/average line).
For SHORTS: At the close of any candle, it check to see if this candle is an DOWN candle where the high broke above the upper Bollinger Band. If so, we call this the trigger candle. For the next bar, we issue a SELL signal if the price breaks below the low of the trigger candle. The stoploss is the high of the trigger candle. We take profit when the price goes below the middle Bollinger Band (the mean/average line).
Quantitative Price Forecasting - The Quant ScienceThis script is a quantitative price forecasting indicator that forecasts price changes for a given asset.
The model aims to forecast future prices by analyzing past data within a selected time period. Mathematical probability is used to calculate whether starting from time X can lead to reaching prices Y1 and Y2. In this context, X represents the current selected time period, Y1 represents the selected percentage decrease, and Y2 represents the selected percentage increase. The probabilities are estimated using the simple average.
The simple average is displayed on the chart, showing in red the periods where the price is below the average and in green the periods where the price is above the average.
This powerful tool not only provides forecasts of future prices but also calculates the distribution of variations around the average. It then takes this information and creates an estimate of the average price variation around the simple average.
Using a mean-reverting logic, buying and selling opportunities are highlighted.
We recommend turning off the display of bars on your chart for a better experience when using this indicator.
Unlock the full potential of your trading strategy with our powerful indicator. By analyzing past price data, it provides accurate forecasts and calculates the probability of reaching specific price targets. Its mean-reverting logic highlights buying and selling opportunities, while the simple moving average displayed on the chart shows periods where the price is above or below the average. Additionally, it estimates the average variation of price around the simple average, giving you valuable insights into price movements. Don't miss out on this valuable tool that can take your trading to the next level
LNL Keltner CandlesLNL Keltner Candles
This indicator plots mean reversion (reversal) arrows with custom painted candles based on the price touch or close above or below keltner channel limits (upper & lower bands). This study was created primarily for swing trading & higher time frames such as daily and weekly. Lower time frames might result in more false signals.
Mean Reversal Arrows:
1. Reversal Arrow Up - If the price drops below the lower band extremes, reversal up is the trigger for a bullish mean reversion.
2. Reversal Arrow Down - Once the price reach the higher band extremes, reversal down is the trigger for a bearish mean reversion.
The Concept of Mean Reversion:
There are just two types of moves in any market: The market is either expanding from the mean or retracing back to the mean. These reversions & epxansions are happening across all types of markets. The goal of this study is to catch the powerful mean reversion from extremes back to the mean. Once the candles light up green / red, it is time to look for the reversal (purple) arrow which triggers the mean reversion setup. Mean reversion is not about catching the next big swing turn to new highs or lows. It is all about the base hits = the mean. So the target here is always the average price. The idea here is to catch the average market ebbs & flows, not the next home run.
What Do I Mean by Mean?
Mean is usually the average price from the last 20-30 bars. Basically something like a 20 MA or Keltner Channel or Bollinger Band midline are really good visual representators of the mean (average price).
Hope it helps.
Dual Bollinger Band Mean ReversionSimple but solid mean reversion indicator with sl and tp levels. Most of the code is based on the built in bollinger bands script. Designed for scalping 1-5 minute timeframes.
The indicator consists of two sets of bollinger bands.
Price has to close below the lower (fast) bollinger band, above the moving average of the (slower) bollinger band.
If price now closes above the lower (fast) bb, the indicator draws a label at the open of the next candle (which would be a potential entry point). Take profit becomes the upper bollinger band, stop loss the same distance below the open of the candle.
I've built in a simple backtesting function that calculates the potential win/loss-ratio. Loss and profit levels are 1:1. Exit strategy could be improved on.
Adjusting the lengths depending on the asset proves to be a good idea.
The slower bollinger bands can help to identify ranging markets and/or trends following regular bollinger bands theory.
Feel free to comment with any changes that you'd like to be made.
Mean Reversion DotsMarkets tend to mean revert. This indicator plots a moving average from a higher time frame (type of MA and length selectable by the user). It then calculates standard deviations in two dimensions:
- Standard deviation of move of price away from this moving average
- Standard deviations of number of bars spent in this extended range
The indicator plots a table in the upper right corner with the % of distance of price from the moving average. It then plots 'mean reversion dots' once price has been 1 or more standard deviations away from the moving average for one or more standard deviations number of bars. The dots change color, becoming more intense, the longer the move persists. Optionally, the user can display the standard deviations in movement away from the moving average as channels, and the user can also select which levels of moves they want to see. Opting to see only more extreme moves will result in fewer signals, but signals that are more likely to imminently result in mean reversion back to the moving average.
In my opinion, this indicator is more likely to be useful for indices, futures, commodities, and select larger cap names.
Combinations I have found that work well for SPX are plotting the 30min 21ema on a 5min chart and the daily 21ema on an hourly chart.
In many cases, once mean reversion dots for an extreme enough move (level 1.3 or 2.2 and above) begin to appear, a trade may be initiated from a support/resistance level. A safer way to use these signals is to consider them as a 'heads up' that the move is overextended, and then look for a buy/sell signal from another indicator to initiate a position.
Note: I borrowed the code for the higher timeframe MA from the below indicator. I added the ability to select type of MA.
Market Meanness Index [CC]The Market Meanness Index was created by Johann Christian Lotter and I added some smoothing of my own, so feel free to try it without any smoothing to see the differences. This indicator relies on the mean reversion theory that all prices will eventually revert to the mean over a long period of time. Obviously there is more to the theory but the basic idea is if you plot a sma or other typical moving average, you will see the price moving up or below the long term moving average such as a 200 day sma but usually heads back to the average in the short term. This is a good statistical analysis used for volatility which is where this indicator comes in. Simply put, we calculate volatility based on how often a price is both above the median and above the previous price or vice versa.
A rising Market Meanness Index means that the market is becoming more volatile and that there is a high likelihood of a change in the underlying trend. A falling Market Meanness Index means that the current trend is dying and there is a high likelihood of a trend reversal. Typically I put general buy and sell signals in red or green but in this particular case, this indicator works best as a overall trend filter and you would want to place a trade when this indicator has a peak or valley. Let me know if you find a good overall buy and sell signal system of course.
I know I keep saying that I will get active again and post more indicators but life is very hectic for me. For those who have been following my updates, my twins were finally born a little over a month ago and as you can imagine, they keep me up at all hours of the day so it is hard to create new indicator scripts when I'm getting no sleep lol. I will do my best to start publishing the giant backlog of scripts I have created but in the meantime, please be patient with me. This indicator was a special request so let me know if you have any special requests of your own!
I11L - Reversal Trading Ideas by Larry ConnorsThis is my own Twist on Larry Connors Simple Tradingideas.
It Combines the RSI, Averaging In and the Lowest Bars in a Single System.
The current Configuration is designed for the Daily Timeframe.
Feel free to play with the Parameters and keep in mind that Larry Intended to buy fear and sell the greed!
The Rules are the following:
---Buy---
Buy, if the lowest Bar of your Configuration has been hit (default is set to 7).
---Average Down--
Buy, if the lowest Bar of your Configuration * Your open trades has been hit AND only if the buyin is atleast 1% cheaper.
---Close---
Close, if the RSI closes above a certain level (default is set to 70).
---TP---
There is no TP
---SL---
There is no SL, so be cautions of your tail Risk!