K`s Extreme DurationExtreme duration uses a special combination of the RSI and its relative position to deliver a reversal signal.
The following are the conditions to generate signals:
* Bullish signal: The current 8-period RSI is below 50 and above 35 while the previous 5 RSI's are below 35.
* Bearish signal: The current 8-period RSI is above 50 and below 65 while the previous 5 RSI's are above 65.
Reversal
Confluence Buy-Sell Indicator with Fibonacci The script is a "Confluence Indicator with Fibonacci" designed to work on the TradingView platform. This indicator combines multiple technical analysis strategies to generate buy and sell signals based on user-defined confluence criteria. Here's a breakdown of its features:
Confluence Criteria: Users can enable or disable various strategies like MACD, RSI, Bollinger Bands, Divergence, Fibonacci, and Moving Average. The number of strategies that need to align for a signal to be generated can be set by the user.
Strategies Included:
MACD Strategy: Uses the Moving Average Convergence Divergence method to identify buy/sell opportunities.
RSI Strategy: Utilizes the Relative Strength Index to detect overbought or oversold conditions.
Bollinger Bands Strategy: Incorporates Bollinger Bands to identify volatility and potential buy/sell signals.
Divergence Strategy: A basic implementation that detects bullish and bearish divergences using the RSI.
Fibonacci Strategy: Uses Fibonacci retracement levels to determine potential support and resistance levels.
Moving Average Strategy: Employs a crossover system between the 50-period and 200-period simple moving averages.
Additional Features:
Support & Resistance: Identifies major support and resistance levels from the last 50 bars.
Pivot Points: Calculates pivot points to determine potential turning points.
Stop Loss Levels: Automatically calculates and plots stop-loss levels for buy and sell signals.
NYC Midnight Level: Option to display the New York City midnight price level.
Visualization: Plots buy and sell signals on the chart with green and red markers respectively.
Adequate Category:
"Technical Analysis Indicators & Overlays" or "Strategy & Scripting Tools".
SpiceIn the chart photo is a description for each shape and letter, saying what each one is.
BB, Reversals are off by default.
BB + Reversals + Next bar confirmation - The way this should be used is by waiting for a 1 or 2 bar confirmation closed above/below the high/low of the Reversal candle. So if its a Top R, a yellow box will print as a confirmed 1 bar if it closed below the top R's low, then you can wait for the second bar to close also below the Top R's low. Vice versa with the Bot R.
RSI arrows - Essentially showing you when the multi time frame RSIs are coming back up above 30, or below 70. Respective to what time frames you have selected.
Three Line Strike - A trend continuation candlestick pattern consisting of four candles
Leledc Exhaustion suggest the trend may be reversing. Combined with the moving average as a trend filter, the indicator can signal the end of a pull back and the continuation of the trend.
EMAs - Help measuring the trend direction over a period of time.
Credit to all these amazing creators -
Multi Timeframe RSI (LTF) by @millerrh
3 Line Strike by @Lij_MC 'MarketVision A'
Leledc Exhaustion by @glaz, used updated version by @Joy_Bangla
If anyone uses the BB reversals source code to put into their own indicator/strategy, you are free to do so. Just send me a message I'd love to see your work with it! :)
Thanks to Lij_MC's MarketVision A indicator for inspiring me to add more features. At first it was just the RSI Arrows and the BB reversals candles + Condition but then I found MarketVision A and loved the extra Leledc and 3 Line Strike features.
Hope you enjoy this Spice!
No Signal is 100% correct at what it's trying to do. Use caution when trading!
Practice Risk Management.
MA Sabres [LuxAlgo]The "MA Sabres" indicator highlights potential trend reversals based on a moving average direction. Detected reversals are accompanied by an extrapolated "Sabre" looking shape that can be used as support/resistance and as a source of breakouts.
🔶 USAGE
If a selected moving average (MA) continues in the same direction for a certain time, a change in that direction could signify a potential reversal.
In this publication, when a trend change occurs, a sabre-shaped figure is drawn which can be used as support/resistance:
A sabre can be indicative of a direction, however, it can also act as a stop-loss when the price should go in the opposite direction:
Or show potential areas of interest:
🔶 DETAILS
This publication will look for a change in direction after the MA went in the same direction during x consecutive bars (settings: " Reversal after x bars in the same direction ").
Then a circle-shaped drawing will be drawn 1 bar back, at the previous high/low, dependable of the previous direction.
From there originates a sabre-shaped figure where the tip lies as far as the user-set MA length.
The angle of the "sabre" relies on the ATR of the previous 14 bars.
Less volatility will create a flatter sabre while the opposite is true when there is more volatility in the previous 14 bars.
The sabre is created by the latest feature, polylines , which enables us to connect several 'points', resulting in a polyline.new() object.
Do note that sabres are offset by one bar to the past to align their locations.
🔶 SETTINGS
MA Type: SMA, EMA, SMMA (RMA), HullMA, WMA, VWMA, DEMA, TEMA, NONE (off)
Length: this sets the length of MA, and the length of the sabre shape
Previous Trend Duration: After the MA direction is the same for x consecutive bars, the first time the direction changes, a sabre is drawn
K's Reversal Indicator IIIK's Reversal Indicator III is based on the concept of autocorrelation of returns. The main theory is that extreme autocorrelation (trending) that coincide with a technical signals such as one from the RSI, may result in a powerful short-term signal that can be exploited.
The indicator is calculated as follows:
1. Calculate the price differential (returns) as the current price minus the previous price.
2. the correlation between the current return and the return from 14 periods ago using a lookback of 14 periods.
3. Calculate a 14-period RSI on the close prices.
To generate the signals, use the following rules:
* A bullish signal is generated whenever the correlation is above 0.60 while the RSI is below 40.
* A bearish signal is generated whenever the correlation is above 0.60 while the RSI is above 60.
Fibonacci Ranges (Real-Time) [LuxAlgo]The "Fibonacci Ranges" indicator combines Fibonacci ratio-derived ranges (channels), together with a Fibonacci pattern of the latest swing high/low.
🔶 USAGE
The indicator draws real-time ranges based on Fibonacci ratios as well as retracements. Breakouts from a Fibonacci Channel are also indicated by labels, indicating a potential reversal.
Each range extremity/area can also be used as support/resistance.
🔶 CONCEPTS
Fibonacci Channels
Latest Fibonacci
Both, Latest Fibonacci and Fibonacci Channels , display different Fibonacci levels (labels not included in the code):
However, the 2 react in a totally different way.
🔹 Fibonacci Channels
2 conditions must be fulfilled until a Fibonacci Channel is displayed:
New swing high/low
close has to be between chosen limits/levels ( Break level )
As visual guidance, chosen Break levels are accentuated by 2 small gray blocks:
Once the channel is displayed, it will remain visible until x consecutive bars break out of the chosen Break level at closing time.
• x consecutive bars is set by Break count .
The amount of breaks is counted in the code. When the price, without breaking the user-set limit, closes back between the 2 levels, the count is reset to 0.
By enabling Channels and Shadows you can see previous channels (" Shadows ", which is always delayed with 1 bar)
Previous channels can be helpful in finding potential support/resistance areas, especially from large channel blocks
The more narrow Break levels are set the less chance the price closes between these 2 levels, and the quicker close breaks out.
In other words, narrow levels give fewer & smaller channels, broader levels give more & larger channels.
Note:
• swing settings: L & R
• Break count (x consecutive bars that close outside chosen levels to invalidate the Fibonacci Channel )
will also be of influence in displaying the channels.
• Show breaks enable you to visualize signals when there is a break:
• Alerts can also be set ( Break Down / Break Up )
🔹 Latest Fibonacci
This displays the Fibonacci levels between the latest swing high and swing low, independently from the Fibonacci Channel .
The Lastest Fibonacci can be helpful in detecting the current trend against the larger Fibonacci Channel .
🔶 SETTINGS
🔹 Swing Settings
L: set left of pivothigh / pivotlow
R: set right of pivothigh / pivotlow
🔹 Fibonacci Channels
Channel : Channel / Channels + Shadows / None
Break level
-0.382 - 1.382
0.000 - 1.000
0.236 - 0.764
0.382 - 0.618
Break count
🔹 Fibonacci
Toggle
Colours: [ -0.382 - 0 ], [ 0.236 - 0.382 ], [ 0.5 ], [ 0.618 - 0.764 ], [ 1 - 1.382 ]
Reversal Confirmations [QuantVue]The Reversal Confirmation Indicator is based on price action and looks to provide opportunities when price gets stretched.
The indicator works by finding the highest and lowest points over the user selected lookback period.
If price closes below the low of the highest bar or closes above the high of the lowest bar a possible reversion to the mean may occur and the indicator will plot a triangle and fire an alert.
This indicator works a reversion to the mean or to potentially time entries in trending markets.
Fully customizable settings:
🔹Lookback Period
🔹Colors
🔹Show / hide upper & lower channels
🔹Show / hide the mean
Give this indicator a BOOST and COMMENT your thoughts!
We hope you enjoy.
Cheers!
Percentile Based Trend StrengthThe "Percentile Based Trend Strength" (PBTS) calculates trend strength based on percentile values of high and low prices for various length periods and then identifies the current trend as either Bullish, Bearish, or N/A (No Trend). Here's a step-by-step explanation of the code:
Percentile Calculations:
For each specified length period (13, 21, 34, 55, 89, and 144 - Fibonacci numbers), the code calculates the 75th percentile of high prices (e.g., percentile_13H) and the 25th percentile of low prices (e.g., percentile_13L). These percentiles represent levels that prices need to exceed or fall below to indicate a strong trend.
Calculate Highest High and Lowest Low:
The highest high (75th percentile high price of longest length) and lowest low (25th percentile low price of longest length) for the longest length period (144) are calculated as highest_high and lowest_low. These values represent threshold price levels .
Trend Strength Conditions:
The code calculates various conditions to determine trend strength. For each percentile value and each length period, it checks if the percentile value is greater than the highest high (trendBull) or less than the lowest low (trendBear). These conditions are used to assess the strength of the bullish and bearish trends.
Count Bull and Count Bear:
The countBull and countBear variables count the number of bullish and bearish conditions met, respectively. These counts help evaluate trend strength.
Weak Bull and Weak Bear Count:
The code calculates the number of weak bullish and bearish conditions. Weak conditions occur when a percentile value falls within the range defined by the highest high and lowest low but doesn't meet the strong trend criteria.
Bull Strength and Bear Strength:
bullStrength and bearStrength are calculated based on the counts of bullish, bearish, weak bullish, and weak bearish conditions. These values represent the overall strength of the bullish and bearish trends.
Strong Bull and Bear Conditions:
These conditions occur when the 75th percentile of high prices (for bull conditions) or the 25th percentile of low prices (for bear conditions) exceeds or falls below the highest high or lowest low, respectively, for the specified length period.
Strong bull conditions indicate a strong upward trend, while strong bear conditions indicate a strong downward trend.
Strong conditions are indicative of more significant price movements and are considered as primary signals of trend strength.
Weak Bull and Bear Conditions:
Weak bull and bear conditions are more nuanced. They occur when the 75th percentile of high prices (for weak bull conditions) or the 25th percentile of low prices (for weak bear conditions) falls within the range defined by the highest high and lowest low for the specified length period.
In other words, prices are not strong enough to reach the extreme levels represented by the highest high or lowest low, but they still exhibit some bullish or bearish tendencies within that range.
Weak conditions suggest a less robust trend. They may indicate that while there is some bias toward a bullish or bearish trend, it is not as strong or decisive as in the case of strong conditions.
Current Trend Identification:
The current trend is determined by comparing bullStrength and bearStrength. If bullStrength is greater, it's considered a Bull trend; if bearStrength is greater, it's a Bear trend. If they are equal, the trend is identified as N/A (No Trend).
Displaying Trend Information:
The code creates a table to display the current trend, reversal probability (strength), count of bullish and bearish conditions, weak bullish and weak bearish counts, and colors the text accordingly.
Plotting Percentiles:
Finally, the code plots the percentile lines for visualization, with 20% transparency. It also plots the highest high and lowest low lines (75th and 25th percentile of the longest length 144) using their original colors.
In summary, this indicator calculates trend strength based on percentile levels of high and low prices for different length periods. It then counts the number of bullish and bearish conditions, factors in weak conditions, and compares the strengths to identify the current trend as Bullish, Bearish, or No Trend. It provides a table with trend information and visualizes percentile lines on the chart.
ATR Trend Reversal Zone indicatorThis indicator helps avoid taking reversal trades too close to the 21 EMA, which may fail since the market often continues its trend after retracing from the 21 EMA level. It does not generate a direct signal for reversal trades but rather indicates points where you can consider potential reversal trades based on your trading methodology
This script defines an indicator that calculates the 21 Exponential Moving Average (EMA) and the Average True Range (ATR) for a given period. It then computes the distance between the most recent closing price and the 21 EMA in terms of ATR units. If this distance is equal to or greater than 3 ATRs, a small green circle is plotted below the corresponding bar on the chart, indicating a potential reversal condition.
Baha'i Reversal Points [CC]The Baha'i Reversal Points is a custom creation that combines some of my favorite passions, creating stock indicator scripts and my faith. The Baha'i Faith believes in the oneness of God and all religions, and sees the number 9 as significant because that is the number of major world religions as well as the Baha'i symbol is a nine-pointed star. The number 19 is also seen as significant because in the Baha'i calendar, there are 19 months, and each month is made up of 19 days. Anyway, with all that being explained, I created these reversal points to find the points where the last 19 highs or lows are higher or lower, respectively than the previous high or low nine days ago. As with many indicators, this does have some hits and misses but does a pretty good job of finding reversal points based on these criteria.
There are a few different ways to analyze this data to determine when to buy or sell. I have set the default behavior for when we encounter the first time that the amount of highs or lows is greater than or equal to the length amount using a crossover or crossunder alert. You could also ignore the crossover or crossunder alerts and buy when the count is greater than or equal to the length, which can happen for extended periods depending on the underlying trend. Overall, buy when the buy label appears and sell when the sell label appears.
Let me know if there are any other custom indicators or scripts you would like to see me publish!
Pro Supertrend CalculatorThis indicator is an adapted version of Julien_Eche's 'Pro Momentum Calculator' tailored specifically for TradingView's 'Supertrend indicator'.
The "Pro Supertrend Calculator" indicator has been developed to provide traders with a data-driven perspective on price movements in financial markets. Its primary objective is to analyze historical price data and make probabilistic predictions about the future direction of price movements, specifically in terms of whether the next candlestick will be bullish (green) or bearish (red). Here's a deeper technical insight into how it accomplishes this task:
1. Supertrend Computation:
The indicator initiates by computing the Supertrend indicator, a sophisticated technical analysis tool. This calculation involves two essential parameters:
- ATR Length (Average True Range Length): This parameter determines the sensitivity of the Supertrend to price fluctuations.
- Factor: This multiplier plays a pivotal role in establishing the distance between the Supertrend line and prevailing market prices. A higher factor value results in a more significant separation.
2. Supertrend Visualization:
The Supertrend values derived from the calculation are meticulously plotted on the price chart, manifesting as two distinct lines:
- Green Line: This line represents the Supertrend when it indicates a bullish trend, signifying an anticipation of rising prices.
- Red Line: This line signifies the Supertrend in bearish market conditions, indicating an expectation of falling prices.
3. Consecutive Candle Analysis:
- The core function of the indicator revolves around tracking successive candlestick patterns concerning their relationship with the Supertrend line.
- To be included in the analysis, a candlestick must consistently close either above (green candles) or below (red candles) the Supertrend line for multiple consecutive periods.
4.Labeling and Enumeration:
- To communicate the count of consecutive candles displaying uniform trend behavior, the indicator meticulously applies labels to the price chart.
- The positioning of these labels varies based on the direction of the trend, residing either below (for bullish patterns) or above (for bearish patterns) the candlestick.
- The color scheme employed aligns with the color of the candle, using green labels for bullish candles and red labels for bearish ones.
5. Tabular Data Presentation:
- The indicator augments its graphical analysis with a customizable table prominently displayed on the chart. This table delivers comprehensive statistical insights.
- The tabular data comprises the following key elements for each consecutive period:
a. Consecutive Candles: A tally of the number of consecutive candles displaying identical trend characteristics.
b. Candles Above Supertrend: A count of candles that remained above the Supertrend during the sequential period.
3. Candles Below Supertrend: A count of candles that remained below the Supertrend during the sequential period.
4. Upcoming Green Candle: An estimation of the probability that the next candlestick will be bullish, grounded in historical data.
5. Upcoming Red Candle: An estimation of the probability that the next candlestick will be bearish, based on historical data.
6. Tailored Configuration:
To accommodate diverse trading strategies and preferences, the indicator offers extensive customization options. Traders can fine-tune parameters such as ATR length, factor, label and table placement, and table size to align with their unique trading approaches.
In summation, the "Pro Supertrend Calculator" indicator is an intricately designed tool that leverages the Supertrend indicator in conjunction with historical price data to furnish traders with an informed outlook on potential future price dynamics, with a particular emphasis on the likelihood of specific bullish or bearish candlestick patterns stemming from consecutive price behavior.
Support & Resistance AI (K means/median) [ThinkLogicAI]█ OVERVIEW
K-means is a clustering algorithm commonly used in machine learning to group data points into distinct clusters based on their similarities. While K-means is not typically used directly for identifying support and resistance levels in financial markets, it can serve as a tool in a broader analysis approach.
Support and resistance levels are price levels in financial markets where the price tends to react or reverse. Support is a level where the price tends to stop falling and might start to rise, while resistance is a level where the price tends to stop rising and might start to fall. Traders and analysts often look for these levels as they can provide insights into potential price movements and trading opportunities.
█ BACKGROUND
The K-means algorithm has been around since the late 1950s, making it more than six decades old. The algorithm was introduced by Stuart Lloyd in his 1957 research paper "Least squares quantization in PCM" for telecommunications applications. However, it wasn't widely known or recognized until James MacQueen's 1967 paper "Some Methods for Classification and Analysis of Multivariate Observations," where he formalized the algorithm and referred to it as the "K-means" clustering method.
So, while K-means has been around for a considerable amount of time, it continues to be a widely used and influential algorithm in the fields of machine learning, data analysis, and pattern recognition due to its simplicity and effectiveness in clustering tasks.
█ COMPARE AND CONTRAST SUPPORT AND RESISTANCE METHODS
1) K-means Approach:
Cluster Formation: After applying the K-means algorithm to historical price change data and visualizing the resulting clusters, traders can identify distinct regions on the price chart where clusters are formed. Each cluster represents a group of similar price change patterns.
Cluster Analysis: Analyze the clusters to identify areas where clusters tend to form. These areas might correspond to regions of price behavior that repeat over time and could be indicative of support and resistance levels.
Potential Support and Resistance Levels: Based on the identified areas of cluster formation, traders can consider these regions as potential support and resistance levels. A cluster forming at a specific price level could suggest that this level has been historically significant, causing similar price behavior in the past.
Cluster Standard Deviation: In addition to looking at the means (centroids) of the clusters, traders can also calculate the standard deviation of price changes within each cluster. Standard deviation is a measure of the dispersion or volatility of data points around the mean. A higher standard deviation indicates greater price volatility within a cluster.
Low Standard Deviation: If a cluster has a low standard deviation, it suggests that prices within that cluster are relatively stable and less likely to exhibit sudden and large price movements. Traders might consider placing tighter stop-loss orders for trades within these clusters.
High Standard Deviation: Conversely, if a cluster has a high standard deviation, it indicates greater price volatility within that cluster. Traders might opt for wider stop-loss orders to allow for potential price fluctuations without getting stopped out prematurely.
Cluster Density: Each data point is assigned to a cluster so a cluster that is more dense will act more like gravity and
2) Traditional Approach:
Trendlines: Draw trendlines connecting significant highs or lows on a price chart to identify potential support and resistance levels.
Chart Patterns: Identify chart patterns like double tops, double bottoms, head and shoulders, and triangles that often indicate potential reversal points.
Moving Averages: Use moving averages to identify levels where the price might find support or resistance based on the average price over a specific period.
Psychological Levels: Identify round numbers or levels that traders often pay attention to, which can act as support and resistance.
Previous Highs and Lows: Identify significant previous price highs and lows that might act as support or resistance.
The key difference lies in the approach and the foundation of these methods. Traditional methods are based on well-established principles of technical analysis and market psychology, while the K-means approach involves clustering price behavior without necessarily incorporating market sentiment or specific price patterns.
It's important to note that while the K-means approach might provide an interesting way to analyze price data, it should be used cautiously and in conjunction with other traditional methods. Financial markets are influenced by a wide range of factors beyond just price behavior, and the effectiveness of any method for identifying support and resistance levels should be thoroughly tested and validated. Additionally, developments in trading strategies and analysis techniques could have occurred since my last update.
█ K MEANS ALGORITHM
The algorithm for K means is as follows:
Initialize cluster centers
assign data to clusters based on minimum distance
calculate cluster center by taking the average or median of the clusters
repeat steps 1-3 until cluster centers stop moving
█ LIMITATIONS OF K MEANS
There are 3 main limitations of this algorithm:
Sensitive to Initializations: K-means is sensitive to the initial placement of centroids. Different initializations can lead to different cluster assignments and final results.
Assumption of Equal Sizes and Variances: K-means assumes that clusters have roughly equal sizes and spherical shapes. This may not hold true for all types of data. It can struggle with identifying clusters with uneven densities, sizes, or shapes.
Impact of Outliers: K-means is sensitive to outliers, as a single outlier can significantly affect the position of cluster centroids. Outliers can lead to the creation of spurious clusters or distortion of the true cluster structure.
█ LIMITATIONS IN APPLICATION OF K MEANS IN TRADING
Trading data often exhibits characteristics that can pose challenges when applying indicators and analysis techniques. Here's how the limitations of outliers, varying scales, and unequal variance can impact the use of indicators in trading:
Outliers are data points that significantly deviate from the rest of the dataset. In trading, outliers can represent extreme price movements caused by rare events, news, or market anomalies. Outliers can have a significant impact on trading indicators and analyses:
Indicator Distortion: Outliers can skew the calculations of indicators, leading to misleading signals. For instance, a single extreme price spike could cause indicators like moving averages or RSI (Relative Strength Index) to give false signals.
Risk Management: Outliers can lead to overly aggressive trading decisions if not properly accounted for. Ignoring outliers might result in unexpected losses or missed opportunities to adjust trading strategies.
Different Scales: Trading data often includes multiple indicators with varying units and scales. For example, prices are typically in dollars, volume in units traded, and oscillators have their own scale. Mixing indicators with different scales can complicate analysis:
Normalization: Indicators on different scales need to be normalized or standardized to ensure they contribute equally to the analysis. Failure to do so can lead to one indicator dominating the analysis due to its larger magnitude.
Comparability: Without normalization, it's challenging to directly compare the significance of indicators. Some indicators might have a larger numerical range and could overshadow others.
Unequal Variance: Unequal variance in trading data refers to the fact that some indicators might exhibit higher volatility than others. This can impact the interpretation of signals and the performance of trading strategies:
Volatility Adjustment: When combining indicators with varying volatility, it's essential to adjust for their relative volatilities. Failure to do so might lead to overemphasizing or underestimating the importance of certain indicators in the trading strategy.
Risk Assessment: Unequal variance can impact risk assessment. Indicators with higher volatility might lead to riskier trading decisions if not properly taken into account.
█ APPLICATION OF THIS INDICATOR
This indicator can be used in 2 ways:
1) Make a directional trade:
If a trader thinks price will go higher or lower and price is within a cluster zone, The trader can take a position and place a stop on the 1 sd band around the cluster. As one can see below, the trader can go long the green arrow and place a stop on the one standard deviation mark for that cluster below it at the red arrow. using this we can calculate a risk to reward ratio.
Calculating risk to reward: targeting a risk reward ratio of 2:1, the trader could clearly make that given that the next resistance area above that in the orange cluster exceeds this risk reward ratio.
2) Take a reversal Trade:
We can use cluster centers (support and resistance levels) to go in the opposite direction that price is currently moving in hopes of price forming a pivot and reversing off this level.
Similar to the directional trade, we can use the standard deviation of the cluster to place a stop just in case we are wrong.
In this example below we can see that shorting on the red arrow and placing a stop at the one standard deviation above this cluster would give us a profitable trade with minimal risk.
Using the cluster density table in the upper right informs the trader just how dense the cluster is. Higher density clusters will give a higher likelihood of a pivot forming at these levels and price being rejected and switching direction with a larger move.
█ FEATURES & SETTINGS
General Settings:
Number of clusters: The user can select from 3 to five clusters. A good rule of thumb is that if you are trading intraday, less is more (Think 3 rather than 5). For daily 4 to 5 clusters is good.
Cluster Method: To get around the outlier limitation of k means clustering, The median was added. This gives the user the ability to choose either k means or k median clustering. K means is the preferred method if the user things there are no large outliers, and if there appears to be large outliers or it is assumed there are then K medians is preferred.
Bars back To train on: This will be the amount of bars to include in the clustering. This number is important so that the user includes bars that are recent but not so far back that they are out of the scope of where price can be. For example the last 2 years we have been in a range on the sp500 so 505 days in this setting would be more relevant than say looking back 5 years ago because price would have to move far to get there.
Show SD Bands: Select this to show the 1 standard deviation bands around the support and resistance level or unselect this to just show the support and resistance level by itself.
Features:
Besides the support and resistance levels and standard deviation bands, this indicator gives a table in the upper right hand corner to show the density of each cluster (support and resistance level) and is color coded to the cluster line on the chart. Higher density clusters mean price has been there previously more than lower density clusters and could mean a higher likelihood of a reversal when price reaches these areas.
█ WORKS CITED
Victor Sim, "Using K-means Clustering to Create Support and Resistance", 2020, towardsdatascience.com
Chris Piech, "K means", stanford.edu
█ ACKNOLWEDGMENTS
@jdehorty- Thanks for the publish template. It made organizing my thoughts and work alot easier.
Trend Change DetectorThe trend change detector oscillator is a tool designed to help traders identify the current trend direction paired with the potential reversal zones.
The oscillator is made of multiple parts:
- The colored histogram, that displays the current long-term trend direction (long if above 0, short if below)
- The trend line, which shows the price in relation to the fair value of the current trend
- The reversal zones, which are the area that alarms the traders that the price might reverse soon after having touched them
The indicator can work with three different inputs. In the Source panel, you can choose between "Price", "Price and Volume" and "Ponderated Volume". The price input uses only the price, the price and volume use the average between the price and the ponderated volume, and the ponderated volume shows the indicator working with volume data, with formulas such as the On Balance Volume and the Accumulation-Distribution line.
This indicator can be used both for trend following technique, using the cross of the trend line with the 0-line as signals in conjunction with the bias given by the histogram, and for mean reversal technique thanks to the reversal zones that allow traders to identify potential tops and bottoms.
QQE Weighted Oscillator [LuxAlgo]The QQE (Quantitative Qualitative Estimation) Weighted Oscillator improves on its original version by weighting the RSI based on the indications given by the trailing stop, requiring more effort in order for a cross with the trailing stop to occur.
🔶 USAGE
The QQE Weighted Oscillator is comprised of a smoothed RSI oscillator and a trailing stop derived from this same RSI. The oscillator can be used to indicate whether the market is overbought/oversold as well as an early indication of trend reversals thanks to the leading nature of the RSI.
Using higher Factor values will return a longer-term trailing stop.
Like with a regular RSI divergence can be indicative of a reversal.
Further weighting will control how much "effort" is required for the trailing stop to cross the RSI. For example. For example, an RSI above the trailing stop will require a higher degree of negative price variations in order for a potential cross to occur when using higher weights.
This can cause higher weightings to return more cyclical and smoother results.
🔶 SETTINGS
Length: Length of the RSI oscillator.
Factor: Multiplicative factor used for the trailing stop calculation.
Smooth: Degree of smoothness of the RSI oscillator.
Weight: Degree of weighting used for the RSI calculation.
Swing Ranges [ChartPrime]Swing Ranges is an indicator designed to provide traders with valuable insights into swing movements and real-time support and resistance (SR) levels. This tool detects price swings and plots boxes around them, allowing traders to visualize the market dynamics efficiently. The indicator's primary focus is on real-time support and resistance levels, empowering traders to make well-informed decisions in dynamic market conditions.
Key Features:
Swing Box Visualization:
Swing Ranges excels at detecting swings in the price data and visually representing them with boxes on the price chart. This enables traders to quickly identify swing ranges, essential for understanding market trends and potential reversal points. VWAP POCs are also provided giving areas of high activity in each block.
Real-Time Support and Resistance Levels:
The core feature of Swing Ranges is its real-time support and resistance levels. These levels are dynamically calculated based on the volume-weighted data for each specific range. The indicator displays the strength of support and resistance zones with percentage bars, indicating the ratio between bullish and bearish volume. This real-time information empowers traders to assess the strength and significance of each SR level, enhancing their ability to execute well-timed trades.
ATR (Average True Range) Value:
Swing Ranges also includes an ATR value label, which shows the Average True Range for the selected period. ATR aids traders in understanding market volatility, enabling them to set appropriate stop-loss and take-profit levels for their trades.
VWAP (Volume Weighted Average Price) Information:
Traders c an readily access the VWAP value through the indicator's label. VWAP provides insights into the average price at which an asset has been traded, helping traders identify potential fair value areas and market trends.
Price Difference Percentage:
Swing Ranges displays the percentage difference between the high and low of each swing. This information allows traders to gauge the magnitude of price movements and assess potential profit targets more effectively.
The indicator also has a NV value. If the NV is high e.g. 10% or more there is indecision in the market and the market is trying to remain in a given range.
Settings Inputs:
1. Length Control:
The Length setting input in Swing Ranges allows traders to adjust the sensitivity of the indicator to detect swings. Traders can customize the length based on their trading strategies and timeframes.
2. ATR Period Adjustment:
The ATR Period input allows traders to fine-tune the calculation period for the Average True Range. This feature enables traders to adapt the indicator to different market conditions and asset classes.
Swing Ranges: Real-Time Support and Resistance Indicator is a comprehensive tool that combines swing visualization with dynamic support and resistance levels. By focusing on real-time SR levels, this indicator equips traders with the essential information needed to make confident trading decisions in ever-changing market conditions.
Price breakout and reversal [TCS] | PAThis indicator is designed to identify potential breaks and reversals in price movements for a financial instrument.
The indicator displays several elements to assist users in spotting specific market conditions:
1. High and Low Pivots : The indicator marks the highest and lowest points on the price chart within a customizable lookback period. These pivots represent important turning points in the price movement and serve as reference levels for potential breakouts and reversals.
2. Fair Value Line : A horizontal line is drawn at the midpoint between the high and low pivots. This line represents the "fair value" based on the recent price action. Traders may consider this level as a reference for evaluating the price's deviation from its average value.
3. Bullish Breakouts : When the closing price of the financial instrument crosses above the high pivot the indicator identifies a potential bullish breakout. This suggests a possible buying opportunity.
4. Bearish Breakouts : Conversely, a bearish breakout is identified when the closing price crosses below the low pivot. This may indicate a selling opportunity.
5. Fair Value Breakouts : In addition to regular breakouts, the indicator can detect breakouts based on the fair value line. If the closing price crosses above or below the fair value line, it may signal a fair value breakout, indicating the price's potential return to its average level.
6. Reversals : Reversal patterns are essential in technical analysis. The indicator identifies potential bullish and bearish reversals .
The indicator enhances its visual signals with geometric shapes (triangles and diamonds) placed above or below the price bars to represent different types of breakouts and reversals.
Moreover, the indicator can be configured to send alerts to the user when any of these specific events occur, helping traders stay informed and respond promptly to potential trading opportunities.
Please note that this code is for educational purposes only and should not be used for trading without further testing and analysis.
HyperTrend [LuxAlgo]The HyperTrend indicator aims to provide a real-time estimate of an underlying linear trend in the price. Support and resistance extremities are constructed from this estimate which can provide trade opportunities within the overall trend.
Most tools that return lines on a chart are either subject to backpainting or repainting. We aimed to provide a reliable real-time method to estimate linear trends in the price, enhancing traders' decision making processes when it comes to trading trends in price, hence the term 'HyperTrend'.
🔶 USAGE
Users can use the HyperTrend to easily determine the trend direction in the price, with an average sloping upward indicating an uptrend, and an average sloping downward indicating a downtrend.
The channels upper extremity can act as a resistance, while the lower extremity can act as a support. Contact with candle wicks can signal timely reversals/retracements.
Using a higher "Multiplicative Factor" value will return less frequent new channels, and is suitable to analyze longer-term trends. The slope settings on the other end allow us to control the slope of the returned channels, with higher values returning flatter results (similar to our previously posted predictive ranges).
🔹 Channel Average
The channel average can return an estimate of the current (and future) trend in the price, the chart below shows an interval where a linear regression is displayed alongside the channel average:
Unlike the linear regression, the average does not have any lookahead bias, this of course comes at the price of accuracy in most cases.
Users can also use this average as a support or resistance. The breakout of a TC average that has been tested multiple times can be considered more significant in suggesting a trend reversal.
🔶 SETTINGS
Multiplicative Factor: Control the allowed degree of deviation of the price from the average line. Higher values will return less frequent new channels.
Slope: Controls the steepness of the returned lines. Higher values will return flatter results.
Width %: Width percentage of the channel. Lower results will return narrower channels.
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.
Wick Reversal Indicator - Aligned with "Secrets of a Pivot Boss"The Wick Reversal Indicator is a powerful technical tool developed in accordance with the pseudocode outlined in the book "Secrets of a Pivot Boss" by Franklin O. Ochoa, Jr. This indicator assists traders in identifying potential market reversal points with enhanced precision.
By closely following the principles discussed in the book, the Wick Reversal Indicator evaluates key factors such as candlestick body size, wick length, and the relationship between close and open prices. It provides clear bullish and bearish reversal signals, visualized through triangular markers on the price chart.
Traders can fine-tune the sensitivity of the indicator by adjusting the Wick Multiplier and Body Percentage parameters to match their trading preferences and timeframes. This customization feature ensures adaptability to different market conditions and trading strategies.
With the Wick Reversal Indicator, traders gain an automated and objective tool for identifying potential market reversals, backed by the time-tested methodology presented in "Secrets of a Pivot Boss." It serves as a valuable addition to traders' analysis, aiding in informed decision-making and enhancing trading outcomes.
Trend Channels With Liquidity Breaks [ChartPrime]Trend Channels
This simple trading indicator is designed to quickly identify and visualize support and resistance channels in any market. The primary purpose of the Trend Channels with Liquidity Breaks indicator is to recognize and visualize the dominant trend in a more intuitive and user-friendly manner.
Main Features
Automatically identifies and plots channels based on pivot highs and lows
Option to extend the channel lines
Display breaks of the channels where liquidity is deemed high
Inclusion of volume data within the channel bands (optional)
Market-friendly and customizable colors and settings for easy visual identification
Settings
Length: Adjust the length and lookback of the channels
Show Last Channel: Only shows the last channel
Volume BG: Shade the zones according to the volume detected
How to Interpret
Trend Channels with Liquidity Breaks indicator uses a combination of pivot highs and pivot lows to create support and resistance zones, helping traders to identify potential breakouts, reversals or continuations of a trend.
These support and resistance zones are visualized as upper and lower channel lines, with a dashed center line representing the midpoint of the channel. The indicator also allows you to see the volume data within the channel bands if you choose to enable this functionality. High volume zones can potentially signal strong buying or selling pressure, which may lead to potential breakouts or trend confirmations.
To make the channels more market-friendly and visually appealing, Trend Channels indicator also offers customizable colors for upper and lower lines, as well as the possibility to extend the line lengths for further analysis.
The indicator displays breaks of key levels in the market with higher volume.
Prevailing Trend IndicatorOVERVIEW
The Prevailing Trend indicator is a technical indicator that gauges whether the price is currently trending up or down. The purpose of this indicator is to call and/or filter with-trend signals.
CONCEPTS
This indicator assists traders in identifying high-probability trend entries. The upper line (blue line on the indicator) is calculated by taking the average range (high-low) of all bullish candles. The lower line (red line on the indicator) is calculated by taking the average range of all bearish candles. When these two lines intersect and cross each other, a buy and sell signal is generated. For example, if the blue line crosses over the red line, this indicates that the average size of all bullish bars are larger than the average size of all bearish bars. This is a good sign that an uptrend might occur. Vice versa for downtrends.
HOW DO I READ THIS INDICATOR
As an entry indicator:
When the blue line crosses over the red line, go long.
When the red line crosses over the blue line, go short.
As a signal filter:
If the blue line is above the red line, only take long trades.
If the red line is above the blue line, only take short trades.
Reversal Signals [LuxAlgo]The Reversal Signals indicator is a technical analysis tool that aims to identify when a trend is fading and potentially starting to reverse.
As a counter-trend tool, the Reversal Signals indicator aims to solve the problem of several technical analysis indicators that perform well during trending markets but struggle in ranging markets. By understanding the key concepts and applications of the tool, traders can enhance their market timing and improve their trading strategies.
Note: It's important to explore the settings of the indicator to customize to your own usage & display as there are various options available as covered below.
🔶 USAGE
The Reversal Signals indicator is comprised of two main phases: Momentum Phase and Trend Exhaustion Phase . These phases help identify potential trend reversals in bullish, bearish, and ranging markets.
🔹The Momentum Phase
The momentum phase consists of a 9-candle count and in rare cases 8-candle count. In a bullish trend, a starting number ‘1’ is plotted if a candle closes higher than the close of a candle four periods ago. In a bearish trend, a starting number ‘1’ is plotted if a candle closes lower than the close of a candle four periods ago.
The following numbers are plotted when each successive candle satisfies the four-period rule. The potential reversal point comes when the Reversal Signals plot a label on top of a candle in a bullish trend or at the bottom of a candle in a bearish trend. The momentum phase is immediately canceled if, at any point, a candle fails to satisfy the four-period rule.
Based on the extremes of the momentum phase, the Reversal Signals generate support & resistance levels as well as risk/stop levels.
🔹 The Trend Exhaustion Phase
The trend exhaustion phase starts after completing the momentum phase and consists of a 13-candle count. In a bullish trend exhaustion phase, each candle’s close is compared to the close of two candles earlier, and the close must be greater than the close two periods earlier. In a bearish trend exhaustion phase, each candle’s close is compared to the close of two candles earlier, and the close must be lower than the close two periods earlier.
The trend exhaustion phase does not require a consecutive sequence of candles; if the order of candles is interrupted, the trend exhaustion phase is not canceled. The trend exhaustion phase generates stronger trading signals than the momentum phase, with the potential for longer-lasting price reversals.
🔹 Trading Signals
The Reversal Signals script presents an overall setup and some phase-specific trade setup options, where probable trades might be considered. All phase-specific trade setups, presented as options, are triggered once the selected phase is completed and followed by a price flip in the direction of the trade setup.
Please note that those setups are presented for educational purposes only and do not constitutes professional and/or financial advice
- Momentum: Enter a trade at momentum phase completion, and search for buy (sell) when the bullish (bearish) momentum phase pattern is complete. Ideally, the momentum phase completion should close near its support/resistance line but shall not be above them, which indicates continuation of the trend
- Exhaustion: Enter a trade on trend exhaustion phase completion, and search for buy (sell) when the bullish (bearish) trend exhaustion phase is complete
- Qualified: Buy (sell) when a bullish (bearish) trend exhaustion phase combined with another bullish (bearish) momentum phase sequence is complete
Long trade setups are presented with "L" label and short trade setups with "S" label, where the content of the label displays details related to the probable trade opportunity
Once a phase-specific trade setup is triggered then the Reversal Signals script keeps checking the status of the price action relative to the phase-specific trade setups and in case something goes wrong presents a caution label. Pay attention to the content of the caution labels as well as where they appear. A trade signal, followed immediately by a warning indication can be assumed as a continuation of the underlying trend and can be traded in the opposite direction of the suggested signal
It is strongly advised to confirm trading setups in conjunction with other forms of technical and fundamental analysis, including technical indicators, chart/candlestick pattern analysis, etc.
🔶 DETAILS
The Reversal Signals script performs the detection of the phases by counting the candlestick meeting the specific conditions, which includes:
- Detection of the 8th and 9th candle perfection during the momentum phase
- In some cases, the 8th count will be assumed as momentum phase completion
- Trend exhaustion phase counting stops in case any type of momentum phase completion is detected during the counting process
- Postponing the last count of the trend exhaustion phase, the 13th candle must be below/above the 8th candle and if not the candles will be indicated with '+' sign under them and the script continues to search for a 13th candle at the next ones until the conditions are met
🔶 ALERTS
When an alert is configured, the user will have the ability to be notified in case;
Momentum / Trend Exhaustion phase completion
Support & Resistance level cross detection
Stop / Risk level cross detection
Long / Short Trade Setups are triggered
Please note, alerts are available with 'any alert() function call' and the alerts will be received only for the features that are enabled during alert configuration
🔶 SETTINGS
🔹 Momentum Phase
Display Phases: displays the momentum phases, where the Completed option allows the display of only completed momentum phases. The detailed option allows the display of the entire process of the momentum phase processes
Support & Resistance Levels: Toggles the visibility of the Support & Resistance Levels and Line Styling options
Momentum Phase Risk Levels: Toggles the visibility of the momentum phase Stop/Risk Levels and Line Styling options
For color options please refer to the options available under the style tab
🔹 Trend Exhaustion Phase
Display Phases: displays the trend exhaustion phases, where the Completed option allows the display of only completed trend exhaustion phases. The detailed option allows the display of the entire process of the trend exhaustion phase processes
Trend Exhaustion Phase Risk Levels: Toggles the visibility of the trend exhaustion phase Stop/Risk Levels
Trend Exhaustion Phase Target Levels: Toggles the visibility of the trend exhaustion phase Target Levels
For color options please refer to the options available under the style tab
🔹 Trade Setups
Overall Trend Direction & Trade Setup: displays the overall trend and probable trade setup levels, the users should search for a price flip and confirm with other means of technical and fundamental analysis for the trade setups once the label is plotted
Phase-Specific Trade Setup Options
Momentum: Searches for a trade setup after momentum phase completion
Exhaustion: Searches for a trade setup after trend exhaustion phase completion, stronger trend reversal possibility compared to momentum phase setup
Qualified: Searches for a trade setup after the trend exhaustion phase followed by a momentum phase completion
None: No trade setups are presented
Price Flips against the Phase Specific Trade Setups: enables checking the price action relative to the phase-specific trade setups
🔶 RELATED SCRIPTS
Here are the scripts that may add additional insight during potential trading decisions.
Buyside-Sellside-Liquidity
Support-Resistance-Classification