Composite Trend Oscillator [ChartPrime]CODE DUELLO:
Have you ever stopped to wonder what the underlying filters contained within complex algorithms are actually providing for you? Wouldn't it be nice to actually visually inspect for that? Those would require some kind of wild west styled quick draw duel or some comparison method as a proper 'code duello'. Then it can be determined which filter can 'draw' the quickest from it's computational holster with the least amount of lag and smoothness.
In Pine we can do so, discovering how beneficial that would be. This can be accomplished by quickly switching from one filter to another by input() back and forth, requiring visual memory. A better way could be done by placing two indicators added to the chart and then eventually placed into one indicator pane on top of each other.
By adding a filter() helper function that calls other moving average functions chosen for comparison, it can put to the test which moving average is the best drawing filter suited to our expected needs. PhiSmoother was formerly debuted and now it is utilized in a more complex environment in a multitude of ways along side other commonly utilized filters. Now, you the reader, get to judge for yourself...
FILTER VERSATILITY:
Having the capability to adjust between various smoothing methods such as PhiSmoother, TEMA, DEMA, WMA, EMA, and SMA on historical market data within the code provides an advantage. Each of these filter methods offers distinct advantages and hinderances. PhiSmoother stands out often by having superb noise rejection, while also being able to manipulate the fine-tuning of the phase or lag of the indicator, enhancing responsiveness to price movements.
The following are more well-known classic filters. TEMA (Triple Exponential Moving Average) and DEMA (Double Exponential Moving Average) offer reduced transient response times to price changes fluctuations. WMA (Weighted Moving Average) assigns more weight to recent data points, making it particularly useful for reduced lag. EMA (Exponential Moving Average) strikes a balance between responsiveness and computational efficiency, making it a popular choice. SMA (Simple Moving Average) provides a straightforward calculation based on the arithmetic mean of the data. VWMA and RMA have both been excluded for varying reasons, both being unworthy of having explanation here.
By allowing for adjustment refinements between these filter methods, traders may garner the flexibility to adapt their analysis to different market dynamics, optimizing their algorithms for improved decision-making and performance on demand.
INDICATOR INTRODUCTION:
ChartPrime's Composite Trend Oscillator operates as an oscillator based on the concept of a moving average ribbon. It utilizes up to 32 filters with progressively longer periods to assess trend direction and strength. Embedded within this indicator is an alternative view that utilizes the separation of the ribbon filaments to assess volatility. Both versions are excellent candidates for trend and momentum, both offering visualization of polarity, directional coloring, and filter crossings. Anyone who has former experience using RSI or stochastics may have ease of understanding applying this to their chart.
COMPOSITE CLUSTER MODES EXPLAINED:
In Trend Strength mode, the oscillator behavior signifies market direction and movement strength. When the oscillator is rising and above zero, the market is within a bullish phase, and visa versa. If the signal filter crosses the composite trend, this indicates a potential dynamic shift signaling a possible reversal. When the oscillator is teetering on its extremities, the market is more inclined to reverse later.
With Volatility mode, the oscillator undergoes a transformation, displaying an unbounded oscillator driven by market volatility. While it still employs the same scoring mechanism, it is now scaled according to the strength of the market move. This can aid with identification of ranging scenarios. However, one side effect is that the oscillator no longer has minimum or maximum boundaries. This can still be advantageous when considering divergences.
NOTEWORTHY SETTINGS FEATURES:
The following input settings described offer comprehensive control over the indicator's behavior and visualization.
Common Controls:
Price Source Selection - The indicator offers flexibility in choosing the price source for analysis. Traders can select from multiple options.
Composite Cluster Mode - Choose between "Trend Strength" and "Volatility" modes, providing insights into trend directionality or volatility weighting.
Cluster Filter and Length - Selects a filter for the cluster composition. This includes a length parameter adjustment.
Cluster Options:
Cluster Dispersion - Users can adjust the separation between moving averages in the cluster, influencing the sensitivity of the analysis.
Cluster Trimming - By modifying upper and lower trim parameters, traders can adjust the sensitivity of the moving averages within the cluster, enhancing its adaptability.
PostSmooth Filter and Length - Choose a filter to refine the composite cluster's post-smoothing with a length parameter adjustment.
Signal Filter and Length - Users can select a filter for the lagging signal plot, also having a length parameter adjustment.
Transition Easing - Sensitivity adjustment to influence the transition between bullish and bearish colors.
Enjoy
Search in scripts for "algo"
Machine Learning: Multiple Logistic Regression
Multiple Logistic Regression Indicator
The Logistic Regression Indicator for TradingView is a versatile tool that employs multiple logistic regression based on various technical indicators to generate potential buy and sell signals. By utilizing key indicators such as RSI, CCI, DMI, Aroon, EMA, and SuperTrend, the indicator aims to provide a systematic approach to decision-making in financial markets.
How It Works:
Technical Indicators:
The script uses multiple technical indicators such as RSI, CCI, DMI, Aroon, EMA, and SuperTrend as input variables for the logistic regression model.
These indicators are normalized to create categorical variables, providing a consistent scale for the model.
Logistic Regression:
The logistic regression function is applied to the normalized input variables (x1 to x6) with user-defined coefficients (b0 to b6).
The logistic regression model predicts the probability of a binary outcome, with values closer to 1 indicating a bullish signal and values closer to 0 indicating a bearish signal.
Loss Function (Cross-Entropy Loss):
The cross-entropy loss function is calculated to quantify the difference between the predicted probability and the actual outcome.
The goal is to minimize this loss, which essentially measures the model's accuracy.
// Error Function (cross-entropy loss)
loss(y, p) =>
-y * math.log(p) - (1 - y) * math.log(1 - p)
// y - depended variable
// p - multiple logistic regression
Gradient Descent:
Gradient descent is an optimization algorithm used to minimize the loss function by adjusting the weights of the logistic regression model.
The script iteratively updates the weights (b1 to b6) based on the negative gradient of the loss function with respect to each weight.
// Adjusting model weights using gradient descent
b1 -= lr * (p + loss) * x1
b2 -= lr * (p + loss) * x2
b3 -= lr * (p + loss) * x3
b4 -= lr * (p + loss) * x4
b5 -= lr * (p + loss) * x5
b6 -= lr * (p + loss) * x6
// lr - learning rate or step of learning
// p - multiple logistic regression
// x_n - variables
Learning Rate:
The learning rate (lr) determines the step size in the weight adjustment process. It prevents the algorithm from overshooting the minimum of the loss function.
Users can set the learning rate to control the speed and stability of the optimization process.
Visualization:
The script visualizes the output of the logistic regression model by coloring the SMA.
Arrows are plotted at crossover and crossunder points, indicating potential buy and sell signals.
Lables are showing logistic regression values from 1 to 0 above and below bars
Table Display:
A table is displayed on the chart, providing real-time information about the input variables, their values, and the learned coefficients.
This allows traders to monitor the model's interpretation of the technical indicators and observe how the coefficients change over time.
How to Use:
Parameter Adjustment:
Users can adjust the length of technical indicators (rsi_length, cci_length, etc.) and the Z score length based on their preference and market characteristics.
Set the initial values for the regression coefficients (b0 to b6) and the learning rate (lr) according to your trading strategy.
Signal Interpretation:
Buy signals are indicated by an upward arrow (▲), and sell signals are indicated by a downward arrow (▼).
The color-coded SMA provides a visual representation of the logistic regression output by color.
Table Information:
Monitor the table for real-time information on the input variables, their values, and the learned coefficients.
Keep an eye on the learning rate to ensure a balance between model adjustment speed and stability.
Backtesting and Validation:
Before using the script in live trading, conduct thorough backtesting to evaluate its performance under different market conditions.
Validate the model against historical data to ensure its reliability.
Shadow Range IndexShadow Range Index (SRI) introduces a new concept to calculate momentum, shadow range.
What is range?
Traditionally, True Range (TR) is the current high minus the current low of each bar in the timeframe. This is often used successfully on its own in indicators, or as a moving average in ATR (Average True Range).
To calculate range, SRI uses an innovative calculation of current bar range that also considers the previous bar. It calculates the difference between its maximum upward and maximum downward values over the number of bars the user chooses (by adjusting ‘Range lookback’).
What is shadow range?
True Range (TR) uses elements in its calculation (the highs and lows of the bar) that are also visible on the chart bars. Shadow range does not, though.
SRI calculates shadow range in a similar formula to range, except that this time it works out the difference between the minimum upward and minimum downward movement. This movement is by its nature less than the maximums, hence a shadow of it. Although more subtle, shadow range is significant, because it is quantifiable, and goes in one direction or another.
Finally, SRI smoothes shadow range and plots it as a histogram, and also smoothes and plots range as a signal line. Useful up and down triangles show trend changes, which optionally colour the chart bars.
Here’s an example of a long trade setup:
In summary, Shadow Range Index identifies and traces maximum and minimum bar range movement both up and down, and plots them as centred oscillators. The dynamics between the two can provide insights into the chart's performance and future direction.
Credit to these authors, whose MA or filters form part of this script:
@balipour - Super Smoother MA
@cheatcountry - Hann window smoothing
@AlgoAlpha - Gaussian filter
Relative Strength Scoring SystemRelative Strength Scoring System :
Important prerequisite :
This indicator can be loaded on any forex chart, i.e. a currency pair, but must not be loaded on any other asset due to certain market closures.
The chart timeframe must be less than or equal to the trading timeframe, which is the indicator's first parameter. A timeframe equal to that of the "Trading Timeframe" parameter is preferable.
Introduction :
This indicator measures the relative strength of a currency against all other currencies using spread formulas. It gives an indication of which currencies are bullish, neutral or bearish. The ultimate aim of this indicator is to find out which pair will generate a higher probability of gain than the others by pairing the most bullish pair with the most bearish pair.
Spread formulas :
To find the relative strength of a currency compared with others, we use the following spreads formulas :
USD = (FX:USDJPY/100+SAXO:USDEUR+FX:USDCHF+SAXO:USDGBP+FX:USDCAD+SAXO:USDAUD+FX_IDC:USDNZD)/7
JPY = (SAXO:JPYUSD/100+FX_IDC:JPYAUD/100+FX_IDC:JPYCAD/100+FX_IDC:JPYNZD/100+FX_IDC:JPYCHF/100+SAXO:JPYEUR/100+FX_IDC:JPYGBP/100)/7
CHF = (FX:CHFJPY/100+SAXO:CHFUSD+SAXO:CHFEUR+FX_IDC:CHFGBP+FX_IDC:CHFCAD+SAXO:CHFAUD+FX_IDC:CHFNZD)/7
EUR = (FX:EURJPY/100+FX:EURUSD+FX:EURCHF+FX:EURGBP+FX:EURCAD+FX:EURAUD+FX:EURNZD)/7
GBP = (FX:GBPJPY/100+FX:GBPUSD+FX:GBPCHF+SAXO:GBPEUR+FX:GBPCAD+FX:GBPAUD+FX:GBPNZD)/7
CAD = (FX:CADJPY/100+SAXO:CADUSD+FX:CADCHF+FX_IDC:CADGBP+SAXO:CADEUR+FX_IDC:CADAUD+FX_IDC:CADNZD)/7
AUD = (FX:AUDJPY/100+FX:AUDUSD+FX:AUDCHF+SAXO:AUDGBP+FX:AUDCAD+SAXO:AUDEUR+FX:AUDNZD)/7
NZD = (FX:NZDJPY/100+FX:NZDUSD+FX:NZDCHF+SAXO:NZDGBP+FX:NZDCAD+SAXO:NZDAUD+SAXO:NZDEUR)/7
CRYPTO = (BITSTAMP:BTCUSD+BITSTAMP:ETHUSD+BITSTAMP:LTCUSD+BITSTAMP:BCHUSD)/4
Timeframes :
As mentioned in the prerequisites, the chart timeframe must not be greater than the trading timeframe. The latter corresponds to the timeframe chosen by the trader to enter a position, and is the indicator's first parameter. Once this has been chosen, the algorithm selects the timeframes of the "Trend" and "Velocity" charts. Here's how it allocates them :
Trading TF => ("Velocity TF", "Trend TF")
"5min" => ("15min ", "60min")
"15min" => ("60min ", "4h")
"30min" => ("2h ", "8h")
"60min" => ("4h ", "12h")
"4h" => ("12h", "1D")
"6h" => ("1D", "3D")
"8h" => ("1D", "4D")
"12h" => ("2D", "1W")
"1D" => ("3D", "1W")
Trend Scoring System :
When the timeframe of the trend graph has been allocated, the algorithm will establish this graph's score using three criteria :
Trend chart pivot points: if the last two pivots, high and low, are increasing, the score is 1; if they are decreasing, the score is -1; else the score is 0.
SMA: if its slope is increasing with a candle strictly above the SMA value, the score is 1; if its slope is decreasing with a candle strictly below it, the score is -1; otherwise, it is 0.
MACD: if the MACD is positive, the score is 1, if it is negative, the score is -1; else it's 0.
We then sum the scores of these three criteria to find the trend score.
Velocity Scoring System :
In the same way, we analyze the score of the "velocity" graph with its corresponding timeframe using three criteria :
The EMA: if its slope is increasing with a candle strictly above the EMA value, the score is 1; if its slope is decreasing with a candle strictly below it, the score is -1; otherwise, it is 0.
The RSI: if the RSI's EMA has an increasing slope with an RSI strictly greater than the value of this EMA, the score is 1; and if the RSI's EMA has a decreasing slope with an RSI strictly less than this EMA, the score is -1; otherwise it is 0.
SAR parabolic: if the SAR is below the price, the score is 1; if it is above the price, the score is -1.
We then sum the scores of these three criteria to find the velocity score.
Relative Strength Scoring System :
Once the trend score and velocity score have been calculated, we determine the relative strength score of each currency using the following algorithm :
If trend score >=2 and velocity score >=2, the currency is bullish.
If trend score <=2 and velocity score <=2, currency is bearish
If (trendScore>=2 or velocityScore>=2) and (trendScore=1 or velocityScore=1) the currency is not yet bullish
If (trendScore<=2 or velocityScore<=2) and (trendScore=-1 or velocityScore=-1) the currency is not yet bearish.
Otherwise the currency is neutral
Parameters :
Trading Timeframe: the trading timeframe chosen by the trader for which he makes his position entry and exit decisions. Default is 1h
Pivot Legs: Parameter used for the chart "Trend" setting the pivot strength to the right and left of high/low. Default is 2
SMA Length: SMA length of the chart "Trend". Default is 20
MACD Fast Length: Length of the MACD fast SMA calculated on the chart "Trend". Default is 12
MACD Slow Length: Length of the MACD slow SMA calculated on the chart "Trend". Default is 26
MACD Signal Length: Length of the MACD signal SMA calculated on the chart "Trend". Default is 9
EMA Length: EMA length of the "Velocity" graph. Default is 13
RSI Length: RSI length of the "Velocity" graph. Default is 14
RSI EMA Length: Length of the RSI EMA. Default is 9
Parabolic SAR Start: Start of the SAR parabola in the "Velocity" graph. Default is 0.02
Parabolic SAR Increment: Increment of the SAR parabola in the "Velocity" graph. Default is 0.02
Parabolic SAR Max: Maximum of the SAR parabola in the "Velocity" graph. Default is 0.2
Conclusion :
This indicator has been designed to determine the relative strength of the major currencies against each other. The aim is to know which pair to trade at the right time in order to maximize the probability of a successful trade. For example, if the USD is bullish and the NZD bearish, we'll short the NZDUSD pair.
Enjoy this indicator and don't forget to take the trade ;)
Vo-S-Di-T-I - Volatility Scaled Directional Trend IndicatorThis code represents just the foundation for what's to come. It lays the groundwork for a more sophisticated quant trading model, offering a glimpse into the potential of future developments. I hope my contribution to this community will be valued. I'm here for idea exchanges and coding together, with the key emphasis on ensuring everything we do is grounded on a solid statistical basis.
----------------------------------------------------------------------------------------------------------------------
The developed code is based on a rigorous quantitative approach for analyzing price trends in the equity sector, utilizing advanced statistical methodology to scale returns based on the volatility observed over predefined periods of 20 and 50 days. This technique for normalizing returns allows us to eliminate distortions due to the intrinsic variability of prices and focus on the underlying structure of price behavior. The primary goal of the code is not to speculatively predict future market movements but rather to identify potential reversal trend signals through price dynamics analysis, within an optimized risk and return context.
Our approach is distinguished by the use of statistical decomposition techniques and time series analysis to interpret price variations as indicators of possible shifts in market behavior. This allows distinguishing between random or short-term price movements and true trend changes, providing a solid foundation for more informed investment decisions.
The current code represents the initial phase of a broader project that envisages the integration of machine learning algorithms to further refine the ability to detect significant changes in price trends. Through the application of predictive models and machine learning techniques, we intend to explore complex patterns in historical price data that may precede trend reversals, always respecting the principles of rigorous statistical analysis and risk management. This development and learning path will allow us to continuously improve investment strategies, leveraging the analytical capabilities of modern data science algorithms applied to the financial sector.
HOW TO READ
Simply put, Z values above 0 indicate an uptrend, while values below indicate a downtrend. IMPORTANT: It is not necessary to consider any crosses between Z-Short and Z-Long, but only potential crosses with 0.
The initial values are set at 20 and 50, but everyone is free to choose the most suitable periods, as long as all choices have valid statistical significance. My advice is to use R or MatLab to explore the best correlation between N and price movements. The reason I have set two values for N (Short and Long) is because it's interesting to assess short-term and medium-to-long-term trends to understand if price movements can lead to reversals only in the short term or also in the medium to long term. This idea came to me because I believe all other trend determination systems have too much lag and unpredictability.
Flags and Pennants [Trendoscope®]🎲 An extension to Chart Patterns based on Trend Line Pairs - Flags and Pennants
After exploring Algorithmic Identification and Classification of Chart Patterns and developing Auto Chart Patterns Indicator , we now delve into extensions of these patterns, focusing on Flag and Pennant Chart Patterns. These patterns evolve from basic trend line pair-based structures, often influenced by preceding market impulses.
🎲 Identification rules for the Extension Patterns
🎯 Identify the existence of Base Chart Patterns
Before identifying the flag and pennant patterns, we first need to identify the existence of following base trend line pair based converging or parallel patterns.
Ascending Channel
Descending Channel
Rising Wedge (Contracting)
Falling Wedge (Contracting)
Converging Triangle
Descending Triangle (Contracting)
Ascending Triangle (Contracting)
🎯 Identifying Extension Patterns.
The key to pinpointing these patterns lies in spotting a strong impulsive wave – akin to a flagpole – preceding a base pattern. This setup suggests potential for an extension pattern:
A Bullish Flag emerges from a positive impulse followed by a descending channel or a falling wedge
A Bearish Flag appears after a negative impulse leading to an ascending channel or a rising wedge.
A Bullish Pennant is indicated by a positive thrust preceding a converging triangle or ascending triangle.
A Bearish Pennant follows a negative impulse and a converging or descending triangle.
🎲 Pattern Classifications and Characteristics
🎯 Bullish Flag Pattern
Characteristics of Bullish Flag Pattern are as follows
Starts with a positive impulse wave
Immediately followed by either a short descending channel or a falling wedge
Here is an example of Bullish Flag Pattern
🎯 Bearish Flag Pattern
Characteristics of Bearish Flag Pattern are as follows
Starts with a negative impulse wave
Immediately followed by either a short ascending channel or a rising wedge
Here is an example of Bearish Flag Pattern
🎯 Bullish Pennant Pattern
Characteristics of Bullish Pennant Pattern are as follows
Starts with a positive impulse wave
Immediately followed by either a converging triangle or ascending triangle pattern.
Here is an example of Bullish Pennant Pattern
🎯 Bearish Pennant Pattern
Characteristics of Bearish Pennant Pattern are as follows
Starts with a negative impulse wave
Immediately followed by either a converging triangle or a descending converging triangle pattern.
Here is an example of Bearish Pennant Pattern
🎲 Trading Extension Patterns
In a strong market trend, it's common to see temporary periods of consolidation, forming patterns that either converge or range, often counter to the ongoing trend direction. Such pauses may lay the groundwork for the continuation of the trend post-breakout. The assumption that the trend will resume shapes the underlying bias of Flag and Pennant patterns
It's important, however, not to base decisions solely on past trends. Conducting personal back testing is crucial to ascertain the most effective entry and exit strategies for these patterns. Remember, the behavior of these patterns can vary significantly with the volatility of the asset and the specific timeframe being analyzed.
Approach the interpretation of these patterns with prudence, considering that market dynamics are subject to a wide array of influencing factors that might deviate from expected outcomes. For investors and traders, it's essential to engage in thorough back testing, establishing entry points, stop-loss orders, and target goals that align with your individual trading style and risk appetite. This step is key to assessing the viability of these patterns in line with your personal trading strategies and goals.
It's fairly common to witness a breakout followed by a swift price reversal after these patterns have formed. Additionally, there's room for innovation in trading by going against the bias if the breakout occurs in the opposite direction, specially when the trend before the formation of the pattern is in against the pattern bias.
🎲 Cheat Sheet
🎲 Indicator Settings
Custom Source : Enables users to set custom OHLC - this means, the indicator can also be applied on oscillators and other indicators having OHLC values.
Zigzag Settings : Allows users to enable different zigzag base and set length and depth for each zigzag.
Scanning Settings : Pattern scanning settings set some parameters that define the pattern recognition process.
Display Settings : Determine the display of indicators including colors, lines, labels etc.
Backtest Settings : Allows users to set a predetermined back test bars so that the indicator will not time out while trying to run for all available bars.
Least Median of Squares Regression | ymxbThe Least Median of Squares (LMedS) is a robust statistical method predominantly used in the context of regression analysis. This technique is designed to fit a model to a dataset in a way that is resistant to outliers. Developed as an alternative to more traditional methods like Ordinary Least Squares (OLS) regression, LMedS is distinguished by its focus on minimizing the median of the squares of the residuals rather than their mean. Residuals are the differences between observed and predicted values.
The key advantage of LMedS is its robustness against outliers. In contrast to methods that minimize the mean squared residuals, the median is less influenced by extreme values, making LMedS more reliable in datasets where outliers are present. This is particularly useful in linear regression, where it identifies the line that minimizes the median of the squared residuals, ensuring that the line is not overly influenced by anomalies.
STATISTICAL PROPERTIES
A critical feature of the LMedS method is its robustness, particularly its resilience to outliers. The method boasts a high breakdown point, which is a measure of an estimator's capacity to handle outliers. In the context of LMedS, this breakdown point is approximately 50%, indicating that it can tolerate corruption of up to half of the input data points without a significant degradation in accuracy. This robustness makes LMedS particularly valuable in real-world data analysis scenarios, where outliers are common and can severely skew the results of less robust methods.
Rousseeuw, Peter J.. “Least Median of Squares Regression.” Journal of the American Statistical Association 79 (1984): 871-880.
The LMedS estimator is also characterized by its equivariance under linear transformations of the response variable. This means that whether you transform the data first and then apply LMedS, or apply LMedS first and then transform the data, the end result remains consistent. However, it's important to note that LMedS is not equivariant under affine transformations of both the predictor and response variables.
ALGORITHM
The algorithm randomly selects pairs of points, calculates the slope (m) and intercept (b) of the line, and then evaluates the median squared deviation (mr2) from this line. The line minimizing this median squared deviation is considered the best fit.
DISCLAIMER
In the LMedS approach, a subset of the data is randomly selected to compute potential models (e.g., lines in linear regression). The method then evaluates these models based on the median of the squared residuals. Since the selection of data points is random, different runs may select different subsets, leading to variability in the computed models.
Qu_Trend+
composition
- Consists of a thick trend line and a thin yellow line.
- The largest (green/red) lines indicate rising and falling markets.
- This line represents the 13-candle moving average of Tilson T3.
- The reason for 13 candles is because it best matches the recent market price based on Bitcoin.
- This value cannot be changed, so if you need it, please modify the public code and use it.
- The yellow line is the MA20 line, the ‘Bollinger Band center line’
(UI will show whether this line has been breakout)
- The same algorithm as 20 of the basic moving average (close standard) is applied.
- The algorithm for breakthrough is calculated based on real-time prices, not based on closing prices.
An additional short-term SMA is created, and whether it crosses the SMA is classified as a breakout/resistance.
How to use it
- If the trend line becomes gentle, it may indicate a change in trend when + MA20 is broken.
- While the slope of the trend line is steep, it indicates that the trend is difficult to change.
(If the trend changes at this time, it is likely to move sideways)
- If the trend changes continuously, it is a sideways market.
At this time, watch out for the movement of the end point where the sideways trend ends.
Multi-Timeframe Recursive Zigzag [Trendoscope®]🎲 Welcome to the Advanced World of Zigzag Analysis
Embark on a journey through the most comprehensive and feature-rich Zigzag implementation you’ll ever encounter. Our Multi-Timeframe Recursive Zigzag Indicator is not just another tool; it's a groundbreaking advancement in technical analysis.
🎯 Key Features
Multi Time-Frame Support - One of the rare open-source Zigzag indicators with robust multi-timeframe capabilities, this feature sets our tool apart, enabling a broader and more dynamic market analysis.
Innovative Recursive Zigzag Algorithm - At its core is our unique Recursive Zigzag Algorithm, a pioneering development that powers multiple Zigzag levels, offering an intricate view of market movements. This proprietary algorithm is the backbone of our advanced pattern recognition indicators.
Sub-Waves and Micro-Waves Analysis - Dive deeper into market trends with our Sub-Waves and Micro-Waves feature. Sub-Waves reveal the interconnectedness of various Zigzag levels, while Micro-Waves offer insight into the fundamental waves at the base level.
Enhanced Indicator Tracking - Integrate and track your custom indicators or oscillators with the zigzag, capturing their values at each Zigzag level, complete with retracement ratios. This offers a comprehensive view of market dynamics.
Curved Zigzag Visualization - Experience a new way of visualizing market movements with our Curved Zigzag Display, employing Pine Script’s polyline feature for a more intuitive and visually appealing representation.
Built-in Customizable Alerts - Stay ahead with built-in alerts that can be customized via user input settings.
🎯 Practical Applications
Our Zigzag Indicator is designed with an understanding of its inherent nature - the last unconfirmed pivot that consistently repaints. This characteristic, while by design, directs its usage more towards pattern recognition rather than direct identification of market tops and bottoms. Here's how you can leverage the Zigzag Indicator:
Harmonic Patterns - Ideal for those familiar with harmonic patterns, this tool simplifies the manual spotting of complex XABCD, ABC, and ABCD patterns on charts.
Chart Patterns - Effortlessly identify patterns like Double/Triple Taps, Head and Shoulders, Inverse Head and Shoulders, and Cup and Handle patterns with enhanced clarity. Navigate through challenging patterns such as Triangles, Wedges, Flags, and Price Channels, where the Zigzag Indicator adds a layer of precision to your breakout strategy.
Elliott Wave Components - The indicator's detailed pivot highlighting aids in identifying key Elliott Wave components, enhancing your wave analysis and decision-making process.
🎲 Deep Dive into Indicator Features
Join us as we explore the intricate features of our indicator in more detail.
🎯 Multi-Timeframe Capability
Our indicator comes equipped with an input option for selecting the desired resolution. This unique feature allows users to view higher timeframe Zigzag patterns directly on their lower timeframe charts.
🎯 Recursive Multi Level Zigzag
Our advanced recursive approach creates multi-level Zigzags from lower-level data. For instance, the level 0 Zigzag forms the base, calculated from specified length and depth parameters, while level 1 Zigzag is derived using level 0 as its foundation, and so forth.
The indicator not only displays multiple Zigzag levels but also offers settings to emphasize specific levels for more detailed analysis.
🎯 Sub-Components and Micro-Components of Zigzag Wave
Sub-components within a Zigzag wave consist of the previous level's Zigzag pivots. Meanwhile, the micro-components are composed of the base level (Level 0) Zigzag pivots encapsulated within the wave.
🎯 Curved Zigzag
Experience a new perspective with our curved Zigzag display. This innovative feature utilizes the polyline curved option to automatically generate sinusoidal waves based on multiple points.
🎯 Indicator Tracking
Default indicators such as RSI, MFI, and OBV are included, alongside the ability to track one external indicator at each Zigzag pivot.
🎯 Customizable Alerts
Our indicator employs the `alert()` function for alert creation. While this means the absence of a customization text box in the alert settings, we've included a custom text area for users to create their own alert templates.
Template placeholders include:
{alertType} - type of alert. Either Confirmed Pivot Update or Last Pivot Update. Depends on the alert type selected in the inputs.
When Last Pivot Update type is selected, the alerts are triggered whenever there is a new Zigzag Pivot. This may also be a repaint of last unconfirmed pivot.
When Confirmed Pivot Update type is selected, the alerts are triggered only when a pivot becomes a confirmed pivot.
{level} - Zigzag level on which the alert is triggered.
{pivot} - Details of the last pivot or confirmed pivot including price, ratio, indicator values and ratios, subcomponent and micro-component pivots.
🎲 User Settings Overview
🎯 Zigzag and Generic Settings
This involves some generic zigzag calculation settings such as length, depth, and timeframe. And few display options such as theme, Highlight Level and Curved Zigzag. By default, zigzag calculation is done based on the latest real time bar. An option is provided to disable this and use only confirmed bars for the calculation.
Indicator Settings
Allows users to track one or more oscillators or volume indicators. Option to add any indicator via external input is provided.
🎯 Alert Settings
Has input fields required to select and customize alerts.
SuperTrend ToolkitThe SuperTrend Toolkit (Super Kit) introduces a versatile approach to trend analysis by extending the application of the SuperTrend indicator to a wide array of @TradingView's built-in or Community Scripts . This tool facilitates the integration of the SuperTrend algorithm with various indicators, including oscillators, moving averages, overlays, and channels.
Methodology:
The SuperTrend, at its core, calculates a trend-following indicator based on the Average-True-Range (ATR) and price action. It creates dynamic support and resistance levels, adjusting to changing market conditions, and aiding in trend identification.
pine_st(simple float factor = 3., simple int length = 10) =>
float atr = ta.atr(length)
float up = hl2 + factor * atr
up := up < nz(up ) or close > nz(up ) ? up : nz(up )
float lo = hl2 - factor * atr
lo := lo > nz(lo ) or close < nz(lo ) ? lo : nz(lo )
int dir = na
float st = na
if na(atr )
dir := 1
else if st == nz(up )
dir := close > up ? -1 : 1
else
dir := close < lo ? 1 : -1
st := dir == -1 ? lo : up
@TradingView's native SuperTrend lacks the flexibility to incorporate different price sources into its calculation.
Community scripts, addressed the limitation by implementing the option to input different price sources, for example, one of the most popular publications, @KivancOzbilgic's SuperTrend script.
In May 2023, @TradingView introduced an update allowing the passing of another indicator's plot as a source value via the input.source() function. However, the built-in ta.atr function still relied on the chart's price data, limiting the formerly mentioned scripts to the chart's price data alone.
Unique Approach -
This script addresses the aforementioned limitations by processing the data differently.
Firstly we create a User-Defined-Type (UDT) replicating a bar's open, high, low, close (OHLC) values.
type bar
float o = open
float h = high
float l = low
float c = close
We then use this type to store the external input data.
src = input.source(close, "External Source")
bar b = bar.new(
nz(src ) , open 𝘷𝘢𝘭𝘶𝘦
math.max(nz(src ), src), high 𝘷𝘢𝘭𝘶𝘦
math.min(nz(src ), src), low 𝘷𝘢𝘭𝘶𝘦
src ) close 𝘷𝘢𝘭𝘶𝘦
Finally, we pass the data into our custom built SuperTrend with ATR functions to derive the external source's version of the SuperTrend indicator.
supertrend st = b.st(mlt, len)
- Setup Guide -
Utility and Use Cases:
Universal Compatibility - Apply SuperTrend to any built-in indicator or script, expanding its use beyond traditional price data.
- A simple example on one of my own public scripts -
Trend Analysis - Gain additional trend insights into otherwise mainly mean reverting or volume indicators.
- Alerts Setup Guide -
The Super Kit empowers traders and analysts with a tool that adapts the robust SuperTrend algorithm to a myriad of indicators, allowing comprehensive trend analysis and strategy development.
Multi-TF AI SuperTrend with ADX - Strategy [PresentTrading]
## █ Introduction and How it is Different
The trading strategy in question is an enhanced version of the SuperTrend indicator, combined with AI elements and an ADX filter. It's a multi-timeframe strategy that incorporates two SuperTrends from different timeframes and utilizes a k-nearest neighbors (KNN) algorithm for trend prediction. It's different from traditional SuperTrend indicators because of its AI-based predictive capabilities and the addition of the ADX filter for trend strength.
BTC 8hr Performance
ETH 8hr Performance
## █ Strategy, How it Works: Detailed Explanation (Revised)
### Multi-Timeframe Approach
The strategy leverages the power of multiple timeframes by incorporating two SuperTrend indicators, each calculated on a different timeframe. This multi-timeframe approach provides a holistic view of the market's trend. For example, a 8-hour timeframe might capture the medium-term trend, while a daily timeframe could capture the longer-term trend. When both SuperTrends align, the strategy confirms a more robust trend.
### K-Nearest Neighbors (KNN)
The KNN algorithm is used to classify the direction of the trend based on historical SuperTrend values. It uses weighted voting of the 'k' nearest data points. For each point, it looks at its 'k' closest neighbors and takes a weighted average of their labels to predict the current label. The KNN algorithm is applied separately to each timeframe's SuperTrend data.
### SuperTrend Indicators
Two SuperTrend indicators are used, each from a different timeframe. They are calculated using different moving averages and ATR lengths as per user settings. The SuperTrend values are then smoothed to make them suitable for KNN-based prediction.
### ADX and DMI Filters
The ADX filter is used to eliminate weak trends. Only when the ADX is above 20 and the directional movement index (DMI) confirms the trend direction, does the strategy signal a buy or sell.
### Combining Elements
A trade signal is generated only when both SuperTrends and the ADX filter confirm the trend direction. This multi-timeframe, multi-indicator approach reduces false positives and increases the robustness of the strategy.
By considering multiple timeframes and using machine learning for trend classification, the strategy aims to provide more accurate and reliable trade signals.
BTC 8hr Performance (Zoom-in)
## █ Trade Direction
The strategy allows users to specify the trade direction as 'Long', 'Short', or 'Both'. This is useful for traders who have a specific market bias. For instance, in a bullish market, one might choose to only take 'Long' trades.
## █ Usage
Parameters: Adjust the number of neighbors, data points, and moving averages according to the asset and market conditions.
Trade Direction: Choose your preferred trading direction based on your market outlook.
ADX Filter: Optionally, enable the ADX filter to avoid trading in a sideways market.
Risk Management: Use the trailing stop-loss feature to manage risks.
## █ Default Settings
Neighbors (K): 3
Data points for KNN: 12
SuperTrend Length: 10 and 5 for the two different SuperTrends
ATR Multiplier: 3.0 for both
ADX Length: 21
ADX Time Frame: 240
Default trading direction: Both
By customizing these settings, traders can tailor the strategy to fit various trading styles and assets.
[Library] VAccThis is the library version of VAcc (Velocity & Acceleration), a momentum indicator published by Scott Cong in Stocks & Commodities V. 41:09 (8–15). It applies concepts from physics, namely velocity and acceleration, to financial markets. VAcc functions similarly to the popular MACD (Moving Average Convergence Divergence) indicator when using a longer lookback period, but produces more responsive results. With shorter periods, VAcc exhibits characteristics reminiscent of the stochastic oscillator.
The indicator version of this algorithm is linked below:
🟠 Algorithm
The average velocity over the past n periods is defined as
((C - C_n) / n + (C - C_{n-1}) / (n - 1) + … + (C - C_i) / i + (C - C_1) / 1) / n
At its core, the velocity is a weighted average of the rate of change over the past n periods.
The calculation of the acceleration follows a similar process, where it’s defined as
((V - V_n) / n + (V - V_{n - 1}) / (n - 1) + … + (V - V_i) / i + (V - V_1) / 1) / n
🟠 Comparison with MACD
A comparison of VAcc and MACD on the daily Nasdaq 100 (NDX) chart from August 2022 helps demonstrate VAcc's improved sensitivity. Both indicators utilized a lookback period of 26 days and smoothing of 9 periods.
The VAcc histogram clearly shows a divergence forming, with momentum weakening as prices reached new highs. In contrast, the corresponding MACD histogram significantly lagged in confirming the divergence, highlighting VAcc's ability to identify subtle shifts in trend momentum more immediately than the traditional MACD.
AI SuperTrend - Strategy [presentTrading]
█ Introduction and How it is Different
The AI Supertrend Strategy is a unique hybrid approach that employs both traditional technical indicators and machine learning techniques. Unlike standard strategies that rely solely on traditional indicators or mathematical models, this strategy integrates the power of k-Nearest Neighbors (KNN), a machine learning algorithm, with the tried-and-true SuperTrend indicator. This blend aims to provide traders with more accurate, responsive, and context-aware trading signals.
*The KNN part is mainly referred from @Zeiierman.
BTCUSD 8hr performance
ETHUSD 8hr performance
█ Strategy, How it Works: Detailed Explanation
SuperTrend Calculation
Volume-Weighted Moving Average (VWMA): A VWMA of the close price is calculated based on the user-defined length (len). This serves as the central line around which the upper and lower bands are calculated.
Average True Range (ATR): ATR is calculated over a period defined by len. It measures the market's volatility.
Upper and Lower Bands: The upper band is calculated as VWMA + (factor * ATR) and the lower band as VWMA - (factor * ATR). The factor is a user-defined multiplier that decides how wide the bands should be.
KNN Algorithm
Data Collection: An array (data) is populated with recent n SuperTrend values. Corresponding labels (labels) are determined by whether the weighted moving average price (price) is greater than the weighted moving average of the SuperTrend (sT).
Distance Calculation: The absolute distance between each data point and the current SuperTrend value is calculated.
Sorting & Weighting: The distances are sorted in ascending order, and the closest k points are selected. Each point is weighted by the inverse of its distance to the current point.
Classification: A weighted sum of the labels of the k closest points is calculated. If the sum is closer to 1, the trend is predicted as bullish; if closer to 0, bearish.
Signal Generation
Start of Trend: A new bullish trend (Start_TrendUp) is considered to have started if the current trend color is bullish and the previous was not bullish. Similarly for bearish trends (Start_TrendDn).
Trend Continuation: A bullish trend (TrendUp) is considered to be continuing if the direction is negative and the KNN prediction is 1. Similarly for bearish trends (TrendDn).
Trading Logic
Long Condition: If Start_TrendUp or TrendUp is true, a long position is entered.
Short Condition: If Start_TrendDn or TrendDn is true, a short position is entered.
Exit Condition: Dynamic trailing stops are used for exits. If the trend does not continue as indicated by the KNN prediction and SuperTrend direction, an exit signal is generated.
The synergy between SuperTrend and KNN aims to filter out noise and produce more reliable trading signals. While SuperTrend provides a broad sense of the market direction, KNN refines this by predicting short-term price movements, leading to a more nuanced trading strategy.
Local picture
█ Trade Direction
The strategy allows traders to choose between taking only long positions, only short positions, or both. This is particularly useful for adapting to different market conditions.
█ Usage
ToolTips: Explains what each parameter does and how to adjust them.
Inputs: Customize values like the number of neighbors in KNN, ATR multiplier, and moving average type.
Plotting: Visual cues on the chart to indicate bullish or bearish trends.
Order Execution: Based on the generated signals, the strategy will execute buy/sell orders.
█ Default Settings
The default settings are selected to provide a balanced approach, but they can be modified for different trading styles and asset classes.
Initial Capital: $10,000
Default Quantity Type: 10% of equity
Commission: 0.1%
Slippage: 1
Currency: USD
By combining both machine learning and traditional technical analysis, this strategy offers a sophisticated and adaptive trading solution.
Elliott Wave with Supertrend Exit - Strategy [presentTrading]## Introduction and How it is Different
The Elliott Wave with Supertrend Exit provides automated detection and validation of Elliott Wave patterns for algorithmic trading. It is designed to objectively identify high-probability wave formations and signal entries based on confirmed impulsive and corrective patterns.
* The Elliott part is mostly referenced from Elliott Wave by @LuxAlgo
Key advantages compared to discretionary Elliott Wave analysis:
- Wave Labeling and Counting: The strategy programmatically identifies swing pivot highs/lows with the Zigzag indicator and analyzes the waves between them. It labels the potential impulsive and corrective patterns as they form. This removes the subjectivity of manual wave counting.
- Pattern Validation: A rules-based engine confirms valid impulsive and corrective patterns by checking relative size relationships and fib ratios. Only confirmed wave counts are plotted and traded.
- Objective Entry Signals: Trades are entered systematically on the start of new impulsive waves in the direction of the trend. Pattern failures invalidate setups and stop out positions.
- Automated Trade Management: The strategy defines specific rules for profit targets at fib extensions, trailing stops at swing points, and exits on Supertrend reversals. This automates the entire trade lifecycle.
- Adaptability: The waveform recognition engine can be tuned by adjusting parameters like Zigzag depth and Supertrend settings. It adapts to evolving market conditions.
ETH 1hr chart
In summary, the strategy brings automation, objectivity and adaptability to Elliott Wave trading - removing subjective interpretation errors and emotional trading biases. It implements a rules-based, algorithmic approach for systematically trading Elliott Wave patterns across markets and timeframes.
## Trading Logic and Rules
The strategy follows specific trading rules based on the detected and validated Elliott Wave patterns.
Entry Rules
- Long entry when a new impulsive bullish (5-wave) pattern forms
- Short entry when a new impulsive bearish (5-wave) pattern forms
The key is entering on the start of a new potential trend wave rather than chasing.
Exit Rules
- Invalidation of wave pattern stops out the trade
- Close long trades on Supertrend downturn
- Close short trades on Supertrend upturn
- Use a stop loss of 10% of entry price (configurable)
Trade Management
- Scale out partial profits at Fibonacci levels
- Move stop to breakeven when price reaches 1.618 extension
- Trail stops below key swing points
- Target exits at next Fibonacci projection level
Risk Management
- Use stop losses on all trades
- Trade only highest probability setups
- Size positions according to chart timeframe
- Avoid overtrading when no clear patterns emerge
## Strategy - How it Works
The core logic follows these steps:
1. Find swing highs/lows with Zigzag indicator
2. Analyze pivot points to detect impulsive 5-wave patterns:
- Waves 1, 3, and 5 should not overlap
- Waves 3 and 5 must be longer than wave 1
- Confirm relative size relationships between waves
3. Validate corrective 3-wave patterns:
- Look for overlapping, choppy waves that retrace the prior impulsive wave
4. Plot validated waves and Fibonacci retracement levels
5. Signal entries when a new impulsive wave pattern forms
6. Manage exits based on pattern failures and Supertrend reversals
Impulsive Wave Validation
The strategy checks relative size relationships to confirm valid impulsive waves.
For uptrends, it ensures:
```
Copy code- Wave 3 is longer than wave 1
- Wave 5 is longer than wave 2
- Waves do not overlap
```
Corrective Wave Validation
The strategy identifies overlapping corrective patterns that retrace the prior impulsive wave within Fibonacci levels.
Pattern Failure Invalidation
If waves fail validation tests, the strategy invalidates the pattern and stops signaling trades.
## Trade Direction
The strategy detects impulsive and corrective patterns in both uptrends and downtrends. Entries are signaled in the direction of the validated wave pattern.
## Usage
- Use on charts showing clear Elliott Wave patterns
- Start with daily or weekly timeframes to gauge overall trend
- Optimize Zigzag and Supertrend settings as needed
- Consider combining with other indicators for confirmation
## Default Settings
- Zigzag Length: 4 bars
- Supertrend Length: 10 bars
- Supertrend Multiplier: 3
- Stop Loss: 10% of entry price
- Trading Direction: Both
Pullback AnalyzerPullback Analyzer - a trailing stop helper.
This indicator measures the biggest pullback encountered during an up or down move.
You can use the reported percentages to fine-tune your trailing stop.
The reporting is very precise: On higher timeframes, the pullback size can sometimes not be determined exactly from the candles.
In this case, the script displays a lower and upper bound for this number.
I suggest that you use the upper bound as your trailing stop callback rate (plus some safety margin if you like).
The size of the move itself is always reported as a lower bound.
The biggest pullback within each move is marked with a gray dotted line.
There is only one parameter, "lookback"' (or lookback limit), which determines how many bars a single move can comprise. A value of 50 was found to be a nice default. If you lower the lookback, long moves will be split up into multiple moves, each being at or below the lookback limit. Conversely, you can capture longer moves in one piece by raising the lookback limit.
The algorithm automatically ignores small moves and trading ranges near a bigger move. (We may add a parameter to control this behavior more precisely in the future.)
How the algorithm works
There is a central class called MoveFinder which scans the candle feed for the biggest possible move in a certain direction (up or down).
Two instances of this class are used, one for each direction, to find the biggest next up and down move simultaneously (upFinder and downFinder).
Additionally, each of these main MoveFinders contains two more MoveFinders. These are used to find pullbacks within the move. (This comes from the observation that finding a pullback is fundamentally the exact same operation as finding a move, just with opposing direction and limited to the time between the move's beginning and end.)
Why two nested MoveFinders per parent (for a total of 6 in the program)? Well, one of them runs in "lower bound" and one runs in "upper bound" mode, so we can print the detected pullback size as an exact interval (lower bound <= real pullback <= upper bound). I am a mathematician. I like precision.
Moves as well as pullbacks that have been found are stored as instances of class Move which simply stores start and end bar index as well as start and end price.
1m Divergence Radar v.1 === Version 1 Beta, Revision 400 ===
=== Divergence Radar ===
=== Jason Tang ===
DESCRIPTION:
This script monitors several other indicators in the background, and when it detects certain combinations that indicate bullish or bearish divergences, it will create a buy or sell signal and shade the background green or red.
The indicators that this script monitors:
- 1m, 3m, 5m MACDS
- Higher Lows (Bullish Divergence) on the 3m and 5m MACD
- Lower Highs (Bearish Divergence) on the 3m and 5m MACD
- Lower Highs on the 3m and 5m DMI for buying strength (Bearish Divergence)
- Lower Highs on the 3m and 5m DMI for selling strength (Bullish Divergence)
- The 1m and 3m Keltner channel (shown as orange backgrounds only), to detect extremes in price.
The indicator will also watch for "squeeze" or "crash" conditions, at which time it will avoid sending a sell or buy signal. I have had many frustrations from shorting into a squeeze, and coded in a "don't catch the knife" safety mechanism.
To see these internal calculations, you can go to settings and check "Show Internals". Then you can check the Style tab for a label for each internal indicator.
WHY I MADE THIS:
I often watch multiple timeframes while day trading and it can be a mentally difficult task to keep track of all of the indicators on each timeframe. 1m, 3m, 5m, price candles, MACD, DMI, and more. This indicator is meant to "offload" much of the routine mental calculation like "Is there a MACD divergence on this timeframe?". It also provides me a way to visually backtest the strength of combinations of divergences. This is an ongoing project.
USAGE:
- This indicator should mainly be used on the 1m ES chart. It is meant to assist me with day trading the ES futures contract.
- Please keep in mind this is a BETA script and is in ongoing development. I tune it almost every day or week and will update it on a regular basis.
- The "buy" and "sell" zones this indicator shows are COUNTER-TREND indicators. Please keep that in mind.
- If price is RISING into a RED background, I would consider selling, if my other systems agree and if I find the risk/reward acceptable.
- If price is FALLING into a GREEN background, I would consider buying, if my other systems agree and if I find the risk/reward acceptable.
A dim RED background:
- The presence of lower highs on the 3m MACD, 5m MACD, 3m DMI Buying Strength, or 5m DMI Buying Strength
A bright RED background:
- An extremely overdone price move that is also showing some divergences. My best effort at algorithmically detecting a place to sell.
A dim GREEN background:
- The presence of higher lows on the 3m MACD, 5m MACD
- The presence of lower highs on the 3m DMI Selling Strength, or 5m DMI Selling Strength.
A bright GREEN background:
- An extremely oversold price that is also showing some divergences. My best effort at algorithmically detecting a place a buy.
A bright green dot above price (if Show Internals is checked):
- A SQUEEZE signal that cuts off any sell signal. In these conditions technical indicators do not seem to matter as forced buyers are dominating the price action. Do not be tempted to short the rip.
A bright red dot below price (if Show Internals is checked):
- A CRASH signal that cuts off any buy signal. In these conditions technical indicators do not seem to matter as forced sellers are dominating the price action. Do not be tempted to catch the knife.
REVE Cohorts - Range Extension Volume Expansion CohortsREVE Cohorts stands for Range Extensions Volume Expansions Cohorts.
Volume is divided in four cohorts, these are depicted in the middle band with colors and histogram spikes.
0-80 percent i.e. low volumes; these get a green color and a narrow histogram bar
80-120 percent, normal volumes, these get a blue color and a narrow histogram bar
120-200 percent, high volume, these get an orange color and a wide histogram bar
200 and more percent is extreme volume, maroon color and wide bar.
All histogram bars have the same length. They point to the exact candle where the volume occurs.
Range is divided in two cohorts, these are depicted as candles above and below the middle band.
0-120 percent: small and normal range, depicted as single size, square candles
120 percent and more, wide range depicted as double size, rectangular candles.
The range candles are placed and colored according to the Advanced Price Algorithm (published script). If the trend is up, the candles are in the uptrend area, which is above the volume band, , downtrend candles below in the downtrend area. Dark blue candles depict a price movement which confirms the uptrend, these are of course in the uptrend area. In this area are also light red candles with a blue border, these depict a faltering price movement countering the uptrend. In the downtrend area, which is below the volume band, are red candles which depict a price movement confirming the downtrend and light blue candles with a red border depicting price movement countering the downtrend. A trend in the Advanced Price Algorithm is in equal to the direction of a simple moving average with the same lookback. The indicator has the same lagging.as this SMA.
Signals are placed in the vacated spaces, e.g. during an uptrend the downtrend area is vacated.
There are six signals, which arise as follows:
1 Two blue triangles up on top of each other: high or extreme volume in combination with wide range confirming uptrend. This indicates strong and effective up pressure in uptrend
2 Two pink tringles down on top of each other: high or extreme volume in combination with wide range down confirming downtrend. This indicates strong and effective down pressure in downtrend
3 Blue square above pink down triangle down: extreme volume in combination with wide range countering uptrend. This indicates a change of heart, down trend is imminent, e.g. during a reversal pattern. Down Pressure in uptrend
4 Pink square below blue triangle up: extreme volume in combination with wide range countering downtrend. This indicates a change of heart, reversal to uptrend is imminent. Up Pressure in downtrend
5 single blue square: a. extreme volume in combination with small range confirming uptrend, b. extreme volume in combination with small range countering downtrend, c. high volume in combination with wide range countering uptrend. This indicates halting upward price movement, occurs often at tops or during distribution periods. Unresolved pressure in uptrend
6 Single pink square: a extreme volume in combination with small range confirming downtrend, b extreme volume in combination with small range countering uptrend, c high volume in combination with wide range countering downtrend. This indicated halting downward price movement. Occurs often at bottoms or during accumulation periods. Unresolved pressure in downtrend.
The signals 5 and 6 are introduced to prevent flipping of signals into their opposite when the lookback is changed. Now signals may only change from unresolved in directional or vice versa. Signals 3 and 4 were introduced to make sure that all occurrences of extreme volume will result in a signal. Occurrences of wide volume only partly lead to a signal.
Use of REVE Cohorts.
This is the indicator for volume-range analyses that I always wanted to have. Now that I managed to create it, I put it in all my charts, it is often the first part I look at, In my momentum investment system I use it primarily in the layout for following open positions. It helps me a lot to decide whether to close or hold a position. The advantage over my previous attempts to create a REVE indicator (published scripts), is that this version is concise because it reports and classifies all possible volumes and ranges, you see periods of drying out of volume, sequences of falter candles, occurrences of high morning volume, warning and confirming signals.. The assessment by script whether some volume should be considered low, normal, high or extreme gives an edge over using the standard volume bars.
Settings of REVE Cohorts
The default setting for lookback is ‘script sets lookback’ I put this in my indicators because I want them harmonized, the script sets lookback according to timeframe. The tooltip informs which lookback will be set at which timeframe, you can enable a feedback label to show the current lookback. If you switch ‘script sets lookback’ off, you can set your own preferred user lookback. The script self-adapts its settings in such a way that it will show up from the very first bar of historical chart data, it adds volume starting at the fourth bar.
You can switch off volume cohorts, only range candles will show while the middle band disappears. Signals will remain if volume is present in the data. Some Instruments have no volume data, e.g. SPX-S&P 500 Index,, then only range candles will be shown.
Colors can be adapted in the inputs. Because the script calculates matching colors with more transparency it is advised to use 100 percent opacity in these settings.
Take care, Eykpunter
28 Levels V0.1V 0.1
Daily, weekly and monthly important key levels for trading options.
FYI: Not fully functional. It will take ongoing effort to complete the algo.
Trend Momentum SynthesizerBy analyzing the MACD (Moving Average Convergence Divergence) and Squeeze Momentum indicators, this indicator helps identify potential bullish, bearish, or undecided market conditions.
The algorithm within considers the positions of the MACD and Squeeze Momentum indicators to determine the overall market sentiment. When the indicators align and indicate a bullish market condition, the indicator's plot color will be either dark green, green, yellow, or lime, indicating a potential bullish trend. Conversely, if the indicators align and indicate a bearish market condition, the plot color will be maroon or red, denoting a potential bearish trend. When the indicators are inconclusive, the plot color will be orange, suggesting an undecided market.
The ADX is an addon component of this indicator, helping to assess the strength of a trend. By analyzing the ADX, the indicator determines whether a trend is strong enough, providing additional confirmation for potential trade signals. The ADX smoothing and DI (Directional Index) length parameters can be customized to suit individual trading preferences.
By combining these indicators, the algorithm provides traders with a comprehensive view of the market, helping them make informed trading decisions. It aims to assist traders in identifying potential market opportunities and aligns with the objective of maximizing trading performance.
How to use the indicator:
Note: I used back-testing for fine tuning do not base your trades on signals from the testing framework.
Simple ICT Market Structure by toodegreesThis Simple ICT Market Structure is based on the teachings of ICT, specifically in his episode 12 of the Public 2022 Mentorship.
The only omission here is the peculiar calculation of Intermediate Term points, for which I am not using the concept of repricing imbalances – this can be added later!
Feel free to use this tool, however it is quite simple and market structure is something we all know very well how to spot. In my opinion it is helpful to display the long term swing points to identify more mature pools of liquidity.
The reason for coding this tool is to help new coders understand PineScript (I have a video tutorial where I code this from start to finish), as well as fostering some algorithmic thinking in your trading of ICT Concepts and Algorithmic Delivery.
If you have any questions about the code, shoot me a message!
Hope you learn something and GLGT!
Stochastic RSI of Smoothed Price [Loxx]What is Stochastic RSI of Smoothed Price?
This indicator is just as it's title suggests. There are six different signal types, various price smoothing types, and seven types of RSI.
This indicator contains 7 different types of RSI:
RSX
Regular
Slow
Rapid
Harris
Cuttler
Ehlers Smoothed
What is RSI?
RSI stands for Relative Strength Index . It is a technical indicator used to measure the strength or weakness of a financial instrument's price action.
The RSI is calculated based on the price movement of an asset over a specified period of time, typically 14 days, and is expressed on a scale of 0 to 100. The RSI is considered overbought when it is above 70 and oversold when it is below 30.
Traders and investors use the RSI to identify potential buy and sell signals. When the RSI indicates that an asset is oversold, it may be considered a buying opportunity, while an overbought RSI may signal that it is time to sell or take profits.
It's important to note that the RSI should not be used in isolation and should be used in conjunction with other technical and fundamental analysis tools to make informed trading decisions.
What is RSX?
Jurik RSX is a technical analysis indicator that is a variation of the Relative Strength Index Smoothed ( RSX ) indicator. It was developed by Mark Jurik and is designed to help traders identify trends and momentum in the market.
The Jurik RSX uses a combination of the RSX indicator and an adaptive moving average (AMA) to smooth out the price data and reduce the number of false signals. The adaptive moving average is designed to adjust the smoothing period based on the current market conditions, which makes the indicator more responsive to changes in price.
The Jurik RSX can be used to identify potential trend reversals and momentum shifts in the market. It oscillates between 0 and 100, with values above 50 indicating a bullish trend and values below 50 indicating a bearish trend . Traders can use these levels to make trading decisions, such as buying when the indicator crosses above 50 and selling when it crosses below 50.
The Jurik RSX is a more advanced version of the RSX indicator, and while it can be useful in identifying potential trade opportunities, it should not be used in isolation. It is best used in conjunction with other technical and fundamental analysis tools to make informed trading decisions.
What is Slow RSI?
Slow RSI is a variation of the traditional Relative Strength Index ( RSI ) indicator. It is a more smoothed version of the RSI and is designed to filter out some of the noise and short-term price fluctuations that can occur with the standard RSI .
The Slow RSI uses a longer period of time than the traditional RSI , typically 21 periods instead of 14. This longer period helps to smooth out the price data and makes the indicator less reactive to short-term price fluctuations.
Like the traditional RSI , the Slow RSI is used to identify potential overbought and oversold conditions in the market. It oscillates between 0 and 100, with values above 70 indicating overbought conditions and values below 30 indicating oversold conditions. Traders often use these levels as potential buy and sell signals.
The Slow RSI is a more conservative version of the RSI and can be useful in identifying longer-term trends in the market. However, it can also be slower to respond to changes in price, which may result in missed trading opportunities. Traders may choose to use a combination of both the Slow RSI and the traditional RSI to make informed trading decisions.
What is Rapid RSI?
Same as regular RSI but with a faster calculation method
What is Harris RSI?
Harris RSI is a technical analysis indicator that is a variation of the Relative Strength Index ( RSI ). It was developed by Larry Harris and is designed to help traders identify potential trend changes and momentum shifts in the market.
The Harris RSI uses a different calculation formula compared to the traditional RSI . It takes into account both the opening and closing prices of a financial instrument, as well as the high and low prices. The Harris RSI is also normalized to a range of 0 to 100, with values above 50 indicating a bullish trend and values below 50 indicating a bearish trend .
Like the traditional RSI , the Harris RSI is used to identify potential overbought and oversold conditions in the market. It oscillates between 0 and 100, with values above 70 indicating overbought conditions and values below 30 indicating oversold conditions. Traders often use these levels as potential buy and sell signals.
The Harris RSI is a more advanced version of the RSI and can be useful in identifying longer-term trends in the market. However, it can also generate more false signals than the standard RSI . Traders may choose to use a combination of both the Harris RSI and the traditional RSI to make informed trading decisions.
What is Cuttler RSI?
Cuttler RSI is a technical analysis indicator that is a variation of the Relative Strength Index ( RSI ). It was developed by Curt Cuttler and is designed to help traders identify potential trend changes and momentum shifts in the market.
The Cuttler RSI uses a different calculation formula compared to the traditional RSI . It takes into account the difference between the closing price of a financial instrument and the average of the high and low prices over a specified period of time. This difference is then normalized to a range of 0 to 100, with values above 50 indicating a bullish trend and values below 50 indicating a bearish trend .
Like the traditional RSI , the Cuttler RSI is used to identify potential overbought and oversold conditions in the market. It oscillates between 0 and 100, with values above 70 indicating overbought conditions and values below 30 indicating oversold conditions. Traders often use these levels as potential buy and sell signals.
The Cuttler RSI is a more advanced version of the RSI and can be useful in identifying longer-term trends in the market. However, it can also generate more false signals than the standard RSI . Traders may choose to use a combination of both the Cuttler RSI and the traditional RSI to make informed trading decisions.
What is Ehlers Smoothed RSI?
Ehlers smoothed RSI is a technical analysis indicator that is a variation of the Relative Strength Index ( RSI ). It was developed by John Ehlers and is designed to help traders identify potential trend changes and momentum shifts in the market.
The Ehlers smoothed RSI uses a different calculation formula compared to the traditional RSI . It uses a smoothing algorithm that is designed to reduce the noise and random fluctuations that can occur with the standard RSI . The smoothing algorithm is based on a concept called "digital signal processing" and is intended to improve the accuracy of the indicator.
Like the traditional RSI , the Ehlers smoothed RSI is used to identify potential overbought and oversold conditions in the market. It oscillates between 0 and 100, with values above 70 indicating overbought conditions and values below 30 indicating oversold conditions. Traders often use these levels as potential buy and sell signals.
The Ehlers smoothed RSI can be useful in identifying longer-term trends and momentum shifts in the market. However, it can also generate more false signals than the standard RSI . Traders may choose to use a combination of both the Ehlers smoothed RSI and the traditional RSI to make informed trading decisions.
What is Stochastic RSI?
Stochastic RSI (StochRSI) is a technical analysis indicator that combines the concepts of the Stochastic Oscillator and the Relative Strength Index (RSI). It is used to identify potential overbought and oversold conditions in financial markets, as well as to generate buy and sell signals based on the momentum of price movements.
To understand Stochastic RSI, let's first define the two individual indicators it is based on:
Stochastic Oscillator: A momentum indicator that compares a particular closing price of a security to a range of its prices over a certain period. It is used to identify potential trend reversals and generate buy and sell signals.
Relative Strength Index (RSI): A momentum oscillator that measures the speed and change of price movements. It ranges between 0 and 100 and is used to identify overbought or oversold conditions in the market.
Now, let's dive into the Stochastic RSI:
The Stochastic RSI applies the Stochastic Oscillator formula to the RSI values, essentially creating an indicator of an indicator. It helps to identify when the RSI is in overbought or oversold territory with more sensitivity, providing more frequent signals than the standalone RSI.
The formula for StochRSI is as follows:
StochRSI = (RSI - Lowest Low RSI) / (Highest High RSI - Lowest Low RSI)
Where:
RSI is the current RSI value.
Lowest Low RSI is the lowest RSI value over a specified period (e.g., 14 days).
Highest High RSI is the highest RSI value over the same specified period.
StochRSI ranges from 0 to 1, but it is usually multiplied by 100 for easier interpretation, making the range 0 to 100. Like the RSI, values close to 0 indicate oversold conditions, while values close to 100 indicate overbought conditions. However, since the StochRSI is more sensitive, traders typically use 20 as the oversold threshold and 80 as the overbought threshold.
Traders use the StochRSI to generate buy and sell signals by looking for crossovers with a signal line (a moving average of the StochRSI), similar to the way the Stochastic Oscillator is used. When the StochRSI crosses above the signal line, it is considered a bullish signal, and when it crosses below the signal line, it is considered a bearish signal.
It is essential to use the Stochastic RSI in conjunction with other technical analysis tools and indicators, as well as to consider the overall market context, to improve the accuracy and reliability of trading signals.
Signal types included are the following;
Fixed Levels
Floating Levels
Quantile Levels
Fixed Middle
Floating Middle
Quantile Middle
Extras
Alerts
Bar coloring
Loxx's Expanded Source Types
Synthetic, Smoothed Variety RSI [Loxx]Synthetic, Smoothed Variety RSI is an RSI indicator that combines three RSI calculations into one to create a synthetic RSI output.
How this is done:
1. Three EMAs are created using different period inputs
2. Three RSIs are created using different period inputs and the EMA output from the first step
3. These three RSIs are averaged to create the Synthetic, Smoothed Variety RSI
This indicator contains 7 different types of RSI:
RSX
Regular
Slow
Rapid
Harris
Cuttler
Ehlers Smoothed
What is RSI?
RSI stands for Relative Strength Index . It is a technical indicator used to measure the strength or weakness of a financial instrument's price action.
The RSI is calculated based on the price movement of an asset over a specified period of time, typically 14 days, and is expressed on a scale of 0 to 100. The RSI is considered overbought when it is above 70 and oversold when it is below 30.
Traders and investors use the RSI to identify potential buy and sell signals. When the RSI indicates that an asset is oversold, it may be considered a buying opportunity, while an overbought RSI may signal that it is time to sell or take profits.
It's important to note that the RSI should not be used in isolation and should be used in conjunction with other technical and fundamental analysis tools to make informed trading decisions.
What is RSX?
Jurik RSX is a technical analysis indicator that is a variation of the Relative Strength Index Smoothed ( RSX ) indicator. It was developed by Mark Jurik and is designed to help traders identify trends and momentum in the market.
The Jurik RSX uses a combination of the RSX indicator and an adaptive moving average (AMA) to smooth out the price data and reduce the number of false signals. The adaptive moving average is designed to adjust the smoothing period based on the current market conditions, which makes the indicator more responsive to changes in price.
The Jurik RSX can be used to identify potential trend reversals and momentum shifts in the market. It oscillates between 0 and 100, with values above 50 indicating a bullish trend and values below 50 indicating a bearish trend . Traders can use these levels to make trading decisions, such as buying when the indicator crosses above 50 and selling when it crosses below 50.
The Jurik RSX is a more advanced version of the RSX indicator, and while it can be useful in identifying potential trade opportunities, it should not be used in isolation. It is best used in conjunction with other technical and fundamental analysis tools to make informed trading decisions.
What is Slow RSI?
Slow RSI is a variation of the traditional Relative Strength Index ( RSI ) indicator. It is a more smoothed version of the RSI and is designed to filter out some of the noise and short-term price fluctuations that can occur with the standard RSI .
The Slow RSI uses a longer period of time than the traditional RSI , typically 21 periods instead of 14. This longer period helps to smooth out the price data and makes the indicator less reactive to short-term price fluctuations.
Like the traditional RSI , the Slow RSI is used to identify potential overbought and oversold conditions in the market. It oscillates between 0 and 100, with values above 70 indicating overbought conditions and values below 30 indicating oversold conditions. Traders often use these levels as potential buy and sell signals.
The Slow RSI is a more conservative version of the RSI and can be useful in identifying longer-term trends in the market. However, it can also be slower to respond to changes in price, which may result in missed trading opportunities. Traders may choose to use a combination of both the Slow RSI and the traditional RSI to make informed trading decisions.
What is Rapid RSI?
Same as regular RSI but with a faster calculation method
What is Harris RSI?
Harris RSI is a technical analysis indicator that is a variation of the Relative Strength Index ( RSI ). It was developed by Larry Harris and is designed to help traders identify potential trend changes and momentum shifts in the market.
The Harris RSI uses a different calculation formula compared to the traditional RSI . It takes into account both the opening and closing prices of a financial instrument, as well as the high and low prices. The Harris RSI is also normalized to a range of 0 to 100, with values above 50 indicating a bullish trend and values below 50 indicating a bearish trend .
Like the traditional RSI , the Harris RSI is used to identify potential overbought and oversold conditions in the market. It oscillates between 0 and 100, with values above 70 indicating overbought conditions and values below 30 indicating oversold conditions. Traders often use these levels as potential buy and sell signals.
The Harris RSI is a more advanced version of the RSI and can be useful in identifying longer-term trends in the market. However, it can also generate more false signals than the standard RSI . Traders may choose to use a combination of both the Harris RSI and the traditional RSI to make informed trading decisions.
What is Cuttler RSI?
Cuttler RSI is a technical analysis indicator that is a variation of the Relative Strength Index ( RSI ). It was developed by Curt Cuttler and is designed to help traders identify potential trend changes and momentum shifts in the market.
The Cuttler RSI uses a different calculation formula compared to the traditional RSI . It takes into account the difference between the closing price of a financial instrument and the average of the high and low prices over a specified period of time. This difference is then normalized to a range of 0 to 100, with values above 50 indicating a bullish trend and values below 50 indicating a bearish trend .
Like the traditional RSI , the Cuttler RSI is used to identify potential overbought and oversold conditions in the market. It oscillates between 0 and 100, with values above 70 indicating overbought conditions and values below 30 indicating oversold conditions. Traders often use these levels as potential buy and sell signals.
The Cuttler RSI is a more advanced version of the RSI and can be useful in identifying longer-term trends in the market. However, it can also generate more false signals than the standard RSI . Traders may choose to use a combination of both the Cuttler RSI and the traditional RSI to make informed trading decisions.
What is Ehlers Smoothed RSI?
Ehlers smoothed RSI is a technical analysis indicator that is a variation of the Relative Strength Index ( RSI ). It was developed by John Ehlers and is designed to help traders identify potential trend changes and momentum shifts in the market.
The Ehlers smoothed RSI uses a different calculation formula compared to the traditional RSI . It uses a smoothing algorithm that is designed to reduce the noise and random fluctuations that can occur with the standard RSI . The smoothing algorithm is based on a concept called "digital signal processing" and is intended to improve the accuracy of the indicator.
Like the traditional RSI , the Ehlers smoothed RSI is used to identify potential overbought and oversold conditions in the market. It oscillates between 0 and 100, with values above 70 indicating overbought conditions and values below 30 indicating oversold conditions. Traders often use these levels as potential buy and sell signals.
The Ehlers smoothed RSI can be useful in identifying longer-term trends and momentum shifts in the market. However, it can also generate more false signals than the standard RSI . Traders may choose to use a combination of both the Ehlers smoothed RSI and the traditional RSI to make informed trading decisions.
Extras
Alerts
Signals
Loxx's Expanded Source Types, see here:
Variety MA Cluster Filter Crosses [Loxx]What is a Cluster Filter?
One of the approaches to determining a useful signal (trend) in stream data. Small filtering (smoothing) tests applied to market quotes demonstrate the potential for creating non-lagging digital filters (indicators) that are not redrawn on the last bars.
Standard Approach
This approach is based on classical time series smoothing methods. There are lots of articles devoted to this subject both on this and other websites. The results are also classical:
1. The changes in trends are displayed with latency;
2. Better indicator (digital filter) response achieved at the expense of smoothing quality decrease;
3. Attempts to implement non-lagging indicators lead to redrawing on the last samples (bars).
And whereas traders have learned to cope with these things using persistence of economic processes and other tricks, this would be unacceptable in evaluating real-time experimental data, e.g. when testing aerostructures.
The Main Problem
It is a known fact that the majority of trading systems stop performing with the course of time, and that the indicators are only indicative over certain intervals. This can easily be explained: market quotes are not stationary. The definition of a stationary process is available in Wikipedia:
A stationary process is a stochastic process whose joint probability distribution does not change when shifted in time.
Judging by this definition, methods of analysis of stationary time series are not applicable in technical analysis. And this is understandable. A skillful market-maker entering the market will mess up all the calculations we may have made prior to that with regard to parameters of a known series of market quotes.
Even though this seems obvious, a lot of indicators are based on the theory of stationary time series analysis. Examples of such indicators are moving averages and their modifications. However, there are some attempts to create adaptive indicators. They are supposed to take into account non-stationarity of market quotes to some extent, yet they do not seem to work wonders. The attempts to "punish" the market-maker using the currently known methods of analysis of non-stationary series (wavelets, empirical modes and others) are not successful either. It looks like a certain key factor is constantly being ignored or unidentified.
The main reason for this is that the methods used are not designed for working with stream data. All (or almost all) of them were developed for analysis of the already known or, speaking in terms of technical analysis, historical data. These methods are convenient, e.g., in geophysics: you feel the earthquake, get a seismogram and then analyze it for few months. In other words, these methods are appropriate where uncertainties arising at the ends of a time series in the course of filtering affect the end result.
When analyzing experimental stream data or market quotes, we are focused on the most recent data received, rather than history. These are data that cannot be dealt with using classical algorithms.
Cluster Filter
Cluster filter is a set of digital filters approximating the initial sequence. Cluster filters should not be confused with cluster indicators.
Cluster filters are convenient when analyzing non-stationary time series in real time, in other words, stream data. It means that these filters are of principal interest not for smoothing the already known time series values, but for getting the most probable smoothed values of the new data received in real time.
Unlike various decomposition methods or simply filters of desired frequency, cluster filters create a composition or a fan of probable values of initial series which are further analyzed for approximation of the initial sequence. The input sequence acts more as a reference than the target of the analysis. The main analysis concerns values calculated by a set of filters after processing the data received.
In the general case, every filter included in the cluster has its own individual characteristics and is not related to others in any way. These filters are sometimes customized for the analysis of a stationary time series of their own which describes individual properties of the initial non-stationary time series. In the simplest case, if the initial non-stationary series changes its parameters, the filters "switch" over. Thus, a cluster filter tracks real time changes in characteristics.
Cluster Filter Design Procedure
Any cluster filter can be designed in three steps:
1. The first step is usually the most difficult one but this is where probabilistic models of stream data received are formed. The number of these models can be arbitrary large. They are not always related to physical processes that affect the approximable data. The more precisely models describe the approximable sequence, the higher the probability to get a non-lagging cluster filter.
2. At the second step, one or more digital filters are created for each model. The most general condition for joining filters together in a cluster is that they belong to the models describing the approximable sequence.
3. So, we can have one or more filters in a cluster. Consequently, with each new sample we have the sample value and one or more filter values. Thus, with each sample we have a vector or artificial noise made up of several (minimum two) values. All we need to do now is to select the most appropriate value.
An Example of a Simple Cluster Filter
For illustration, we will implement a simple cluster filter corresponding to the above diagram, using market quotes as input sequence. You can simply use closing prices of any time frame.
1. Model description. We will proceed on the assumption that:
The aproximate sequence is non-stationary, i.e. its characteristics tend to change with the course of time.
The closing price of a bar is not the actual bar price. In other words, the registered closing price of a bar is one of the noise movements, like other price movements on that bar.
The actual price or the actual value of the approximable sequence is between the closing price of the current bar and the closing price of the previous bar.
The approximable sequence tends to maintain its direction. That is, if it was growing on the previous bar, it will tend to keep on growing on the current bar.
2. Selecting digital filters. For the sake of simplicity, we take two filters:
The first filter will be a variety filter calculated based on the last closing prices using the slow period. I believe this fits well in the third assumption we specified for our model.
Since we have a non-stationary filter, we will try to also use an additional filter that will hopefully facilitate to identify changes in characteristics of the time series. I've chosen a variety filter using the fast period.
3. Selecting the appropriate value for the cluster filter.
So, with each new sample we will have the sample value (closing price), as well as the value of MA and fast filter. The closing price will be ignored according to the second assumption specified for our model. Further, we select the МА or ЕМА value based on the last assumption, i.e. maintaining trend direction:
For an uptrend, i.e. CF(i-1)>CF(i-2), we select one of the following four variants:
if CF(i-1)fastfilter(i), then CF(i)=slowfilter(i);
if CF(i-1)>slowfilter(i) and CF(i-1)slowfilter(i) and CF(i-1)>fastfilter(i), then CF(i)=MAX(slowfilter(i),fastfilter(i)).
For a downtrend, i.e. CF(i-1)slowfilter(i) and CF(i-1)>fastfilter(i), then CF(i)=MAX(slowfilter(i),fastfilter(i));
if CF(i-1)>slowfilter(i) and CF(i-1)fastfilter(i), then CF(i)=fastfilter(i);
if CF(i-1)<slowfilter(i) and CF(i-1)<fastfilter(i), then CF(i)=MIN(slowfilter(i),fastfilter(i)).
Where:
CF(i) – value of the cluster filter on the current bar;
CF(i-1) and CF(i-2) – values of the cluster filter on the previous bars;
slowfilter(i) – value of the slow filter
fastfilter(i) – value of the fast filter
MIN – the minimum value;
MAX – the maximum value;
What is Variety MA Cluster Filter Crosses?
For this indicator we calculate a fast and slow filter of the same filter and then we run a cluster filter between the fast and slow filter outputs to detect areas of chop/noise. The output is the uptrend is denoted by green color, downtrend by red color, and chop/noise/no-trade zone by white color. As a trader, you'll likely want to avoid trading during areas of chop/noise so you'll want to avoid trading when the color turns white.
Extras
Bar coloring
Alerts
Loxx's Expanded Source Types, see here:
Loxx's Moving Averages, see here:
An example of filtered chop, see the yellow circles. The cluster filter identifies chop zones so you don't get stuck in a sideways market.