Advanced ADX [CryptoSea]The Advanced ADX Analysis is a sophisticated tool designed to enhance market analysis through detailed ADX calculations. This tool is built for traders who seek to identify market trends, strength, and potential reversals with higher accuracy. By leveraging the Average Directional Index (ADX), Directional Indicator Plus (DI+), and Directional Indicator Minus (DI-), this indicator offers a comprehensive view of market dynamics.
New Overlay Feature: This script uses the new 'force overlay' feature which lets you plot on the chart as well as plotting in an oscillator pane at the same time.
force_overlay=true
Key Features
Comprehensive ADX Tracking: Tracks ADX values along with DI+ and DI- to provide a complete view of market trend strength and direction. The ADX measures the strength of the trend, while DI+ and DI- indicate the trend direction. This combined analysis helps traders identify strong and weak trends with precision.
Trend Duration Monitoring: Monitors the duration of strong and weak trends, offering insights into trend persistence and potential reversals. By keeping track of how long the ADX has been above or below a certain threshold, traders can gauge the sustainability of the current trend.
Customizable Alerts: Features multiple alert options for strong trends, weak trends, and DI crossovers, ensuring traders are notified of significant market events. These alerts can be tailored to notify traders when certain conditions are met, such as when the ADX crosses a threshold or when DI+ crosses DI-.
Adaptive Display Options: Includes customizable background color settings and extended statistics display for in-depth market analysis. Users can choose to highlight strong or weak trends on the chart background, making it easier to visualize market conditions at a glance.
In the example below, we have a bullish scenario play out where the DI+ has been above the DI- for 11 candles and our dashboard shows the average is 10.48 candles. With the ADX above its threshold this would be a bullish signal.
This ended up in a 20%+ move to the upside. The dashboard will help point out things to consider when looking to exit the position, the DI+ getting close to the max DI+ duration would be a sign that momentum is weakening and that price may cool off or even reverse.
How it Works
ADX Calculation: Computes the ADX, DI+, and DI- values using a user-defined period. The ADX is derived from the smoothed average of the absolute difference between DI+ and DI-. This calculation helps determine the strength of a trend without considering its direction.
Trend Duration Analysis: Tracks and calculates the duration of strong and weak trends, as well as DI+ and DI- durations. This analysis provides a detailed view of how long a trend has been in place, helping traders assess the reliability of the trend.
Alert System: Provides a robust alert system that triggers notifications for strong trends, weak trends, and DI crossovers. The alerts are based on specific conditions such as the duration of the trend or the crossover of directional indicators, ensuring traders are informed about critical market movements.
Visual Enhancements: Utilizes color gradients and background settings to visually represent trend strength and duration. This feature enhances the visual analysis of trends, making it easier for traders to identify significant market changes at a glance.
In the example below, we see the ADX weakening after we have just had a move up, if you are looking to get into this position you want to see the ADX growing with either the DI+ or DI- breaking their average durations.
As you can see below, although the ADX manages to move above the threshold, there are no DI+/- breaks which is shown by price moving sideways. Not something most traders would be interested in.
Application
Strategic Decision-Making: Assists traders in making informed decisions by providing detailed analysis of ADX movements and trend durations. By understanding the strength and direction of trends, traders can better time their entries and exits.
Trend Confirmation: Reinforces trading strategies by confirming potential reversals and trend strength through ADX and DI analysis. This confirmation helps traders validate their trading signals, reducing the risk of false signals.
Customized Analysis: Adapts to various trading styles with extensive input settings that control the display and sensitivity of trend data. Traders can customize the indicator to suit their specific needs, making it a versatile tool for different trading strategies.
The Advanced ADX Analysis by is an invaluable addition to a trader's toolkit, offering depth and precision in market trend analysis to navigate complex market conditions effectively. With its comprehensive tracking, alert system, and customizable display options, this indicator provides traders with the tools they need to stay ahead of the market.
Trend
SOL & BTC EMA with BTC/SOL Price Difference % and BTC Dom EMAThis script is designed to provide traders with a comprehensive analysis of Solana (SOL) and Bitcoin (BTC) by incorporating Exponential Moving Averages (EMAs) and price difference percentages. It also includes the BTC Dominance EMA to offer insights into the overall market dominance of Bitcoin.
Features:
SOL EMA: Plots the Exponential Moving Average (EMA) for Solana (SOL) based on a customizable period length.
BTC EMA: Plots the Exponential Moving Average (EMA) for Bitcoin (BTC) based on a customizable period length.
BTC Dominance EMA: Plots the Exponential Moving Average (EMA) for BTC Dominance, which helps in understanding Bitcoin's market share relative to other cryptocurrencies.
BTC/SOL Price Difference %: Calculates and plots the percentage difference between BTC and SOL prices, adjusted for their respective EMAs. This helps in identifying relative strength or weakness between the two assets.
Background Highlight: Colors the background to visually indicate whether the BTC/SOL price difference percentage is positive (green) or negative (red), aiding in quick decision-making.
Inputs:
SOL Ticker: Symbol for Solana (default: BINANCE
).
BTC Ticker: Symbol for Bitcoin (default: BINANCE
).
BTC Dominance Ticker: Symbol for Bitcoin Dominance (default: CRYPTOCAP
.D).
EMA Length: The length of the EMA (default: 20 periods).
Usage:
This script is intended for traders looking to analyze the relationship between SOL and BTC, using EMAs to smooth out price data and highlight trends. The BTC/SOL price difference percentage can help traders identify potential trading opportunities based on the relative movements of SOL and BTC.
Note: Leverage trading involves significant risk and may not be suitable for all investors. Ensure you have a good understanding of the market conditions and employ proper risk management techniques.
Moving Average Z-Score Suite [BackQuant]Moving Average Z-Score Suite
1. What is this indicator
The Moving Average Z-Score Suite is a versatile indicator designed to help traders identify and capitalize on market trends by utilizing a variety of moving averages. This indicator transforms selected moving averages into a Z-Score oscillator, providing clear signals for potential buy and sell opportunities. The indicator includes options to choose from eleven different moving average types, each offering unique benefits and characteristics. It also provides additional features such as standard deviation levels, extreme levels, and divergence detection, enhancing its utility in various market conditions.
2. What is a Z-Score
A Z-Score is a statistical measurement that describes a value's relationship to the mean of a group of values. It is measured in terms of standard deviations from the mean. For instance, a Z-Score of 1.0 means the value is one standard deviation above the mean, while a Z-Score of -1.0 indicates it is one standard deviation below the mean. In the context of financial markets, Z-Scores can be used to identify overbought or oversold conditions by determining how far a particular value (such as a moving average) deviates from its historical mean.
3. What moving averages can be used
The Moving Average Z-Score Suite allows users to select from the following eleven moving averages:
Simple Moving Average (SMA)
Hull Moving Average (HMA)
Exponential Moving Average (EMA)
Weighted Moving Average (WMA)
Double Exponential Moving Average (DEMA)
Running Moving Average (RMA)
Linear Regression Curve (LINREG) (This script can be found standalone )
Triple Exponential Moving Average (TEMA)
Arnaud Legoux Moving Average (ALMA)
Kalman Hull Moving Average (KHMA)
T3 Moving Average
Each of these moving averages has distinct properties and reacts differently to price changes, allowing traders to select the one that best fits their trading style and market conditions.
4. Why Turning a Moving Average into a Z-Score is Innovative and Its Benefits
Transforming a moving average into a Z-Score is an innovative approach because it normalizes the moving average values, making them more comparable across different periods and instruments. This normalization process helps in identifying extreme price movements and mean-reversion opportunities more effectively. By converting the moving average into a Z-Score, traders can better gauge the relative strength or weakness of a trend and detect potential reversals. This method enhances the traditional moving average analysis by adding a statistical perspective, providing clearer and more objective trading signals.
5. How It Can Be Used in the Context of a Trading System
In a trading system, it can be used to generate buy and sell signals based on the Z-Score values. When the Z-Score crosses above zero, it indicates a potential buying opportunity, suggesting that the price is above its mean and possibly trending upward. Conversely, a Z-Score crossing below zero signals a potential selling opportunity, indicating that the price is below its mean and might be trending downward. Additionally, the indicator's ability to show standard deviation levels and extreme levels helps traders set profit targets and stop-loss levels, improving risk management and trade planning.
6. How It Can Be Used for Trend Following
For trend-following strategies, it can be particularly useful. The Z-Score oscillator helps traders identify the strength and direction of a trend. By monitoring the Z-Score and its rate of change, traders can confirm the persistence of a trend and make informed decisions to enter or exit trades. The indicator's divergence detection feature further enhances trend-following by identifying potential reversals before they occur, allowing traders to capitalize on trend shifts. By providing a clear and quantifiable measure of trend strength, this indicator supports disciplined and systematic trend-following strategies.
No backtests for this indicator due to the many options and ways it can be used,
Enjoy
Multiple Non-Linear Regression [ChartPrime]This indicator is designed to perform multiple non-linear regression analysis using four independent variables: close, open, high, and low prices. Here's a breakdown of its components and functionalities:
Inputs:
Users can adjust several parameters:
Normalization Data Length: Length of data used for normalization.
Learning Rate: Rate at which the algorithm learns from errors.
Smooth?: Option to smooth the output.
Smooth Length: Length of smoothing if enabled.
Define start coefficients: Initial coefficients for the regression equation.
Data Normalization:
The script normalizes input data to a range between 0 and 1 using the highest and lowest values within a specified length.
Non-linear Regression:
It calculates the regression equation using the input coefficients and normalized data. The equation used is a weighted sum of the independent variables, with coefficients adjusted iteratively using gradient descent to minimize errors.
Error Calculation:
The script computes the error between the actual and predicted values.
Gradient Descent: The coefficients are updated iteratively using gradient descent to minimize the error.
// Compute the predicted values using the non-linear regression function
predictedValues = nonLinearRegression(x_1, x_2, x_3, x_4, b1, b2, b3, b4)
// Compute the error
error = errorModule(initial_val, predictedValues)
// Update the coefficients using gradient descent
b1 := b1 - (learningRate * (error * x_1))
b2 := b2 - (learningRate * (error * x_2))
b3 := b3 - (learningRate * (error * x_3))
b4 := b4 - (learningRate * (error * x_4))
Visualization:
Plotting of normalized input data (close, open, high, low).
The indicator provides visualization of normalized data values (close, open, high, low) in the form of circular markers on the chart, allowing users to easily observe the relative positions of these values in relation to each other and the regression line.
Plotting of the regression line.
Color gradient on the regression line based on its value and bar colors.
Display of normalized input data and predicted value in a table.
Signals for crossovers with a midline (0.5).
Interpretation:
Users can interpret the regression line and its crossovers with the midline (0.5) as signals for potential buy or sell opportunities.
This indicator helps users analyze the relationship between multiple variables and make trading decisions based on the regression analysis. Adjusting the coefficients and parameters can fine-tune the model's performance according to specific market conditions.
Six PillarsGeneral Overview
The "Six Pillars" indicator is a comprehensive trading tool that combines six different technical analysis methods to provide a holistic view of market conditions.
These six pillars are:
Trend
Momentum
Directional Movement (DM)
Stochastic
Fractal
On-Balance Volume (OBV)
The indicator calculates the state of each pillar and presents them in an easy-to-read table format. It also compares the current timeframe with a user-defined comparison timeframe to offer a multi-timeframe analysis.
A key feature of this indicator is the Confluence Strength meter. This unique metric quantifies the overall agreement between the six pillars across both timeframes, providing a score out of 100. A higher score indicates stronger agreement among the pillars, suggesting a more reliable trading signal.
I also included a visual cue in the form of candle coloring. When all six pillars agree on a bullish or bearish direction, the candle is colored green or red, respectively. This feature allows traders to quickly identify potential high-probability trade setups.
The Six Pillars indicator is designed to work across multiple timeframes, offering a comparison between the current timeframe and a user-defined comparison timeframe. This multi-timeframe analysis provides traders with a more comprehensive understanding of market dynamics.
Origin and Inspiration
The Six Pillars indicator was inspired by the work of Dr. Barry Burns, author of "Trend Trading for Dummies" and his concept of "5 energies." (Trend, Momentum, Cycle, Support/Resistance, Scale) I was intrigued by Dr. Burns' approach to analyzing market dynamics and decided to put my own twist upon his ideas.
Comparing the Six Pillars to Dr. Burns' 5 energies, you'll notice I kept Trend and Momentum, but I swapped out Cycle, Support/Resistance, and Scale for Directional Movement, Stochastic, Fractal, and On-Balance Volume. These changes give you a more dynamic view of market strength, potential reversals, and volume confirmation all in one package.
What Makes This Indicator Unique
The standout feature of the Six Pillars indicator is its Confluence Strength meter. This feature calculates the overall agreement between the six pillars, providing traders with a clear, numerical representation of signal strength.
The strength is calculated by considering the state of each pillar in both the current and comparison timeframes, resulting in a score out of 100.
Here's how it calculates the strength:
It considers the state of each pillar in both the current timeframe and the comparison timeframe.
For each pillar, the absolute value of its state is taken. This means that both strongly bullish (2) and strongly bearish (-2) states contribute equally to the strength.
The absolute values for all six pillars are summed up for both timeframes, resulting in two sums: current_sum and alternate_sum.
These sums are then added together to get a total_sum.
The total_sum is divided by 24 (the maximum possible sum if all pillars were at their strongest states in both timeframes) and multiplied by 100 to get a percentage.
The result is rounded to the nearest integer and capped at a minimum of 1.
This calculation method ensures that the Confluence Strength meter takes into account not only the current timeframe but also the comparison timeframe, providing a more robust measure of overall market sentiment. The resulting score, ranging from 1 to 100, gives traders a clear and intuitive measure of how strongly the pillars agree, with higher scores indicating stronger potential signals.
This approach to measuring signal strength is unique in that it doesn't just rely on a single aspect of price action or volume. Instead, it takes into account multiple factors, providing a more robust and reliable indication of potential market moves. The higher the Confluence Strength score, the more confident traders can be in the signal.
The Confluence Strength meter helps traders in several ways:
It provides a quick and easy way to gauge the overall market sentiment.
It helps prioritize potential trades by identifying the strongest signals.
It can be used as a filter to avoid weaker setups and focus on high-probability trades.
It offers an additional layer of confirmation for other trading strategies or indicators.
By combining the Six Pillars analysis with the Confluence Strength meter, I've created a powerful tool that not only identifies potential trading opportunities but also quantifies their strength, giving traders a significant edge in their decision-making process.
How the Pillars Work (What Determines Bullish or Bearish)
While developing this indicator, I selected and configured six key components that work together to provide a comprehensive view of market conditions. Each pillar is set up to complement the others, creating a synergistic effect that offers traders a more nuanced understanding of price action and volume.
Trend Pillar: Based on two Exponential Moving Averages (EMAs) - a fast EMA (8 period) and a slow EMA (21 period). It determines the trend by comparing these EMAs, with stronger trends indicated when the fast EMA is significantly above or below the slow EMA.
Directional Movement (DM) Pillar: Utilizes the Average Directional Index (ADX) with a default period of 14. It measures trend strength, with values above 25 indicating a strong trend. It also considers the Positive and Negative Directional Indicators (DI+ and DI-) to determine trend direction.
Momentum Pillar: Uses the Moving Average Convergence Divergence (MACD) with customizable fast (12), slow (26), and signal (9) lengths. It compares the MACD line to the signal line to determine momentum strength and direction.
Stochastic Pillar: Employs the Stochastic oscillator with a default period of 13. It identifies overbought conditions (above 80) and oversold conditions (below 20), with intermediate zones between 60-80 and 20-40.
Fractal Pillar: Uses Williams' Fractal indicator with a default period of 3. It identifies potential reversal points by looking for specific high and low patterns over the given period.
On-Balance Volume (OBV) Pillar: Incorporates On-Balance Volume with three EMAs - short (3), medium (13), and long (21) periods. It assesses volume trends by comparing these EMAs.
Each pillar outputs a state ranging from -2 (strongly bearish) to 2 (strongly bullish), with 0 indicating a neutral state. This standardized output allows for easy comparison and aggregation of signals across all pillars.
Users can customize various parameters for each pillar, allowing them to fine-tune the indicator to their specific trading style and market conditions. The multi-timeframe comparison feature also allows users to compare pillar states between the current timeframe and a user-defined comparison timeframe, providing additional context for decision-making.
Design
From a design standpoint, I've put considerable effort into making the Six Pillars indicator visually appealing and user-friendly. The clean and minimalistic design is a key feature that sets this indicator apart.
I've implemented a sleek table layout that displays all the essential information in a compact and organized manner. The use of a dark background (#030712) for the table creates a sleek look that's easy on the eyes, especially during extended trading sessions.
The overall design philosophy focuses on presenting complex information in a simple, intuitive format, allowing traders to make informed decisions quickly and efficiently.
The color scheme is carefully chosen to provide clear visual cues:
White text for headers ensures readability
Green (#22C55E) for bullish signals
Blue (#3B82F6) for neutral states
Red (#EF4444) for bearish signals
This color coding extends to the candle coloring, making it easy to spot when all pillars agree on a bullish or bearish outlook.
I've also incorporated intuitive symbols (↑↑, ↑, →, ↓, ↓↓) to represent the different states of each pillar, allowing for quick interpretation at a glance.
The table layout is thoughtfully organized, with clear sections for the current and comparison timeframes. The Confluence Strength meter is prominently displayed, providing traders with an immediate sense of signal strength.
To enhance usability, I've added tooltips to various elements, offering additional information and explanations when users hover over different parts of the indicator.
How to Use This Indicator
The Six Pillars indicator is a versatile tool that can be used for various trading strategies. Here are some general usage guidelines and specific scenarios:
General Usage Guidelines:
Pay attention to the Confluence Strength meter. Higher values indicate stronger agreement among the pillars and potentially more reliable signals.
Use the multi-timeframe comparison to confirm signals across different time horizons.
Look for alignment between the current timeframe and comparison timeframe pillars for stronger signals.
One of the strengths of this indicator is it can let you know when markets are sideways – so in general you can know to avoid entering when the Confluence Strength is low, indicating disagreement among the pillars.
Customization Options
The Six Pillars indicator offers a wide range of customization options, allowing traders to tailor the tool to their specific needs and trading style. Here are the key customizable elements:
Comparison Timeframe:
Users can select any timeframe for comparison with the current timeframe, providing flexibility in multi-timeframe analysis.
Trend Pillar:
Fast EMA Period: Adjustable for quicker or slower trend identification
Slow EMA Period: Can be modified to capture longer-term trends
Momentum Pillar:
MACD Fast Length
MACD Slow Length
MACD Signal Length These can be adjusted to fine-tune momentum sensitivity
DM Pillar:
ADX Period: Customizable to change the lookback period for trend strength measurement
ADX Threshold: Adjustable to define what constitutes a strong trend
Stochastic Pillar:
Stochastic Period: Can be modified to change the sensitivity of overbought/oversold readings
Fractal Pillar:
Fractal Period: Adjustable to identify potential reversal points over different timeframes
OBV Pillar:
Short OBV EMA
Medium OBV EMA
Long OBV EMA These periods can be customized to analyze volume trends over different timeframes
These customization options allow traders to experiment with different settings to find the optimal configuration for their trading strategy and market conditions. The flexibility of the Six Pillars indicator makes it adaptable to various trading styles and market environments.
Parabolic SAR Waves [MMA]Parabolic SAR Waves
Description:
The "Parabolic SAR Waves " is an advanced version of the traditional Parabolic SAR indicator, customized for TradingView. This script incorporates dynamic acceleration factors and optional gradient coloration to enhance visual interpretation and utility for traders aiming to accurately capture trends and predict potential reversals.
Features:
- Dynamic Acceleration: Adjust the initial, incremental, and maximum values of the acceleration factor to suit various market conditions and trading preferences.
- Gradient Coloring: Use gradient colors to indicate the strength and stability of the trend, providing visual cues that are easy to interpret.
- Trend Visibility: The SAR dots are plotted directly on the price chart, making it easy to spot trend changes and maintain situational awareness.
- Overlay Feature: Designed to overlay directly on the price charts, allowing for seamless integration with other technical analysis tools.
Benefits:
- Trend Detection: Helps in identifying the beginning and potential reversal of trends, aiding in timely decision-making.
- Stop-Loss Management: Utilizes the positions of the SAR dots as dynamic stop-loss points, which helps in risk management.
- Visual Simplicity: Enhances the decision-making process through a straightforward visual representation of trend data.
Parameters:
- Acceleration Start (accel_start): The initial value for the acceleration, set to 0.02 by default.
- Acceleration Increment (accel_inc): The amount by which the acceleration increases, set to 0.005 by default.
- Acceleration Maximum (accel_max): The maximum limit of the acceleration factor, set to 0.1 by default.
- Use Gradient Colors (use_gradient): A boolean toggle to enable or disable gradient coloring, enabled by default.
Indicator Usage:
1. To apply, select this indicator from TradingView's indicator library.
2. Adjust the acceleration parameters based on your specific trading strategy and market analysis.
3. Interpret the indicator signals:
- Green SAR dots below the price bars indicate a bullish trend.
- Red SAR dots above the price bars signify a bearish trend.
- Gradient colors, if enabled, provide insights into the acceleration factor's intensity relative to trend strength.
Alerts:
- Bullish Reversal Alert: Issues a notification if there is a potential upward reversal when the trend shifts to bullish.
- Bearish Reversal Alert: Alerts when there's potential for a downward move as the trend turns bearish.
The "Parabolic SAR Waves " is a robust tool, ideal for traders who need precise, customizable trend-following capabilities that integrate seamlessly with other market analysis strategies. Enhance your trading with detailed trend insights and adaptive parameter controls.
Volume-Adjusted Bollinger BandsThe Volume-Adjusted Bollinger Bands (VABB) indicator is an advanced technical analysis tool that enhances the traditional Bollinger Bands by incorporating volume data. This integration allows the bands to dynamically adjust based on market volume, providing a more nuanced view of price movements and volatility. The key qualities of the VABB indicator include:
1. Dynamic Adjustment with Volume: Traditional Bollinger Bands are based solely on price data and standard deviations. The VABB indicator adjusts the width of the bands based on the volume ratio, making them more responsive to changes in market activity. This means that during periods of high volume, the bands will expand, and during periods of low volume, they will contract. This adjustment helps to reinforce the significance of price movements relative to the central line (VWMA).
2. Volume-Weighted Moving Average (VWMA): Instead of using a simple moving average (SMA) as the central line, the VABB uses the VWMA, which weights prices by volume. This provides a more accurate representation of the average price level, considering the trading volume.
3. Enhanced Signal Reliability: By incorporating volume, the VABB can filter out false signals that might occur in low-volume conditions. This makes the indicator particularly useful for identifying significant price movements that are supported by strong trading activity.
How to Use and Interpret the VABB Indicator
To use the VABB indicator, you need to set it up on your trading platform with the following parameters:
1. BB Length: The number of periods for calculating the Bollinger Bands (default is 20).
2. BB Multiplier: The multiplier for the standard deviation to set the width of the Bollinger Bands (default is 2.0).
3. Volume MA Length: The number of periods for calculating the moving average of the volume (default is 14).
Volume Ratio Smoothing Length: The number of periods for smoothing the volume ratio (default is 5).
Interpretation
1.Trend Identification: The VWMA serves as the central line. When the price is above the VWMA, it indicates an uptrend, and when it is below, it indicates a downtrend. The direction of the VWMA itself can also signal the trend's strength.
2. Volatility and Volume Analysis: The width of the VABB bands reflects both volatility and volume. Wider bands indicate high volatility and/or high volume, suggesting significant price movements. Narrower bands indicate low volatility and/or low volume, suggesting consolidation.
3. Trading Signals:
Breakouts: A price move outside the adjusted upper or lower bands can signal a potential breakout. High volume during such moves reinforces the breakout's validity.
Reversals: When the price touches or crosses the adjusted upper band, it may indicate overbought conditions, while touching or crossing the adjusted lower band may indicate oversold conditions. These conditions can signal potential reversals, especially if confirmed by other indicators or volume patterns.
Volume Confirmation: The volume ratio component helps confirm the strength of price movements. For instance, a breakout accompanied by a high volume ratio is more likely to be sustained than one with a low volume ratio.
Practical Example
Bullish Scenario: If the price crosses above the adjusted upper band with a high volume ratio, it suggests a strong bullish breakout. Traders might consider entering a long position, setting a stop-loss just below the VWMA or the lower band.
Bearish Scenario: Conversely, if the price crosses below the adjusted lower band with a high volume ratio, it suggests a strong bearish breakout. Traders might consider entering a short position, setting a stop-loss just above the VWMA or the upper band.
Conclusion
The Volume-Adjusted Bollinger Bands (VABB) indicator is a powerful tool that enhances traditional Bollinger Bands by incorporating volume data. This dynamic adjustment helps traders better understand market conditions and make more informed trading decisions. By using the VABB indicator, traders can identify significant price movements supported by volume, improving the reliability of their trading signals.
The Volume-Adjusted Bollinger Bands (VABB) indicator is provided for educational and informational purposes only. It is not financial advice and should not be construed as a recommendation to buy, sell, or hold any financial instrument. Trading involves significant risk of loss and is not suitable for all investors. Past performance is not indicative of future results.
Dynamic Candle StrengthHow It Works
Initialization of Dynamic Levels:
The first candle's high and low are taken as the initial dynamic high and dynamic low levels.
If the next candle's close price is above the dynamic high, the candle is colored green, indicating bullish conditions.
If the next candle's close price is below the dynamic low, the candle is colored black, indicating bearish conditions.
If a candle's high and low crossed both the dynamic high and dynamic low, the dynamic high and low levels are updated to the high and low of that candle, but the candle color will continue with the same color as the previous candle.
Maintaining and Updating Dynamic Levels:
The dynamic high and low are only updated if a candle's close is above the current dynamic high or below the current dynamic low.
If the candle does not close above or below these levels, the dynamic high and low remain unchanged.
Visual Signals:
Green Bars: Indicate that the candle's close is above the dynamic high, suggesting bullish conditions.
Black Bars: Indicate that the candle's close is below the dynamic low, suggesting bearish conditions.
This method ensures that the dynamic high and low levels are adjusted in real-time based on the most recent significant price movements, providing a reliable measure of market sentiment.
Growth TrendThis powerful indicator plots the number of growth stocks in an uptrend, providing a comprehensive view of the market's overall direction. By applying a simple moving average, users can quickly gauge the trend and make informed trading decisions.
How does it work?
The script pulls tickers from the S & P 500 Growth ETF. It then plots the number of stocks from the ETF that are trending above a medium-term Moving Average, signaling an uptrend.
A moving average is applied to help understand the trend.
The background is shaded when 3 or more consecutive days are above (green) or below (red) the moving average.
Key Features:
Visual Trend Identification: The indicator shades the background green when three or more consecutive days are above the moving average, indicating a strong uptrend. Conversely, it shades red when three consecutive days are below the moving average, signaling a downtrend.
Breakout Insights: By tracking the trend, traders can identify when breakouts in growth stocks are more likely to occur or fail. This helps traders time their entries and exits more effectively.
Trend Strength Assessment: The indicator provides a quick visual assessment of the trend's strength, enabling traders to adjust their strategies accordingly.
Why is this indicator helpful?
Improved Trading Decisions: By understanding the overall trend and strength of growth stocks, traders can make more informed decisions about when to buy or sell.
Enhanced Risk Management: The indicator helps traders identify potential trend reversals, enabling them to adjust their positions and manage risk more effectively.
Market Insights: The Growth Stock Trend Indicator provides a valuable perspective on the market's overall direction, helping traders stay ahead of the curve.
By incorporating this indicator into their trading strategy, traders can gain a competitive edge and make more informed decisions in the growth stock market.
Dickey-Fuller Test for Mean Reversion and Stationarity **IF YOU NEED EXTRA SPECIAL HELP UNDERSTANDING THIS INDICATOR, GO TO THE BOTTOM OF THE DESCRIPTION FOR AN EVEN SIMPLER DESCRIPTION**
Dickey Fuller Test:
The Dickey-Fuller test is a statistical test used to determine whether a time series is stationary or has a unit root (a characteristic of a time series that makes it non-stationary), indicating that it is non-stationary. Stationarity means that the statistical properties of a time series, such as mean and variance, are constant over time. The test checks to see if the time series is mean-reverting or not. Many traders falsely assume that raw stock prices are mean-reverting when they are not, as evidenced by many different types of statistical models that show how stock prices are almost always positively autocorrelated or statistical tests like this one, which show that stock prices are not stationary.
Note: This indicator uses past results, and the results will always be changing as new data comes in. Just because it's stationary during a rare occurrence doesn't mean it will always be stationary. Especially in price, where this would be a rare occurrence on this test. (The Test Statistic is below the critical value.)
The indicator also shows the option to either choose Raw Price, Simple Returns, or Log Returns for the test.
Raw Prices:
Stock prices are usually non-stationary because they follow some type of random walk, exhibiting positive autocorrelation and trends in the long term.
The Dickey-Fuller test on raw prices will indicate non-stationary most of the time since prices are expected to have a unit root. (If the test statistic is higher than the critical value, it suggests the presence of a unit root, confirming non-stationarity.)
Simple Returns and Log Returns:
Simple and log returns are more stationary than prices, if not completely stationary, because they measure relative changes rather than absolute levels.
This test on simple and log returns may indicate stationary behavior, especially over longer periods. (The test statistic being below the critical value suggests the absence of a unit root, indicating stationarity.)
Null Hypothesis (H0): The time series has a unit root (it is non-stationary).
Alternative Hypothesis (H1): The time series does not have a unit root (it is stationary)
Interpretation: If the test statistic is less than the critical value, we reject the null hypothesis and conclude that the time series is stationary.
Types of Dickey-Fuller Tests:
1. (What this indicator uses) Standard Dickey-Fuller Test:
Tests the null hypothesis that a unit root is present in a simple autoregressive model.
This test is used for simple cases where we just want to check if the series has a consistent statistical property over time without considering any trends or additional complexities.
It examines the relationship between the current value of the series and its previous value to see if the series tends to drift over time or revert to the mean.
2. Augmented Dickey-Fuller (ADF) Test:
Tests for a unit root while accounting for more complex structures like trends and higher-order correlations in the data.
This test is more robust and is used when the time series has trends or other patterns that need to be considered.
It extends the regular test by including additional terms to account for the complexities, and this test may be more reliable than the regular Dickey-Fuller Test.
For things like stock prices, the ADF would be more appropriate because stock prices are almost always trending and positively autocorrelated, while the Dickey-Fuller Test is more appropriate for more simple time series.
Critical Values
This indicator uses the following critical values that are essential for interpreting the Dickey-Fuller test results. The critical values depend on the chosen significance levels:
1% Significance Level: Critical value of -3.43.
5% Significance Level: Critical value of -2.86.
10% Significance Level: Critical value of -2.57.
These critical values are thresholds that help determine whether to reject the null hypothesis of a unit root (non-stationarity). If the test statistic is less than (or more negative than) the critical value, it indicates that the time series is stationary. Conversely, if the test statistic is greater than the critical value, the series is considered non-stationary.
This indicator uses a dotted blue line by default to show the critical value. If the test-static, which is the gray column, goes below the critical value, then the test-static will become yellow, and the test will indicate that the time series is stationary or mean reverting for the current period of time.
What does this mean?
This is the weekly chart of BTCUSD with the Dickey-Fuller Test, with a length of 100 and a critical value of 1%.
So basically, in the long term, mean-reversion strategies that involve raw prices are not a good idea. You don't really need a statistical test either for this; just from seeing the chart itself, you can see that prices in the long term are trending and no mean reversion is present.
For the people who can't understand that the gray column being above the blue dotted line means price doesn't mean revert, here is a more simple description (you know you are):
Average (I have to include the meaning because they may not know what average is): The middle number is when you add up all the numbers and then divide by how many numbers there are. EX: If you have the numbers 2, 4, and 6, you add them up to get 12, and then divide by 3 (because there are 3 numbers), so the average is 4. It tells you what a typical number is in a group of numbers.
This indicator checks if a time series (like stock prices) tends to return to its average value or time.
Raw prices, which is just the regular price chart, are usually not mean-reverting (It's "always" positively autocorrelating but this group of people doesn't like that word). Price follows trends.
Simple returns and log returns are more likely to have periods of mean reversion.
How to use it:
Gray Column (the gray bars) Above the Blue Dotted Line: The price does not mean revert (non-stationary).
Gray Column Below Blue Line: The time series mean reverts (stationary)
So, if the test statistic (gray column) is below the critical value, which is the blue dotted line, then the series is stationary and mean reverting, but if it is above the blue dotted line, then the time series is not stationary or mean reverting, and strategies involving mean reversion will most likely result in a loss given enough occurrences.
Market Sentiment Technicals [LuxAlgo]The Market Sentiment Technicals indicator synthesizes insights from diverse technical analysis techniques, including price action market structures, trend indicators, volatility indicators, momentum oscillators, and more.
The indicator consolidates the evaluated outputs from these techniques into a singular value and presents the combined data through an oscillator format, technical rating, and a histogram panel featuring the sentiment of each component alongside the overall sentiment.
🔶 USAGE
The Market Sentiment Technicals indicator is a tool able to swiftly and easily gauge market sentiment by consolidating the individual sentiment from multiple technical analysis techniques applied to market data into a single value, allowing users to asses if the market is uptrending, consolidating, or downtrending.
The tool includes various components and presentation formats, each described in the sub-sections below.
🔹Indicators Sentiment Panel
The indicators sentiment panel provides normalized sentiment scores for each supported indicator, along with a synthesized representation derived from the average of all individual normalized sentiments.
🔹Market Sentiment Meter
The market sentiment meter is obtained from the synthesized representation derived from the average of all individual normalized sentiments. It allows users to quickly and easily gauge the overall market sentiment.
🔹Market Sentiment Oscillator
The market sentiment oscillator provides a visual means to monitor the current and historical strength of the market. It assists in identifying the trend direction, trend momentum, and overbought and oversold conditions, aiding in the anticipation of potential trend reversals.
Divergence occurs when there is a difference between what the price action is indicating and what the market sentiment oscillator is indicating, helping traders assess changes in the price trend.
🔶 DETAILS
The indicator employs a range of technical analysis techniques to interpret market data. Each group of indicators provides valuable insights into different aspects of market behavior.
🔹Momentum Indicators
Momentum indicators assess the speed and change of price movements, often indicating whether a trend is strengthening or weakening.
Relative Strength Index (RSI): Measures the magnitude of recent price changes to evaluate overbought or oversold conditions.
Stochastic %K: Compares the closing price to the range over a specified period to identify potential reversal points.
Stochastic RSI Fast: Combines features of Stochastic oscillators and RSI to gauge both momentum and overbought/oversold levels efficiently.
Commodity Channel Index (CCI): Measures the deviation of an asset's price from its statistical average to determine trend strength and overbought and oversold conditions.
Bull Bear Power: Evaluates the strength of buying and selling pressure in the market.
🔹Trend Indicators
Trend indicators help traders identify the direction of a market trend.
Moving Averages: Provides a smoothed representation of the underlying price data, aiding in trend identification and analysis.
Bollinger Bands: Consists of a middle band (typically a simple moving average) and upper and lower bands, which represent volatility levels of the market.
Supertrend: A trailing stop able to identify the current direction of the trend.
Linear Regression: Fits a straight line to past data points to predict future price movements and identify trend direction.
🔹Market Structures
Market Structures: Analyzes the overall pattern of price movements, including Break of Structure (BOS), Market Structure Shifts (MSS), also referred to as Change of Character (CHoCH), aiding in identifying potential market turning and continuation points.
🔹The Normalization Technique
The normalization technique employed for trend indicators relies on buy-sell signals. The script tracks price movements and normalizes them based on these signals.
normalize(buy, sell, smooth)=>
var os = 0
var float max = na
var float min = na
os := buy ? 1 : sell ? -1 : os
max := os > os ? close : os < os ? max : math.max(close, max)
min := os < os ? close : os > os ? min : math.min(close, min)
ta.sma((close - min)/(max - min), smooth) * 100
In this Pine Script snippet:
The variable os tracks market sentiment, taking a value of 1 for buy signals and -1 for sell signals, indicating bullish and bearish sentiments, respectively.
max and min are used to identify extremes in sentiment and are updated based on changes in os . When market sentiment shifts from buying to selling (or vice versa), max and min adjust accordingly.
Normalization is achieved by comparing current price levels to historical extremes in sentiment. The result is smoothed by default using a 3-period simple moving average. Users have the option to customize the smoothing period via the script settings input menu.
🔶 SETTINGS
🔹Generic Settings
Timeframe: This option selects the timeframe for calculating sentiment. If a timeframe lower than the chart's is chosen, calculations will be based on the chart's timeframe.
Horizontal Offset: Determines the distance at which the visual components of the indicator will be displayed from the primary chart.
Gradient Colors: Allows customization of gradient colors.
🔹Indicators Sentiment Panel
Indicators Sentiment Panel: Toggle the visibility of the indicators sentiment panel.
Panel Height: Determines the height of the panel.
🔹Market Sentiment Meter
Market Sentiment Meter: Toggle the visibility of the market sentiment meter (technical ratings in the shape of a speedometer).
🔹Market Sentiment Oscillator
Market Sentiment Oscillator: Toggle the visibility of the market sentiment oscillator.
Show Divergence: Enables detection of divergences based on the selected option.
Oscillator Line Width: Customization option for the line width.
Oscillator Height: Determines the height of the oscillator.
🔹Settings for Individual Components
In general,
Source: Determines the data source for calculations.
Length: The period to be used in calculations.
Smoothing: Degree of smoothness of the evaluated values.
🔹Normalization Settings - Trend Indicators
Smoothing: The period used in smoothing normalized values, where normalization is applied to moving averages, Bollinger Bands, Supertrend, VWAP bands, and market structures.
🔶 LIMITATIONS
Like any technical analysis tool, the Market Sentiment Technicals indicator has limitations. It's based on historical data and patterns, which may not always accurately predict future market movements. Additionally, market sentiment can be influenced by various factors, including economic news, geopolitical events, and market psychology, which may not be fully captured by technical analysis alone.
Chande Kroll Trend Strategy (SPX, 1H) | PINEINDICATORSThe "Chande Kroll Stop Strategy" is designed to optimize trading on the SPX using a 1-hour timeframe. This strategy effectively combines the Chande Kroll Stop indicator with a Simple Moving Average (SMA) to create a robust method for identifying long entry and exit points. This detailed description will explain the components, rationale, and usage to ensure compliance with TradingView's guidelines and help traders understand the strategy's utility and application.
Objective
The primary goal of this strategy is to identify potential long trading opportunities in the SPX by leveraging volatility-adjusted stop levels and trend-following principles. It aims to capture upward price movements while managing risk through dynamically calculated stops.
Chande Kroll Stop Parameters:
Calculation Mode: Offers "Linear" and "Exponential" options for position size calculation. The default mode is "Exponential."
Risk Multiplier: An adjustable multiplier for risk management and position sizing, defaulting to 5.
ATR Period: Defines the period for calculating the Average True Range (ATR), with a default of 10.
ATR Multiplier: A multiplier applied to the ATR to set stop levels, defaulting to 3.
Stop Length: Period used to determine the highest high and lowest low for stop calculation, defaulting to 21.
SMA Length: Period for the Simple Moving Average, defaulting to 21.
Calculation Details:
ATR Calculation: ATR is calculated over the specified period to measure market volatility.
Chande Kroll Stop Calculation:
High Stop: The highest high over the stop length minus the ATR multiplied by the ATR multiplier.
Low Stop: The lowest low over the stop length plus the ATR multiplied by the ATR multiplier.
SMA Calculation: The 21-period SMA of the closing price is used as a trend filter.
Entry and Exit Conditions:
Long Entry: A long position is initiated when the closing price crosses over the low stop and is above the 21-period SMA. This condition ensures that the market is trending upward and that the entry is made in the direction of the prevailing trend.
Exit Long: The long position is exited when the closing price falls below the high stop, indicating potential downward movement and protecting against significant drawdowns.
Position Sizing:
The quantity of shares to trade is calculated based on the selected calculation mode (linear or exponential) and the risk multiplier. This ensures position size is adjusted dynamically based on current market conditions and user-defined risk tolerance.
Exponential Mode: Quantity is calculated using the formula: riskMultiplier / lowestClose * 1000 * strategy.equity / strategy.initial_capital.
Linear Mode: Quantity is calculated using the formula: riskMultiplier / lowestClose * 1000.
Execution:
When the long entry condition is met, the strategy triggers a buy signal, and a long position is entered with the calculated quantity. An alert is generated to notify the trader.
When the exit condition is met, the strategy closes the position and triggers a sell signal, accompanied by an alert.
Plotting:
Buy Signals: Indicated with an upward triangle below the bar.
Sell Signals: Indicated with a downward triangle above the bar.
Application
This strategy is particularly effective for trading the SPX on a 1-hour timeframe, capitalizing on price movements by adjusting stop levels dynamically based on market volatility and trend direction.
Default Setup
Initial Capital: $1,000
Risk Multiplier: 5
ATR Period: 10
ATR Multiplier: 3
Stop Length: 21
SMA Length: 21
Commission: 0.01
Slippage: 3 Ticks
Backtesting Results
Backtesting indicates that the "Chande Kroll Stop Strategy" performs optimally on the SPX when applied to the 1-hour timeframe. The strategy's dynamic adjustment of stop levels helps manage risk effectively while capturing significant upward price movements. Backtesting was conducted with a realistic initial capital of $1,000, and commissions and slippage were included to ensure the results are not misleading.
Risk Management
The strategy incorporates risk management through dynamically calculated stop levels based on the ATR and a user-defined risk multiplier. This approach ensures that position sizes are adjusted according to market volatility, helping to mitigate potential losses. Trades are sized to risk a sustainable amount of equity, adhering to the guideline of risking no more than 5-10% per trade.
Usage Notes
Customization: Users can adjust the ATR period, ATR multiplier, stop length, and SMA length to better suit their trading style and risk tolerance.
Alerts: The strategy includes alerts for buy and sell signals to keep traders informed of potential entry and exit points.
Pyramiding: Although possible, the strategy yields the best results without pyramiding.
Justification of Components
The Chande Kroll Stop indicator and the 21-period SMA are combined to provide a robust framework for identifying long trading opportunities in trending markets. Here is why they work well together:
Chande Kroll Stop Indicator: This indicator provides dynamic stop levels that adapt to market volatility, allowing traders to set logical stop-loss levels that account for current price movements. It is particularly useful in volatile markets where fixed stops can be easily hit by random price fluctuations. By using the ATR, the stop levels adjust based on recent market activity, ensuring they remain relevant in varying market conditions.
21-Period SMA: The 21-period SMA acts as a trend filter to ensure trades are taken in the direction of the prevailing market trend. By requiring the closing price to be above the SMA for long entries, the strategy aligns itself with the broader market trend, reducing the risk of entering trades against the overall market direction. This helps to avoid false signals and ensures that the trades are in line with the dominant market movement.
Combining these two components creates a balanced approach that captures trending price movements while protecting against significant drawdowns through adaptive stop levels. The Chande Kroll Stop ensures that the stops are placed at levels that reflect current volatility, while the SMA filter ensures that trades are only taken when the market is trending in the desired direction.
Concepts Underlying Calculations
ATR (Average True Range): Used to measure market volatility, which informs the stop levels.
SMA (Simple Moving Average): Used to filter trades, ensuring positions are taken in the direction of the trend.
Chande Kroll Stop: Combines high and low price levels with ATR to create dynamic stop levels that adapt to market conditions.
Risk Disclaimer
Trading involves substantial risk, and most day traders incur losses. The "Chande Kroll Stop Strategy" is provided for informational and educational purposes only. Past performance is not indicative of future results. Users are advised to adjust and personalize this trading strategy to better match their individual trading preferences and risk tolerance.
Ticker Performance ComparisonTicker Performance Comparison Indicator
With this tool you can compare how three different tickers of your choice have performed over a specific period you choose. It can be used on any timeframe.
As you can see in the image above, I am comparing Nvidia, Bitcoin and Wadzpay over a 365 day period. This shows me at glance which asset has done better and by how much.
It shows how the closing prices have changed from the start of your chosen period to now, by automatically drawing lines on the same scale.
Key Features:
Lookback Period: You decide how many bars (days, weeks, etc.) back to look from today.
Three Tickers: Enter up to three different ticker symbols to see how they stack up against each other
Percentage Change: The tool calculates how much each ticker's closing price has changed, in percentage terms, from the start of your lookback period.
Performance Labels: Labels at the end of the period show the percentage change for each ticker.
Important:
Ignore the lines that are drawn before your lookback period: The lines before your chosen lookback period might be misleading. They appear due to the way historical data is processed and should be ignored. Only consider the data and trends from the start of the lookback period you entered to the present for an accurate comparison.
Use this tool to easily compare how different assets have performed over the timeframe that matters to you.
Volume-Enhanced Momentum Moving Average (VEMMA)Volume-Enhanced Momentum Moving Average (VEMMA)
Overview:
The Volume-Enhanced Momentum Moving Average (VEMMA) helps you spot market trends by combining momentum and volume as a moving average. This unique moving average adjusts itself based on the strength and activity of the market, giving you a clearer picture of what’s happening.
How It Works:
1. Key Settings (all of these are adjustable in the settings panel of the indicator):
◦ Base Length: Looks back over the last 50 days by default.
◦ Momentum Length: Uses the past 14 days to measure market strength.
◦ Volume Length: Uses the past 30 days to average trading volume.
◦ High/Low Thresholds: Considers RSI values above 70 as high momentum and below 30 as low momentum.
2. Momentum and Volume:
◦ Momentum: Calculated using the Relative Strength Index (RSI) to see if the market is gaining or losing strength.
◦ Volume: Average trading volume is calculated over the last 30 days to gauge trading activity.
3. VEMMA Calculation:
◦ For each of the past 50 days:
▪ Check Momentum: If RSI > 70, it’s high momentum; if RSI < 30, it’s low.
▪ Weight by Volume: High momentum days with high volume get more weight; low momentum days get less.
▪ Combine: Multiply the closing price by this weight and sum it up.
◦ Average: Divide the total by 50 to get the VEMMA value.
4. Visuals:
◦ Lines: Two lines, VEMMA1 (blue) and VEMMA2 (orange), show the adjusted moving averages.
◦ Colours: Background colors help you quickly spot high (green) and low (red) momentum periods.
How to Use:
• Spot Trends: Rising VEMMA lines suggest an uptrend; falling lines suggest a downtrend.
• Confirm Signals: When both VEMMA1 and VEMMA2 move together, it indicates a strong trend.
• Identify Reversals: Watch for background color changes from green to red or vice versa to catch potential trend reversals.
If the market has been strong and active, the VEMMA line will rise more sharply. If the market is weak and quiet, the line will be smoother.
Benefits:
• Integrated View: Combines market strength and trading activity for a fuller picture.
• Responsive: Adapts to significant market changes, highlighting key movements.
• Easy to Read: Clear visuals with color-coded backgrounds make interpretation simple.
Remember, just like any other indicator, this is not supposed to be used alone. Use it as part of your greater trading strategy. I do however believe it works exceptionally well for finding longer term trends early. The default VEMMA settings work very well as replacement for the EMA 200. Try it and see how it goes. Play around with the settings. Feedback appreciated.
Bayesian Trend Indicator [ChartPrime]Bayesian Trend Indicator
Overview:
In probability theory and statistics, Bayes' theorem (alternatively Bayes' law or Bayes' rule), named after Thomas Bayes, describes the probability of an event, based on prior knowledge of conditions that might be related to the event.
The "Bayesian Trend Indicator" is a sophisticated technical analysis tool designed to assess the direction of price trends in financial markets. It combines the principles of Bayesian probability theory with moving average analysis to provide traders with a comprehensive understanding of market sentiment and potential trend reversals.
At its core, the indicator utilizes multiple moving averages, including the Exponential Moving Average (EMA), Simple Moving Average (SMA), Double Exponential Moving Average (DEMA), and Volume Weighted Moving Average (VWMA) . These moving averages are calculated based on user-defined parameters such as length and gap length, allowing traders to customize the indicator to suit their trading strategies and preferences.
The indicator begins by calculating the trend for both fast and slow moving averages using a Smoothed Gradient Signal Function. This function assigns a numerical value to each data point based on its relationship with historical data, indicating the strength and direction of the trend.
// Smoothed Gradient Signal Function
sig(float src, gap)=>
ta.ema(source >= src ? 1 :
source >= src ? 0.9 :
source >= src ? 0.8 :
source >= src ? 0.7 :
source >= src ? 0.6 :
source >= src ? 0.5 :
source >= src ? 0.4 :
source >= src ? 0.3 :
source >= src ? 0.2 :
source >= src ? 0.1 :
0, 4)
Next, the indicator calculates prior probabilities using the trend information from the slow moving averages and likelihood probabilities using the trend information from the fast moving averages . These probabilities represent the likelihood of an uptrend or downtrend based on historical data.
// Define prior probabilities using moving averages
prior_up = (ema_trend + sma_trend + dema_trend + vwma_trend) / 4
prior_down = 1 - prior_up
// Define likelihoods using faster moving averages
likelihood_up = (ema_trend_fast + sma_trend_fast + dema_trend_fast + vwma_trend_fast) / 4
likelihood_down = 1 - likelihood_up
Using Bayes' theorem , the indicator then combines the prior and likelihood probabilities to calculate posterior probabilities, which reflect the updated probability of an uptrend or downtrend given the current market conditions. These posterior probabilities serve as a key signal for traders, informing them about the prevailing market sentiment and potential trend reversals.
// Calculate posterior probabilities using Bayes' theorem
posterior_up = prior_up * likelihood_up
/
(prior_up * likelihood_up + prior_down * likelihood_down)
Key Features:
◆ The trend direction:
To visually represent the trend direction , the indicator colors the bars on the chart based on the posterior probabilities. Bars are colored green to indicate an uptrend when the posterior probability is greater than 0.5 (>50%), while bars are colored red to indicate a downtrend when the posterior probability is less than 0.5 (<50%).
◆ Dashboard on the chart
Additionally, the indicator displays a dashboard on the chart , providing traders with detailed information about the probability of an uptrend , as well as the trends for each type of moving average. This dashboard serves as a valuable reference for traders to monitor trend strength and make informed trading decisions.
◆ Probability labels and signals:
Furthermore, the indicator includes probability labels and signals , which are displayed near the corresponding bars on the chart. These labels indicate the posterior probability of a trend, while small diamonds above or below bars indicate crossover or crossunder events when the posterior probability crosses the 0.5 threshold (50%).
The posterior probability of a trend
Crossover or Crossunder events
◆ User Inputs
Source:
Description: Defines the price source for the indicator's calculations. Users can select between different price values like close, open, high, low, etc.
MA's Length:
Description: Sets the length for the moving averages used in the trend calculations. A larger length will smooth out the moving averages, making the indicator less sensitive to short-term fluctuations.
Gap Length Between Fast and Slow MA's:
Description: Determines the difference in lengths between the slow and fast moving averages. A higher gap length will increase the difference, potentially identifying stronger trend signals.
Gap Signals:
Description: Defines the gap used for the smoothed gradient signal function. This parameter affects the sensitivity of the trend signals by setting the number of bars used in the signal calculations.
In summary, the "Bayesian Trend Indicator" is a powerful tool that leverages Bayesian probability theory and moving average analysis to help traders identify trend direction, assess market sentiment, and make informed trading decisions in various financial markets.
Entry Fragger - Strategy
For basic instructions please visit my other script "Entry Fragger".
The Signal Logic is explained there.
v1.4:
- Added advanced backtesting with fully customizable entries.
- Fully automated Buy Signals (profitable).
- Adjustable timeframes for signal logic. (requested)
Every setting affects the accuracy and profitability greatly now, based on settings applied.
The strategy performs best on high timeframes with larger capital and no leverage.
Useless for Forex, but absolutely smashes stocks and crypto on mid to high timeframes.
Please read through my other scripts description.
Set values as preferred and try your assets.
It does NOT work on low timeframes and forex!
Hint: BTC 4H, Custom Timeframe 1h, Moon Mode and Show Sell Signals enabled, R2R: 2.
MTF Supertrend [CryptoSea]The MTF Supertrend Indicator is a versatile tool crafted to enhance trend analysis across multiple timeframes. Leveraging the reliable Supertrend formula, it provides traders with a comprehensive view of market trends and potential reversal points.
Key Features
Multi Timeframe Analysis: Tracks Supertrend signals over a variety of timeframes, offering a broad perspective on market direction.
Percentage Threshold Display: Filters out Supertrend data that is not within a specified percentage of the current price, keeping the display focused on relevant trends.
Adaptive Visual Display: Features a dynamic table that shows the current Supertrend status, which is fully customizable to the user's display preferences.
Customizable Sensitivity: Users can fine-tune the factor and ATR period settings, allowing for personalized trend sensitivity.
How it Works
Supertrend Calculation: Computes the Supertrend using the Average True Range (ATR) multiplied by a customizable factor, detecting changes in volatility and trend.
Higher Timeframe Filtering: Prioritizes higher timeframe trends over the current chart's timeframe to avoid chart clutter and focus on the most significant trends.
Colour-Coded Trends: Utilizes colour coding to clearly indicate bullish and bearish trends, aiding quick visual analysis.
Responsive Display Options: Includes a switchable table view to overlay trend information on the chart, with options for dark and light themes.
Benefits for Different Trading Styles
Day Traders: Use real-time updates to catch short-term trend reversals and ride the momentum for quick profits.
Swing Traders: Benefit from viewing medium to long-term trends to formulate strategies that span several days or weeks.
Position Traders: Utilize the monthly supertrend data to make long-term investment decisions based on prevailing market directions.
Application
Strategic Decision-Making: Assists traders in making informed decisions by providing a layered view of trend directions across timeframes.
Trend Confirmation: Reinforces trading strategies by confirming trends with higher timeframe Supertrend alignment.
Customized Analysis: Adapts to various trading styles with input settings that control the display and sensitivity of trend data.
The MTF Supertrend Indicator by is a powerful addition to the trader's toolkit, enhancing multi-timeframe trend analysis and contributing to a strategic trading approach in volatile markets.
HTF Candle Consistency [LuxAlgo]The HTF Candle Consistency indicator tracks the most recent candle sentiment in up to 10 Higher Timeframe (HTF) and colors the user chart candle bodies based on the dominating sentiment. Users can weigh specific timeframes more significantly.
Additionally, the script provides an HTF dashboard that displays the current directional readouts for each selected timeframe to allow for an independent HTF analysis.
🔶 USAGE
Analyzing the movement and direction of higher timeframe candles can help filter out noisy variation from the price, and could be utilized to time trades better. When the majority of recent candles from the selected timeframes are bullish, the candle body will be colored in green, if this majority is bearish it will be colored in red.
Using the "Tricolor" coloring mode introduces a third coloring option, and is used when there isn't a clear sentiment majority across the selected timeframes, this option effectively allows for filtering out unwanted trends.
Users can control the variations to be filtered out depending on their chart timeframe and the enabled HTF's in the settings. Using low timeframes with higher HTF's will gray out a larger amount of candles, disabling these timeframes, changing them, or giving higher weighting to lower HTF's will allow for obtaining more dominance detection, and as such less grayed-out candles.
As seen above, the weight function allows for precise control over the specific elements being analyzed.
This indicator also features a dashboard for viewing each timeframe's direction at the same time. By doing so, it allows for better judgment on the specific elements composing the current HTF majority.
🔶 DETAILS
This indicator is only intended for Higher Timeframe Analysis, all the input timeframes should be kept equal to or lower than your current chart timeframe.
NOTE: This is necessary for data accuracy in most multi-timeframe indicators, and is generally a good practice to keep in mind.
As a reminder, the dashboard will display the timeframe in red text if a lower timeframe is detected. It is recommended to change or disable this timeframe for your analysis.
This indicator can support up to 10 timeframes, each with independent weightings.
NOTE: When a timeframe is disabled, the dashboard will no longer display that timeframe, and it will not be used in calculations.
🔹 Candle Coloring
Candle color can be selected between 3 modes.
Tricolor (Default): Changes the color based on a 3-part split of the possible data sum range.
Bicolor: Changes the color based on the sum being greater than or less than 0.
Gradient: Uses a 3-color gradient to determine the candle color based on the possible data sum range.
🔶 SETTINGS
🔹 Higher Timeframes
Toggle: Enable/Disable the timeframe from analysis.
Timeframe: Select which timeframe to use for analysis. <- NOTE: This input reflects any custom intervals you have created on Tradingview.
Weight: Determines the Weighting (Multiplier) for the timeframe's direction.
🔹 Style
Color Mode: (More details above) Determines the color mode in use for coloring candles.
🔹 Dashboard
General Settings: Control Toggle, Location, & Size of Dashboard on your chart.
Orientation: Choose to display the dashboard in a "Vertical (default)" or "Horizontal" orientation to fit your style.
Volume Delta [hapharmonic]Volume Delta: Volume Delta is an indicator that simplifies how you analyze trading volumes and the percentage of buy-sell activities effortlessly.
As a trader or market analyst, understanding underlying volume and trade flows is critical. The Volume Delta indicator provides thorough insight into both the total volume and the percentage of buying versus selling within the current candlestick. This information is pivotal for those looking to gauge market momentum and sentiment more effectively.
Additionally, the Volume Delta indicator can plot the candlestick colors based on the percentage of the dominant buying or selling volume. The area between the open and close prices of the candlestick is considered 100% and fills with colors corresponding to the predominant volume at that percentage.
Volume Delta also integrates the concept of Net volume. This component is crucial as it reveals the real market sentiment by calculating the difference between the volume of trades executed at an uptick and those at a downtick.
🟠 Overview
This indicator now displays in two layouts. Recently, Tradingview introduced the "force_overlay=true" function in Pine Script , allowing plots to be moved to the main chart. Thus, all displays are from the same indicator.
🟠 USAGE
From the data displayed in 'plot.style_columns' , the peak area represents the entire volume, accounting for 100%. Within this area, there are two color levels indicating volume. If one type of volume, whether buying or selling, exceeds the other, the larger volume will be positioned behind and the smaller in front. This arrangement prevents the scenario where a higher buying volume obscures the smaller selling volume. Therefore, the two colors can be switched between the front and the back as needed.
As you can see, the 12 and 26-day Exponential Moving Averages (EMAs) are used, with the Volume Confirmation Length set at 6. Therefore, the crossing of the EMAs proceeds normally, but it is highlighted with three triangular arrows to indicate a high likelihood of a valid crossover. However, if the volume is insufficient, these markers won't be displayed, although the EMA crossover will still occur as usual. This can be useful for using volume to verify the significance of the EMA crossover.
🟠 Setting
If you enable the label, please be aware that the chart size will shrink, causing the candlestick display to become unclear. Therefore, you might need to select "Logarithmic" at the bottom right of your screen, or for mobile applications, press and hold on the price scale and choose "Logarithmic" to adjust the scale appropriately.
Enjoy!
Trend ChameleonThe Trend Chameleon, originally developed by Alex Cole for the Bloomberg Terminal, is a powerful tool designed to simplify trend identification and illuminate potential trading opportunities. It leverages a clear visual display to decode market movements, making it useful for traders of all experience levels.
🟠 Overview
Here's an illustration of how the indicator performs for ES (S&P 500 E-mini Future) on the daily chart:
Trend Chameleon employs a color-coded candle scheme, with each color corresponding to a specific level of trend strength. Purple candles represent the strongest bearish trends, while teal candles signal the most potent bullish momentum. Between these extremes lie red, yellow, and green candles, providing a spectrum of trend direction. This intuitive color coding allows you to quickly grasp the prevailing market sentiment and identify potential entry and exit points for your trades.
🟠 Algorithm
Under the hood, Trend Chameleon evaluates four conditions to provide a directional strength score:
1. Whether the MACD value is positive.
2. Whether the SMA 50 of open prices is above the SMA 50 of the close prices.
3. Whether the ROC indicator value is positive.
4. Whether the current close price is above the SMA 50.
The total number of fulfilled conditions (0 to 4) determines the trend strength, with 0 indicating the most bearish and 4 signifying the strongest bullish trend. This score is then visually represented by coloring the bars on the chart.
🟠 Note
If you don't see the bars being properly colored after adding this indicator, please ensure Trend Chameleon is positioned on top of all other indicators in your chart. This can be easily achieved by hovering over the indicator's name, clicking the three dots, selecting "Visual Order," and then choosing "Bring to front."
Swing Failure Pattern (SFP) [LuxAlgo]The Swing Failure Pattern indicator highlights Swing Failure Patterns (SFP) on the user chart, a pattern occurring during liquidity generation from significant market participants.
A Confirmation level used to confirm a trend reversal is also included. Users can additionally filter out SFP based on a set Volume % Threshold .
🔶 USAGE
Swing failure patterns occur when candle wicks exceed (above/below) a recent swing level but close back below/above it, and occur from more significant market participants engineering liquidity. This pattern can be indicative of a potential trend reversal.
A label and an accentuated wick line highlight the SFP (both can be disabled).
Using a higher "Swings" period will not return different SFP but will however potentially reduce their detection rate.
🔹 Confirmation Level
The confirmation level is the highest point between the previous swing and SFP for a bullish SFP, and the lowest point for a bearish SFP. This level allows confirming a trend reversal after an SFP once the price breaks it.
A small triangle will be displayed when the price closes beyond the confirmation level.
A more reactive and contrarian approach could use the SFP as an entry point, and the confirmation level for taking (partial) profit, or stop loss. The example below shows a possible scenario:
🔹 Volume % Threshold
During the occurrence of an SFP, the Volume % Threshold option allows comparing the cumulative volume outside the Swing level to the total volume of the candle. The following options are included:
Volume outside swing < Threshold: Volume outside the Swing level needs to be lower than x % of total candle volume. Prevent excessive liquidity generation.
Volume outside swing > Threshold: Volume outside the Swing level needs to be higher than x % of total candle volume. Requires more significant liquidity to be generated.
None: No extra filter is applied
Note that in the above case, the left SFP is no longer highlighted because the volume above the swing level was higher than the 25% threshold of the total volume.
When we change the setting to "Volume outside swing > Threshold", we get the reversed situation.
The "Volume outside Swing level" is obtained using intrabar - Lower TimeFrame (LTF) data.
At the intrabar (LTF) level, there are a maximum of 100K bars available. When using the Volume % Threshold filter, a vertical line will highlight the maximum period during which intrabars are available.
🔶 DETAILS
🔹 LTF Settings
When 'Auto' is enabled (Settings, LTF), the LTF will be the nearest possible x times smaller TF than the current TF. When 'Premium' is disabled, the minimum TF will always be 1 minute to ensure TradingView plans lower than Premium don't get an error.
Examples with current Daily TF (when Premium is enabled):
500 : 3-minute LTF
1500 (default): 1-minute LTF
5000: 30 seconds LTF (1 minute if Premium is disabled)
The concerning LTF can be seen at the right-top (default) corner.
🔶 SETTINGS
Swings: Period used for the swing detection, with higher values returning longer-term Swing Levels.
Bullish SFP: enable/disable bullish Swing Failure Patterns.
Bearish SFP: enable/disable bearish Swing Failure Patterns.
🔹 Volume Validation
Validation:
Volume outside swing < Threshold: The volume outside the swing level needs to be lower than x % of the total volume.
Volume outside swing > Threshold: The volume outside the swing level needs to be higher than x % of the total volume.
None: No extra validation is applied.
Volume % Threshold: % of total volume as threshold.
Auto + multiple: Adjusts the initial set LTF
LTF: LTF setting
Premium: Enable when your TradingView plan is Premium or higher
🔹 Dashboard
Show Dashboard: Display applied Lower Timeframe (LTF)
Location: Location of the dashboard
Size: Size of the dashboard
🔹 Style
Swing Lines
Confirmation Lines
Swing Failure Wick
Swing Failure Label
Lines / Labels: Color for lines and labels
SFP Wicks: Color for SFP wick line
Bayesian Bias OscillatorWhat is a Bayes Estimator?
Bayesian estimation, or Bayesian inference, is a statistical method for estimating unknown parameters of a probability distribution based on observed data and prior knowledge about those parameters. At first , you will need a prior probability distribution, which is a prior belief about the distribution of the parameter that you are interested in estimating. This distribution represents your initial beliefs or knowledge about the parameter value before observing any data. Second , you need a likelihood function, which represents the probability of observing the data given different values of the parameter. This function quantifies how well different parameter values explain the observed data. Then , you will need a posterior probability distribution by combining the prior distribution and the likelihood function to obtain the posterior distribution of the parameter. The posterior distribution represents the updated belief about the parameter value after observing the data.
Bayesian Bias Oscillator
This tool calculates the Bayes bias of returns, which are directional probabilities that provide insight on the "trend" of the market or the directional bias of returns. It comes with two outputs: the default one, which is the Z-Score of the Bayes Bias, and the regular raw probability, which can be switched on in the settings of the indicator.
The Z-Score output value doesn't tell you the probability, but it does tell you how much of a standard deviation the value is from the mean. It uses both probabilities, the probability of a positive return and the probability of a negative return, which is just (1 - probability of a positive return).
The probability output value shows you the raw probability of a positive return vs. the probability of a negative return. The probability is the value of each line plotted (blue is the probability of a positive return, and purple is the probability of a negative return).
FVG Positioning Average [LuxAlgo]The FVG Positioning Average indicator aims to uncover potential price levels of interest by averaging together recent Fair Value Gap (FVG) initiation levels.
This indicator is grounded in the theory that significant buying or selling activity is the primary catalyst for creating FVGs.
By averaging together the prices where each FVG initiated, we may potentially reveal where major participants are positioned.
🔶 USAGE
By analyzing the average price of bullish or bearish FVGs, users can identify potential support or resistance areas where the larger participants may re-enter or defend their positions.
These areas could be used to adjust entries and exits or assist with risk management such as take-profit or stop-loss levels.
The indicator displays 2 lines, the Bull Average and the Bear Average.
The Bull Average is only displayed when the price holds above the bull Average.
The Bear Average is only displayed when the price holds below the bear average.
When only one average is displayed alone, this level is seen as support or resistance, it is anticipated that this level would be defended for the current trend to stay valid.
When both averages are displayed simultaneously, it can be interpreted as one side attempting to take over the trend.
The movements and reactions during these attempts can be analyzed to provide helpful information about where the price might be headed.
Possible outcomes:
Trend Confirmation/Re-Entry (From Weak Attempts)
Trend Reversal (Creating Support or Resistance)
Consolidation (Oscillating between/around Bull & Bear Averages)
🔶 DETAILS
🔹 Lookback Types
This indicator includes 2 lookback types:
Bar Count: Uses Bars to determine what data to include. This type can be utilized for averages that are more locally relevant to the current chart data.
FVG Count: Uses a specific # of FVGs for calculations. This type can be utilized for a continuous & consistent view, typically relevant with longer term analysis.
Note: When using bar lookback, if no data is in range, no lines will be displayed.
Below is an example of the 'FVG Count' Display.
🔹 Initiation Levels
Initiation Levels are the specific price points where each FVG starts, these are the last points the price was traded at before creating the gap.
Bull Initiation Level: Lowest Point (Bottom) of FVG
Bear Initiation Level: Highest Point (Top) of FVG
🔹 FVG Display
Each FVG being used for the current calculation of averages is displayed on the chart for reference.
Note: If you prefer to not display the FVGs, they can be toggled off in the settings, uncheck "Show FVGs on Chart".
🔶 Settings
FVG Lookback: As mentioned above in the 'Lookback Types', this sets the number of FVGs or Bars to use for consideration.
Lookback Type: As also mentioned above in 'Lookback Types', this determines the method of lookback to be used.
ATR Multiplier: The FVGs are required to have a Greater Width than (ATR * Multiplier) in order to be used for calculations. This allows you to focus on the data being considered if needed.