FIR Low Pass Filter Suite (FIR)The FIR Low Pass Filter Suite is an advanced signal processing indicator that applies finite impulse response (FIR) filtering techniques to price data. At its core, the indicator uses windowed-sinc filtering, which provides optimal frequency response characteristics for separating trend from noise in financial data.
The indicator offers multiple window functions including Kaiser, Kaiser-Bessel Derived (KBD), Hann, Hamming, Blackman, Triangular, and Lanczos. Each window type provides different trade-offs between main-lobe width and side-lobe attenuation, allowing users to fine-tune the frequency response characteristics of the filter. The Kaiser and KBD windows provide additional control through an alpha parameter that adjusts the shape of the window function.
A key feature is the ability to operate in either linear or logarithmic space. Logarithmic filtering can be particularly appropriate for financial data due to the multiplicative nature of price movements. The indicator includes an envelope system that can adaptively calculate bands around the filtered price using either arithmetic or geometric deviation, with separate controls for upper and lower bands to account for the asymmetric nature of market movements.
The implementation handles edge effects through proper initialization and offers both centered and forward-only filtering modes. Centered mode provides zero phase distortion but introduces lag, while forward-only mode operates causally with no lag but introduces some phase distortion. All calculations are performed using vectorized operations for efficiency, with carefully designed state management to handle the filter's warm-up period.
Visual feedback is provided through customizable color gradients that can reflect the current trend direction, with optional glow effects and background fills to enhance visibility. The indicator maintains high numerical precision throughout its calculations while providing smooth, artifact-free output suitable for both analysis and visualization.
Chart Patterns
True Amplitude Envelopes (TAE)The True Envelopes indicator is an adaptation of the True Amplitude Envelope (TAE) method, based on the research paper " Improved Estimation of the Amplitude Envelope of Time Domain Signals Using True Envelope Cepstral Smoothing " by Caetano and Rodet. This indicator aims to create an asymmetric price envelope with strong predictive power, closely following the methodology outlined in the paper.
Due to the inherent limitations of Pine Script, the indicator utilizes a Kernel Density Estimator (KDE) in place of the original Cepstral Smoothing technique described in the paper. While this approach was chosen out of necessity rather than superiority, the resulting method is designed to be as effective as possible within the constraints of the Pine environment.
This indicator is ideal for traders seeking an advanced tool to analyze price dynamics, offering insights into potential price movements while working within the practical constraints of Pine Script. Whether used in dynamic mode or with a static setting, the True Envelopes indicator helps in identifying key support and resistance levels, making it a valuable asset in any trading strategy.
Key Features:
Dynamic Mode: The indicator dynamically estimates the fundamental frequency of the price, optimizing the envelope generation process in real-time to capture critical price movements.
High-Pass Filtering: Uses a high-pass filtered signal to identify and smoothly interpolate price peaks, ensuring that the envelope accurately reflects significant price changes.
Kernel Density Estimation: Although implemented as a workaround, the KDE technique allows for flexible and adaptive smoothing of the envelope, aimed at achieving results comparable to the more sophisticated methods described in the original research.
Symmetric and Asymmetric Envelopes: Provides options to select between symmetric and asymmetric envelopes, accommodating various trading strategies and market conditions.
Smoothness Control: Features adjustable smoothness settings, enabling users to balance between responsiveness and the overall smoothness of the envelopes.
The True Envelopes indicator comes with a variety of input settings that allow traders to customize the behavior of the envelopes to match their specific trading needs and market conditions. Understanding each of these settings is crucial for optimizing the indicator's performance.
Main Settings
Source: This is the data series on which the indicator is applied, typically the closing price (close). You can select other price data like open, high, low, or a custom series to base the envelope calculations.
History: This setting determines how much historical data the indicator should consider when calculating the envelopes. A value of 0 will make the indicator process all available data, while a higher value restricts it to the most recent n bars. This can be useful for reducing the computational load or focusing the analysis on recent market behavior.
Iterations: This parameter controls the number of iterations used in the envelope generation algorithm. More iterations will typically result in a smoother envelope, but can also increase computation time. The optimal number of iterations depends on the desired balance between smoothness and responsiveness.
Kernel Style: The smoothing kernel used in the Kernel Density Estimator (KDE). Available options include Sinc, Gaussian, Epanechnikov, Logistic, and Triangular. Each kernel has different properties, affecting how the smoothing is applied. For example, Gaussian provides a smooth, bell-shaped curve, while Epanechnikov is more efficient computationally with a parabolic shape.
Envelope Style: This setting determines whether the envelope should be Static or Dynamic. The Static mode applies a fixed period for the envelope, while the Dynamic mode automatically adjusts the period based on the fundamental frequency of the price data. Dynamic mode is typically more responsive to changing market conditions.
High Q: This option controls the quality factor (Q) of the high-pass filter. Enabling this will increase the Q factor, leading to a sharper cutoff and more precise isolation of high-frequency components, which can help in better identifying significant price peaks.
Symmetric: This setting allows you to choose between symmetric and asymmetric envelopes. Symmetric envelopes maintain an equal distance from the central price line on both sides, while asymmetric envelopes can adjust differently above and below the price line, which might better capture market conditions where upside and downside volatility are not equal.
Smooth Envelopes: When enabled, this setting applies additional smoothing to the envelopes. While this can reduce noise and make the envelopes more visually appealing, it may also decrease their responsiveness to sudden market changes.
Dynamic Settings
Extra Detrend: This setting toggles an additional high-pass filter that can be applied when using a long filter period. The purpose is to further detrend the data, ensuring that the envelope focuses solely on the most recent price oscillations.
Filter Period Multiplier: This multiplier adjusts the period of the high-pass filter dynamically based on the detected fundamental frequency. Increasing this multiplier will lengthen the period, making the filter less sensitive to short-term price fluctuations.
Filter Period (Min) and Filter Period (Max): These settings define the minimum and maximum bounds for the high-pass filter period. They ensure that the filter period stays within a reasonable range, preventing it from becoming too short (and overly sensitive) or too long (and too sluggish).
Envelope Period Multiplier: Similar to the filter period multiplier, this adjusts the period for the envelope generation. It scales the period dynamically to match the detected price cycles, allowing for more precise envelope adjustments.
Envelope Period (Min) and Envelope Period (Max): These settings establish the minimum and maximum bounds for the envelope period, ensuring the envelopes remain adaptive without becoming too reactive or too slow.
Static Settings
Filter Period: In static mode, this setting determines the fixed period for the high-pass filter. A shorter period will make the filter more responsive to price changes, while a longer period will smooth out more of the price data.
Envelope Period: This setting specifies the fixed period used for generating the envelopes in static mode. It directly influences how tightly or loosely the envelopes follow the price action.
TAE Smoothing: This controls the degree of smoothing applied during the TAE process in static mode. Higher smoothing values result in more gradual envelope curves, which can be useful in reducing noise but may also delay the envelope’s response to rapid price movements.
Visual Settings
Top Band Color: This setting allows you to choose the color for the upper band of the envelope. This band represents the resistance level in the price action.
Bottom Band Color: Similar to the top band color, this setting controls the color of the lower band, which represents the support level.
Center Line Color: This is the color of the central price line, often referred to as the carrier. It represents the detrended price around which the envelopes are constructed.
Line Width: This determines the thickness of the plotted lines for the top band, bottom band, and center line. Thicker lines can make the envelopes more visible, especially when overlaid on price data.
Fill Alpha: This controls the transparency level of the shaded area between the top and bottom bands. A lower alpha value will make the fill more transparent, while a higher value will make it more opaque, helping to highlight the envelope more clearly.
The envelopes generated by the True Envelopes indicator are designed to provide a more precise and responsive representation of price action compared to traditional methods like Bollinger Bands or Keltner Channels. The core idea behind this indicator is to create a price envelope that smoothly interpolates the significant peaks in price action, offering a more accurate depiction of support and resistance levels.
One of the critical aspects of this approach is the use of a high-pass filtered signal to identify these peaks. The high-pass filter serves as an effective method of detrending the price data, isolating the rapid fluctuations in price that are often lost in standard trend-following indicators. By filtering out the lower frequency components (i.e., the trend), the high-pass filter reveals the underlying oscillations in the price, which correspond to significant peaks and troughs. These oscillations are crucial for accurately constructing the envelope, as they represent the most responsive elements of the price movement.
The algorithm works by first applying the high-pass filter to the source price data, effectively detrending the series and isolating the high-frequency price changes. This filtered signal is then used to estimate the fundamental frequency of the price movement, which is essential for dynamically adjusting the envelope to current market conditions. By focusing on the peaks identified in the high-pass filtered signal, the algorithm generates an envelope that is both smooth and adaptive, closely following the most significant price changes without overfitting to transient noise.
Compared to traditional envelopes and bands, such as Bollinger Bands and Keltner Channels, the True Envelopes indicator offers several advantages. Bollinger Bands, which are based on standard deviations, and Keltner Channels, which use the average true range (ATR), both tend to react to price volatility but do not necessarily follow the peaks and troughs of the price with precision. As a result, these traditional methods can sometimes lag behind or fail to capture sudden shifts in price momentum, leading to either false signals or missed opportunities.
In contrast, the True Envelopes indicator, by using a high-pass filtered signal and a dynamic period estimation, adapts more quickly to changes in price behavior. The envelopes generated by this method are less prone to the lag that often affects standard deviation or ATR-based bands, and they provide a more accurate representation of the price's immediate oscillations. This can result in better predictive power and more reliable identification of support and resistance levels, making the True Envelopes indicator a valuable tool for traders looking for a more responsive and precise approach to market analysis.
In conclusion, the True Envelopes indicator is a powerful tool that blends advanced theoretical concepts with practical implementation, offering traders a precise and responsive way to analyze price dynamics. By adapting the True Amplitude Envelope (TAE) method through the use of a Kernel Density Estimator (KDE) and high-pass filtering, this indicator effectively captures the most significant price movements, providing a more accurate depiction of support and resistance levels compared to traditional methods like Bollinger Bands and Keltner Channels. The flexible settings allow for extensive customization, ensuring the indicator can be tailored to suit various trading strategies and market conditions.
PitchforkLibrary "Pitchfork"
Pitchfork class
method tostring(this)
Converts PitchforkTypes/Fork object to string representation
Namespace types: Fork
Parameters:
this (Fork) : PitchforkTypes/Fork object
Returns: string representation of PitchforkTypes/Fork
method tostring(this)
Converts Array of PitchforkTypes/Fork object to string representation
Namespace types: array
Parameters:
this (array) : Array of PitchforkTypes/Fork object
Returns: string representation of PitchforkTypes/Fork array
method tostring(this, sortKeys, sortOrder)
Converts PitchforkTypes/PitchforkProperties object to string representation
Namespace types: PitchforkProperties
Parameters:
this (PitchforkProperties) : PitchforkTypes/PitchforkProperties object
sortKeys (bool) : If set to true, string output is sorted by keys.
sortOrder (int) : Applicable only if sortKeys is set to true. Positive number will sort them in ascending order whreas negative numer will sort them in descending order. Passing 0 will not sort the keys
Returns: string representation of PitchforkTypes/PitchforkProperties
method tostring(this, sortKeys, sortOrder)
Converts PitchforkTypes/PitchforkDrawingProperties object to string representation
Namespace types: PitchforkDrawingProperties
Parameters:
this (PitchforkDrawingProperties) : PitchforkTypes/PitchforkDrawingProperties object
sortKeys (bool) : If set to true, string output is sorted by keys.
sortOrder (int) : Applicable only if sortKeys is set to true. Positive number will sort them in ascending order whreas negative numer will sort them in descending order. Passing 0 will not sort the keys
Returns: string representation of PitchforkTypes/PitchforkDrawingProperties
method tostring(this, sortKeys, sortOrder)
Converts PitchforkTypes/Pitchfork object to string representation
Namespace types: Pitchfork
Parameters:
this (Pitchfork) : PitchforkTypes/Pitchfork object
sortKeys (bool) : If set to true, string output is sorted by keys.
sortOrder (int) : Applicable only if sortKeys is set to true. Positive number will sort them in ascending order whreas negative numer will sort them in descending order. Passing 0 will not sort the keys
Returns: string representation of PitchforkTypes/Pitchfork
method createDrawing(this)
Creates PitchforkTypes/PitchforkDrawing from PitchforkTypes/Pitchfork object
Namespace types: Pitchfork
Parameters:
this (Pitchfork) : PitchforkTypes/Pitchfork object
Returns: PitchforkTypes/PitchforkDrawing object created
method createDrawing(this)
Creates PitchforkTypes/PitchforkDrawing array from PitchforkTypes/Pitchfork array of objects
Namespace types: array
Parameters:
this (array) : array of PitchforkTypes/Pitchfork object
Returns: array of PitchforkTypes/PitchforkDrawing object created
method draw(this)
draws from PitchforkTypes/PitchforkDrawing object
Namespace types: PitchforkDrawing
Parameters:
this (PitchforkDrawing) : PitchforkTypes/PitchforkDrawing object
Returns: PitchforkTypes/PitchforkDrawing object drawn
method delete(this)
deletes PitchforkTypes/PitchforkDrawing object
Namespace types: PitchforkDrawing
Parameters:
this (PitchforkDrawing) : PitchforkTypes/PitchforkDrawing object
Returns: PitchforkTypes/PitchforkDrawing object deleted
method delete(this)
deletes underlying drawing of PitchforkTypes/Pitchfork object
Namespace types: Pitchfork
Parameters:
this (Pitchfork) : PitchforkTypes/Pitchfork object
Returns: PitchforkTypes/Pitchfork object deleted
method delete(this)
deletes array of PitchforkTypes/PitchforkDrawing objects
Namespace types: array
Parameters:
this (array) : Array of PitchforkTypes/PitchforkDrawing object
Returns: Array of PitchforkTypes/PitchforkDrawing object deleted
method delete(this)
deletes underlying drawing in array of PitchforkTypes/Pitchfork objects
Namespace types: array
Parameters:
this (array) : Array of PitchforkTypes/Pitchfork object
Returns: Array of PitchforkTypes/Pitchfork object deleted
method clear(this)
deletes array of PitchforkTypes/PitchforkDrawing objects and clears the array
Namespace types: array
Parameters:
this (array) : Array of PitchforkTypes/PitchforkDrawing object
Returns: void
method clear(this)
deletes array of PitchforkTypes/Pitchfork objects and clears the array
Namespace types: array
Parameters:
this (array) : Array of Pitchfork/Pitchfork object
Returns: void
PitchforkDrawingProperties
Pitchfork Drawing Properties object
Fields:
extend (series bool) : If set to true, forks are extended towards right. Default is true
fill (series bool) : Fill forklines with transparent color. Default is true
fillTransparency (series int) : Transparency at which fills are made. Only considered when fill is set. Default is 80
forceCommonColor (series bool) : Force use of common color for forks and fills. Default is false
commonColor (series color) : common fill color. Used only if ratio specific fill colors are not available or if forceCommonColor is set to true.
PitchforkDrawing
Pitchfork drawing components
Fields:
medianLine (Line type from Trendoscope/Drawing/2) : Median line of the pitchfork
baseLine (Line type from Trendoscope/Drawing/2) : Base line of the pitchfork
forkLines (array type from Trendoscope/Drawing/2) : fork lines of the pitchfork
linefills (array type from Trendoscope/Drawing/2) : Linefills between forks
Fork
Fork object property
Fields:
ratio (series float) : Fork ratio
forkColor (series color) : color of fork. Default is blue
include (series bool) : flag to include the fork in drawing. Default is true
PitchforkProperties
Pitchfork Properties
Fields:
forks (array) : Array of Fork objects
type (series string) : Pitchfork type. Supported values are "regular", "schiff", "mschiff", Default is regular
inside (series bool) : Flag to identify if to draw inside fork. If set to true, inside fork will be drawn
Pitchfork
Pitchfork object
Fields:
a (chart.point) : Pivot Point A of pitchfork
b (chart.point) : Pivot Point B of pitchfork
c (chart.point) : Pivot Point C of pitchfork
properties (PitchforkProperties) : PitchforkProperties object which determines type and composition of pitchfork
dProperties (PitchforkDrawingProperties) : Drawing properties for pitchfork
lProperties (LineProperties type from Trendoscope/Drawing/2) : Common line properties for Pitchfork lines
drawing (PitchforkDrawing) : PitchforkDrawing object
Double Top/Bottom [AlgoAlpha]Introducing the Double Top/Bottom Indicator by AlgoAlpha, a powerful tool designed to identify key reversal patterns in the market with precision. This indicator meticulously detects double tops and double bottoms, helping traders recognize potential trend reversals and make informed trading decisions.
Key Features:
🔍 Pattern Detection : Accurately identifies double top and double bottom formations based on customizable time horizons.
🎨 Customizable Appearance : Choose your preferred colors for bullish and bearish trends to match your trading style.
📊 Signal Labels : Option to display only the second pivot of the double top/bottom for a cleaner chart view.
🔧 Flexible Settings : Adjust the time horizon to control the look-back period, allowing for detection of both short-term and long-term patterns.
📈 Visual Enhancements : Draws trend lines and fills between pivotal points to visually highlight potential reversal zones.
🔔 Alerts : Set up alerts for potential double top and double bottom formations to stay informed of key market movements.
How to Use the Double Top/Bottom Indicator :
🛠 Add the Indicator : Simply add the Double Top/Bottom Indicator to your TradingView chart from your favorites. Customize the time horizon and appearance settings to fit your trading preferences.
📊 Analyze Patterns : Watch for the identified double top and double bottom patterns along with the corresponding trend lines and filled areas to anticipate potential market reversals.
🔔 Set Alerts : Enable alerts to receive notifications when double top or double bottom patterns are detected, ensuring you never miss a critical trading opportunity.
How It Works : The indicator scans the price action for pivot highs and lows within a specified time horizon, identifying potential double top and double bottom patterns. It maintains a sequence of these pivots and verifies the formation of these patterns based on the relationship between consecutive pivots and the proximity to a defined limit. When a double top or double bottom is confirmed, the indicator marks the second pivot point with a label and draws trend lines to visualize the reversal pattern. Additionally, it provides alert conditions to notify traders of potential confirmations, enhancing decision-making without cluttering the chart.
⚠️ Important Reminder : The labels indicating double tops and bottoms appear with a delay and are intended to mark the formations after they have already formed. They are not meant to be used as real-time trading signals. While they align perfectly with pivot points in hindsight, please use them as markers for analysis rather than immediate trading triggers.
Flag Screener [QuantVue]Flag Screener is a screening tool that identify bull and bear flags in up to 40 different symbols.
The indicator takes a comma separated list of symbols and then scans the symbols in real time to detect bull or bear flags.
What are flags
Flags are continuation patterns that occur within the general trend of the security. A bull flag represents a temporary pause or consolidation before price resumes it's upward movement, while a bear flag occurs before price continues its downward movement.
Both flag patterns consist of two components:
The Pole
The Flag
The pole is the initial strong upward surge or decline that precedes the flag. The pole is usually a fast move accompanied by heavy volume signaling significant buying or selling pressure.
The flag is then formed as price consolidates after the initial surge or decline from the pole. For a bull flag price will drift slightly downward to sideways, a bear flag will drift upward to sideways. The best flags often see volume dry up during this phase of the pattern.
Indicator Settings
Both components are fully customizable in the indicator so the user can adjust for any time frame or volatility. Select the minimum and maximum accepted limits from the % gain loss required for the pole, the maximum acceptable flag depth or rally and the minimum and maximum number of bars for each component.
FVG Channel [LuxAlgo]The FVG Channel indicator displays a channel constructed from the averages of unmitigated historical fair value gaps (FVG), allowing to identify trends and potential reversals in the market.
Users can control the amount of FVGs to consider for the calculation of the channels, as well as their degree of smoothness through user settings.
🔶 USAGE
The FVG Channel is constructed by averaging together recent unmitigated Bullish FVGs (contributing to the creation of the upper bands), and Bearish unmitigated FVGs (contributing to the creation of the lower bands) within a lookback determined by the user. A higher lookback will return longer-term indications from the indicator.
The channel includes 5 bands, with one upper and one lower outer extremities, as well as an inner series of values determined using the Fibonacci ratios (respectively 0.786, 0.5, 0.236) from the channel's outer extremities.
An uptrend can be identified by price holding above the inner upper band (obtained from the 0.786 ratio), this band can also provide occasional support when the price retraces to it while in an uptrend.
Breaking below the inner upper band with an unwillingness to reach above again is a clear sign of hesitation in the market and can be indicative of an upcoming consolidation or reversal.
This can directly be applied to downtrends as well, below are examples displaying both scenarios.
Uptrend Example:
Downtrend Example:
🔹 Breakout Levels
When the price mitigates all FVGs in a single direction except for 1, the indicator will display a "Breakout Level". This is the level that price will need to cross in order for all FVGs in that direction to be mitigated, because of this they can also be aptly called "Last Stand Levels".
These levels can be considered as potential support and resistance levels, however, should always be monitored for breakouts since a substantial push above or below these points would indicate strong momentum.
🔹 Signals
The indicator includes Bullish and Bearish Signals, these signals fire when all FVGs for a single direction have been mitigated and an engulfing candle occurs in the opposite direction. These are reversal signals and should be used alongside other indicators to appropriately manage risk.
Note: When all FVGs in a single direction have been mitigated, the candles will change colors accordingly.
🔶 DETAILS
The script uses a typical identification method for FVGs. Once identified, the script collects and stores the mitigation levels of the respective bullish and bearish FVGs:
For Bullish FVGs this is the bottom of the FVG.
For Bearish FVGs this is the top of the FVG.
The data is managed to only consider a specific amount of FVG mitigation levels, determined by the set "Unmitigated FVG Lookback". If an FVG is mitigated, it frees up a spot in the memory for a new FVG, however, if the memory is full, the oldest will be deleted.
The averages displayed (Channel Upper and Lower) are created from 2 calculation steps, the first step involves taking the raw average of the FVG mitigation levels, and the second step applies a simple moving average (SMA) smoothing of the precedent obtained averages.
Note: To view the mitigation levels average obtained in the first step, the "Smoothing Length" can be set to 1.
🔶 SETTINGS
Unmitigated FVG Lookback: Sets the maximum number of Unmitigated FVG mitigation levels that the script will use to calculate the channel.
Smoothing Length: Sets the smoothing length for the channel to reduce noise from the raw data.
Periodic Linear Regressions [LuxAlgo]The Periodic Linear Regressions (PLR) indicator calculates linear regressions periodically (similar to the VWAP indicator) based on a user-set period (anchor).
This allows for estimating underlying trends in the price, as well as providing potential supports/resistances.
🔶 USAGE
The Periodic Linear Regressions indicator calculates a linear regression over a user-selected interval determined from the selected "Anchor Period".
The PLR can be visualized as a regular linear regression (Static), with a fit readjusting for new data points until the end of the selected period, or as a moving average (Rolling), with new values obtained from the last point of a linear regression fitted over the calculation interval. While the static method line is prone to repainting, it has value since it can further emphasize the linearity of an underlying trend, as well as suggest future trend directions by extrapolating the fit.
Extremities are included in the indicator, these are obtained from the root mean squared error (RMSE) between the price and calculated linear regression. The Multiple setting allows the users to control how far each extremity is from the other.
Periodic Linear Regressions can be helpful in finding support/resistance areas or even opportunities when ranging in a channel.
The anchor - where a new period starts - can be shown (in this case in the top right corner).
The shown bands can be visualized by enabling Show Extremities in settings ( Rolling or Static method).
The script includes a background gradient color option for the bands, which only applies when using the Rolling method.
The indicator colors can be suggestive of the detected trend and are determined as follows:
Method Rolling: a gradient color between red and green indicates the trend; more green if the output is rising, suggesting an uptrend, and more red if it is decreasing, suggesting a downtrend.
Method Static: green if the slope of the line is positive, suggesting an uptrend, red if negative, suggesting a downtrend.
🔶 DETAILS
🔹 Anchor Type
When the Anchor Type is set to Periodic , the indicator will be reset when the "Anchor Period" changes, after which calculations will start again.
An anchored rolling line set at First Bar won't reset at a new session; it will continue calculating the linear regression from the first bar to the last; in other words, every bar is included in the calculation. This can be useful to detect potential long-term tops/bottoms.
Note that a linear regression needs at least two values for its calculation, which explains why you won't see a static line at the first bar of the session. The rolling linear regression will only show from the 3rd bar of the session since it also needs a previous value.
🔹 Rolling/Static
When Anchor Type is set at Periodic , a linear regression is calculated between the first bar of the chosen session and the current bar, aiming to find the line that best fits the dataset.
The example above shows the lines drawn during the session. The offered script, though, shows the last calculated point connected to the previous point when the Rolling method is chosen, while the Static method shows the latest line.
Note that linear regression needs at least two values, which explains why you won't see a static line at the first bar of the session. The rolling line will only show from the 3rd bar of the session since it also needs a previous value.
🔶 SETTINGS
Method: Indicator method used, with options: "Static" (straight line) / "Rolling" (rolling linear regression).
Anchor Type: "Periodic / First Bar" (the latter works only when "Method" is set to "Rolling").
Anchor Period: Only applicable when "Anchor Type" is set at "Periodic".
Source: open, high, low, close, ...
Multiple: Alters the width of the bands when "Show Extremities" is enabled.
Show Extremities: Display one upper and one lower extremity.
🔹 Color Settings
Mono Color: color when "Bicolor" is disabled
Bicolor: Toggle on/off + Colors
Gradient: Background color when "Show extremities" is enabled + level of gradient
🔹 Dashboard
Show Dashboard
Location of dashboard
Text size
Sinc Bollinger BandsKaiser Windowed Sinc Bollinger Bands Indicator
The Kaiser Windowed Sinc Bollinger Bands indicator combines the advanced filtering capabilities of the Kaiser Windowed Sinc Moving Average with the volatility measurement of Bollinger Bands. This indicator represents a sophisticated approach to trend identification and volatility analysis in financial markets.
Core Components
At the heart of this indicator is the Kaiser Windowed Sinc Moving Average, which utilizes the sinc function as an ideal low-pass filter, windowed by the Kaiser function. This combination allows for precise control over the frequency response of the moving average, effectively separating trend from noise in price data.
The sinc function, representing an ideal low-pass filter, provides the foundation for the moving average calculation. By using the sinc function, analysts can independently control two critical parameters: the cutoff frequency and the number of samples used. The cutoff frequency determines which price movements are considered significant (low frequency) and which are treated as noise (high frequency). The number of samples influences the filter's accuracy and steepness, allowing for a more precise approximation of the ideal low-pass filter without altering its fundamental frequency response characteristics.
The Kaiser window is applied to the sinc function to create a practical, finite-length filter while minimizing unwanted oscillations in the frequency domain. The alpha parameter of the Kaiser window allows users to fine-tune the trade-off between the main-lobe width and side-lobe levels in the frequency response.
Bollinger Bands Implementation
Building upon the Kaiser Windowed Sinc Moving Average, this indicator adds Bollinger Bands to provide a measure of price volatility. The bands are calculated by adding and subtracting a multiple of the standard deviation from the moving average.
Advanced Centered Standard Deviation Calculation
A unique feature of this indicator is its specialized standard deviation calculation for the centered mode. This method employs the Kaiser window to create a smooth deviation that serves as an highly effective envelope, even though it's always based on past data.
The centered standard deviation calculation works as follows:
It determines the effective sample size of the Kaiser window.
The window size is then adjusted to reflect the target sample size.
The source data is offset in the calculation to allow for proper centering.
This approach results in a highly accurate and smooth volatility estimation. The centered standard deviation provides a more refined and responsive measure of price volatility compared to traditional methods, particularly useful for historical analysis and backtesting.
Operational Modes
The indicator offers two operational modes:
Non-Centered (Real-time) Mode: Uses half of the windowed sinc function and a traditional standard deviation calculation. This mode is suitable for real-time analysis and current market conditions.
Centered Mode: Utilizes the full windowed sinc function and the specialized Kaiser window-based standard deviation calculation. While this mode introduces a delay, it offers the most accurate trend and volatility identification for historical analysis.
Customizable Parameters
The Kaiser Windowed Sinc Bollinger Bands indicator provides several key parameters for customization:
Cutoff: Controls the filter's cutoff frequency, determining the divide between trends and noise.
Number of Samples: Sets the number of samples used in the FIR filter calculation, affecting the filter's accuracy and computational complexity.
Alpha: Influences the shape of the Kaiser window, allowing for fine-tuning of the filter's frequency response characteristics.
Standard Deviation Length: Determines the period over which volatility is calculated.
Multiplier: Sets the number of standard deviations used for the Bollinger Bands.
Centered Alpha: Specific to the centered mode, this parameter affects the Kaiser window used in the specialized standard deviation calculation.
Visualization Features
To enhance the analytical value of the indicator, several visualization options are included:
Gradient Coloring: Offers a range of color schemes to represent trend direction and strength for the moving average line.
Glow Effect: An optional visual enhancement for improved line visibility.
Background Fill: Highlights the area between the Bollinger Bands, aiding in volatility visualization.
Applications in Technical Analysis
The Kaiser Windowed Sinc Bollinger Bands indicator is particularly useful for:
Precise trend identification with reduced noise influence
Advanced volatility analysis, especially in the centered mode
Identifying potential overbought and oversold conditions
Recognizing periods of price consolidation and potential breakouts
Compared to traditional Bollinger Bands, this indicator offers superior frequency response characteristics in its moving average and a more refined volatility measurement, especially in centered mode. These features allow for a more nuanced analysis of price trends and volatility patterns across various market conditions and timeframes.
Conclusion
The Kaiser Windowed Sinc Bollinger Bands indicator represents a significant advancement in technical analysis tools. By combining the ideal low-pass filter characteristics of the sinc function, the practical benefits of Kaiser windowing, and an innovative approach to volatility measurement, this indicator provides traders and analysts with a sophisticated instrument for examining price trends and market volatility.
Its implementation in Pine Script contributes to the TradingView community by making advanced signal processing and statistical techniques accessible for experimentation and further development in technical analysis. This indicator serves not only as a practical tool for market analysis but also as an educational resource for those interested in the intersection of signal processing, statistics, and financial markets.
Related:
HTF TriangleHTF Triangle by ZeroHeroTrading aims at detecting ascending and descending triangles using higher time frame data, without repainting nor misalignment issues.
It addresses user requests for combining Ascending Triangle and Descending Triangle into one indicator.
Ascending triangles are defined by an horizontal upper trend line and a rising lower trend line. It is a chart pattern used in technical analysis to predict the continuation of an uptrend.
Descending triangles are defined by a falling upper trend line and an horizontal lower trend line. It is a chart pattern used in technical analysis to predict the continuation of a downtrend.
This indicator can be useful if you, like me, believe that higher time frames can offer a broader perspective and provide clearer signals, smoothing out market noise and showing longer-term trends.
You can change the indicator settings as you see fit to tighten or loosen the detection, and achieve the best results for your use case.
Features
It draws the detected ascending and descending triangles on the chart.
It supports alerting when a detection occurs.
It allows for selecting ascending and/or descending triangle detection.
It allows for setting the higher time frame to run the detection on.
It allows for setting the minimum number of consecutive valid higher time frame bars to fit the pattern criteria.
It allows for setting a high/low factor detection criteria to apply on higher time frame bars high/low as a proportion of the distance between the reference bar high/low and open/close.
It allows for turning on an adjustment of the triangle using highest/lowest values within valid higher time frame bars.
Settings
Ascending checkbox: Turns on/off ascending triangle detection. Default is on.
Descending checkbox: Turns on/off descending triangle detection. Default is on.
Higher Time Frame dropdown: Selects higher time frame to run the detection on. It must be higher than, and a multiple of, the chart's timeframe. Default is 5 minutes.
Valid Bars Minimum field: Sets minimum number of consecutive valid higher time frame bars to fit the pattern criteria. Default is 3. Minimum is 1.
High/Low Factor checkbox: Turns on/off high/low factor detection criteria. Default is on.
High/Low Factor field: Sets high/low factor to apply on higher time frame bars high/low as a proportion of the distance between the reference bar high/low and open/close. Default is 0. Minimum is 0. Maximum is 1.
Adjust Triangle checkbox: Turns on/off triangle adjustment using highest/lowest values within valid higher time frame bars. Default is on.
Detection Algorithm Notes
The detection algorithm recursively selects a higher time frame bar as reference. Then it looks at the consecutive higher time frame bars (as per the requested number of minimum valid bars) as follows:
Ascending Triangle
Low must be higher than previous bar.
Open/close max value must be lower than (or equal to) reference bar high.
When high/low factor criteria is turned on, high must be higher than (or equal to) reference bar open/close max value plus high/low factor proportion of the distance between reference bar high and open/close max value.
Descending Triangle
High must be lower than previous bar.
Open/close min value must be higher than (or equal to) reference bar low.
When high/low factor criteria is turned on, low must be lower than (or equal to) reference bar open/close min value minus high/low factor proportion of the distance between reference bar low and open/close min value.
Half Cup [LuxAlgo]The Half Cup indicator detects and displays patterns with the shape of a Half Cup , initiating a channel. From this channel, breakouts are detected and highlighted with dots.
Users can control the shape of the Half Cup and the channel length through various settings.
Do note that the displayed half cups are displayed retrospectively, making them subject to backpainting.
🔶 USAGE
The idea behind the indicator is derived from the Cup & Handle pattern, which requires waiting for the pattern full completion.
Our Half Cup publication aims to find opportunities when the potential cup is only formed halfway.
In this example, a green dot shows the first breakout of the upper channel extremity. A few bars later, the price went under it, after which it returned above, triggering a second green dot. Both triggers were good opportunities in this case, and the price rose afterward.
The Half Cup pattern can be the start of a potential complete Cup & Handle (As in the example above, a complete Cup pattern (without the Handle ) is shown, manually drawn with dashed lines).
Every green/red dot, whether on a bullish or bearish pattern, points to a breakout respectively above/below the channel.
Besides drawing patterns and the corresponding breakouts, the Half Cup indicator can also provide insights into trends and potential opportunities in the long run.
🔶 DETAILS
🔹 Validation
Several criteria must be fulfilled before a visible pattern on the chart is drawn.
Calculations are done beforehand to know where the Half Cup pattern would be positioned.
The pattern's bottom and top edges are checked for the number of bars whose closing price is outside the half-cup area. When the number of breakouts above/below is equal to or lower than the user-defined settings ( Max % Breaks Top/Bottom ), the pattern is drawn together with a brighter-colored channel next to it.
Dots highlighting the channel's breakout can be drawn from that moment until the end of both channel lines.
🔹 Positioning
Users can adjust the following settings to fit their needs:
% Broadness: Moves the Top/Bottom line (bullish or bearish) diagonally upwards/downwards.
Vertical Shift: Shifts the entire pattern up/down.
Channel Length: Sets the line length of the channel.
Note that adjusting the position of the pattern will change the validation; the script will be rerun to check if patterns are still valid or if new patterns can be drawn. Some patterns may disappear, while new ones may appear.
Before adjusting the position, the user can set Max % Breaks Top/Bottom at 100%. When the positioning is set, Max % Breaks Top/Bottom can be set as desired.
🔹 Updated Drawings
The Half Cup pattern is always drawn retrospectively (that is it is subject to backpainting), the channel is drawn from the bar from where the pattern is detected. Every breakout of the channel will remain visible as dots.
When a new swing high/low is found while the previous swing low/high remains the same, the pattern is updated to minimize clutter. The dots of earlier drawings will remain visible (to ensure no repainting occurs), but the color becomes faded, as such bright dots are associated with patterns that are visible on the chart, while faded dots are from removed/updated patterns.
🔶 SETTINGS
Swing Length: Period used for the swing detection, with higher values returning longer-term Swing Levels.
🔹 Validation
Max % Breaks Bottom: Allowed maximum amount of bars where the closing price is below the bottom of the Half Cup pattern against the total width of the pattern (bars).
Max % Breaks Top: Allowed maximum amount of bars where the closing price is above the top of the Half Cup pattern against the total width of the pattern (bars).
🔹 Positioning
% Broadness: Moves the Top/Bottom line (bullish or bearish) diagonally upwards/downwards.
Vertical Shift: Shifts the entire pattern up/down.
Channel Length: Sets the line length of the channel.
HTF Descending TriangleHTF Descending Triangle aims at detecting descending triangles using higher time frame data, without repainting nor misalignment issues.
Descending triangles are defined by a falling upper trend line and an horizontal lower trend line. It is a chart pattern used in technical analysis to predict the continuation of a downtrend.
This indicator can be useful if you, like me, believe that higher time frames can offer a broader perspective and provide clearer signals, smoothing out market noise and showing longer-term trends.
You can change the indicator settings as you see fit to tighten or loosen the detection, and achieve the best results for your use case.
Features
It draws the detected descending triangle on the chart.
It supports alerting when a detection occurs.
It allows for setting the higher time frame to run the detection on.
It allows for setting the minimum number of consecutive valid higher time frame bars to fit the pattern criteria.
It allows for setting a low factor detection criteria to apply on higher time frame bars low as a proportion of the distance between the reference bar low and open/close.
It allows for turning on an adjustment of the triangle using highest/lowest values within valid higher time frame bars.
Settings
Higher Time Frame dropdown: Selects higher time frame to run the detection on. It must be higher than, and a multiple of, the chart's timeframe.
Valid Bars Minimum field: Sets minimum number of consecutive valid higher time frame bars to fit the pattern criteria.
Low Factor checkbox: Turns on/off low factor detection criteria.
Low Factor field: Sets low factor to apply on higher time frame bars low as a proportion of the distance between the reference bar low and open/close.
Adjust Triangle checkbox: Turns on/off triangle adjustment using highest/lowest values within valid higher time frame bars.
Detection Algorithm Notes
The detection algorithm recursively selects a higher time frame bar as reference. Then it looks at the consecutive higher time frame bars (as per the requested number of minimum valid bars) as follows:
High must be lower than previous bar.
Open/close min value must be higher than reference bar low.
When low factor criteria is turned on, low must be lower than reference bar open/close min value minus low factor proportion of the distance between reference bar low and open/close min value.
HTF Ascending TriangleHTF Ascending Triangle aims at detecting ascending triangles using higher time frame data, without repainting nor misalignment issues.
Ascending triangles are defined by an horizontal upper trend line and a rising lower trend line. It is a chart pattern used in technical analysis to predict the continuation of an uptrend.
This indicator can be useful if you, like me, believe that higher time frames can offer a broader perspective and provide clearer signals, smoothing out market noise and showing longer-term trends.
You can change the indicator settings as you see fit to tighten or loosen the detection, and achieve the best results for your use case.
Features
It draws the detected ascending triangle on the chart.
It supports alerting when a detection occurs.
It allows for setting the higher time frame to run the detection on.
It allows for setting the minimum number of consecutive valid higher time frame bars to fit the pattern criteria.
It allows for setting a high factor detection criteria to apply on higher time frame bars high as a proportion of the distance between the reference bar high and open/close.
It allows for turning on an adjustment of the triangle using highest/lowest values within valid higher time frame bars.
Settings
Higher Time Frame dropdown: Selects higher time frame to run the detection on. It must be higher than, and a multiple of, the chart's timeframe.
Valid Bars Minimum field: Sets minimum number of consecutive valid higher time frame bars to fit the pattern criteria.
High Factor checkbox: Turns on/off high factor detection criteria.
High Factor field: Sets high factor to apply on higher time frame bars high as a proportion of the distance between the reference bar high and close/open.
Adjust Triangle checkbox: Turns on/off triangle adjustment using highest/lowest values within valid higher time frame bars.
Detection Algorithm Notes
The detection algorithm recursively selects a higher time frame bar as reference. Then it looks at the consecutive higher time frame bars (as per the requested number of minimum valid bars) as follows:
Low must be higher than previous bar.
Open/close max value must be lower than reference bar high.
When high factor criteria is turned on, high must be higher than reference bar open/close max value plus high factor proportion of the distance between reference bar high and open/close max value.
Flags With Measured Move [QuantVue]Flags with Measured Moves is a technical analysis tool that identifies bull flags and provides a measured move target.
A bull flag is a continuation pattern that occurs within the context of a general uptrend. It represents a pause or small consolidation before the price resumes its upward movement.
A bull flag consists of two sections: the flagpole and the flag.
The flagpole is the initial upward movement that occurs before the flag forms.
The flag forms as the price consolidates after the initial uptrend. During this phase, the price tends to drift downward or sideways, ideally with declining volume.
Once the flag has put in a low, the initial range of thrust is added to the flag low to form the measured move target.
Every element of the flag is customizable by the trader, including the size and length of the prior uptrend and the minimum and maximum flag depth and length.
The indicator also includes alerts for when new flags are formed, when a breakout from the flag occurs, and when the measured move target is reached.
By default, the indicator settings are set for use on a daily timeframe. If using the indicator on an intraday timeframe, you will need to adjust the settings.
Give this indicator a BOOST and COMMENT your thoughts!
We hope you enjoy.
Cheers!
Double Tops/Bottoms [UAlgo]🔶Description:
The "Double Tops/Bottoms " indicator is designed to identify potential double tops and double bottoms on price charts. These patterns are often considered significant as they may indicate a reversal in the prevailing trend. The indicator can be applied to both high/low and close price data, offering flexibility in analyzing different aspects of market behavior.
🔶Key Features:
Source Selection: Users can choose between using high/low or close prices as the basis for identifying double tops and bottoms, allowing for tailored analysis based on specific price actions.
Lookback Length: The indicator offers a customizable lookback length, enabling users to adjust the sensitivity of pattern detection according to their trading preferences and timeframes.
Pivot Length: Users can specify the length of the pivot used in identifying double tops and bottoms, providing flexibility in capturing different market dynamics.
Minimum Bar Count Between Tops/Bottoms: A minimum bar count parameter allows users to control the distance between consecutive tops or bottoms, enhancing the accuracy of pattern recognition.
Pivot Tops/Bottoms Only: The indicator offers the option to focus exclusively on pivot tops and bottoms, streamlining the analysis process for users interested specifically in these key reversal points.
Disclaimer:
Trading involves substantial risk and is not suitable for every investor. The indicator provided here is intended for informational purposes only and should not be construed as investment advice or a recommendation to buy, sell, or hold any securities. Users are solely responsible for evaluating their own investment decisions and should seek professional financial advice if needed. The creator of this indicator (UAlgo) does not guarantee the accuracy, completeness, or reliability of the information provided, and shall not be liable for any losses incurred in connection with its use. By using this indicator, users acknowledge and agree to assume all risks associated with trading activities.
Linear Regression Channel 200█ OVERVIEW
This a simplified version of linear regression channel which use length 200 instead of traditional length 100.
█ FEATURES
Color change depends light / dark mode.
█ LIMITATIONS
Limited to source of closing price and max bars back is 1500.
█ SIMILAR
Regression Channel Alternative MTF
Regression Channel Alternative MTF V2
Double Tops & Bottoms [QuantVue]This indicator is designed to detect and plot Double Tops and Double Bottoms, by setting the initial high or low using standard pivot points.
Double Tops
A Double Top is a bearish reversal pattern, typically found when an uptrend returns back to a prior peak. It signifies a potential turning point or resistance level and could potentially reverse in direction.
The pattern is confirmed as a Double Top when the price breaks above the resistance level, but closes below it. A decisive close below this level is seen as a confirmation of the bearish trend.
Double Bottoms
A Double Bottom, on the other hand, is a bullish reversal pattern typically found after a downtrend. It signals a potential turning point or support level where the price has bottomed and could potentially reverse upwards.
The pattern is confirmed as a Double Bottom when the price breaks below the support level, but closes above it. A decisive close above this level is viewed as a confirmation of the bullish trend.
Indicator Features
🔹Double Top Detection: When a double top is identified, a downward-pointing triangle will be plotted above the bar, and if the alerts are enabled, a notification will be triggered.
🔹Double Bottom Detection: When a double bottom is identified, an upward-pointing triangle will be plotted below the bar, and if the alerts are enabled, a notification will be triggered.
🔹Pivot Lookback: Defines the number of bars to the left and right of the pivot that must be lower/higher to qualify as a pivot.
🔹Maximum Length Between Tops/Bottoms: Maximum number of bars between two tops/bottoms to be considered a double top or bottom.
🔹Style Settings: Allows the user to customize the appearance of the lines indicating the tops/bottoms. Options include color selection, line style (dotted, dashed, or solid), and line thickness.
🔹Alerts: The user can enable or disable alerts for Double Top and Double Bottom.
Give this indicator a BOOST and COMMENT your thoughts!
We hope you enjoy.
Cheers!
Nadaraya-Watson Envelope (Non-Repainting) Logarithmic ScaleIn the fast-paced world of trading, having a reliable and accurate indicator can make all the difference. Enter the Nadaraya-Watson Envelope Indicator, a cutting-edge tool designed to provide traders with valuable insights into market trends and potential price movements. In this article, we'll explore the advantages of this non-repainting indicator and how it can empower traders to make informed decisions with confidence.
Accurate Price Analysis:
The Nadaraya-Watson Envelope Indicator operates in a logarithmic scale, allowing for more accurate price analysis. By considering the logarithmic nature of price movements, this indicator captures the subtle nuances of market dynamics, providing a comprehensive view of price action. Traders can leverage this advantage to identify key support and resistance levels, spot potential breakouts, and anticipate trend reversals.
Non-Repainting Reliability:
One of the most significant advantages of the Nadaraya-Watson Envelope Indicator is its non-repainting nature. Repainting indicators can mislead traders by changing historical signals, making it difficult to evaluate past performance accurately. With the non-repainting characteristic of this indicator, traders can have confidence in the reliability and consistency of the signals generated, ensuring more accurate backtesting and decision-making.
Customizable Parameters:
Every trader has unique preferences and trading styles. The Nadaraya-Watson Envelope Indicator offers a range of customizable parameters, allowing traders to fine-tune the indicator to their specific needs. From adjusting the lookback window and relative weighting to defining the start of regression, traders have the flexibility to adapt the indicator to different timeframes and trading strategies, enhancing its effectiveness and versatility.
Envelope Bounds and Estimation:
The Nadaraya-Watson Envelope Indicator calculates upper and lower bounds based on the Average True Range (ATR) and specified factors. These envelope bounds act as dynamic support and resistance levels, providing traders with valuable reference points for potential price targets and stop-loss levels. Additionally, the indicator generates an estimation plot, visually representing the projected price movement, enabling traders to anticipate market trends and make well-informed trading decisions.
Visual Clarity with Plots and Fills:
Clear visualization is crucial for effective technical analysis. The Nadaraya-Watson Envelope Indicator offers plots and fills to enhance visual clarity and ease of interpretation. The upper and lower boundaries are plotted, along with the estimation line, allowing traders to quickly assess price trends and volatility. Fills between the boundaries provide a visual representation of different price regions, aiding in identifying potential trading opportunities and risk management.
Conclusion:
The Nadaraya-Watson Envelope Indicator is a powerful tool for traders seeking accurate and reliable insights into market trends and price movements. With its logarithmic scale, non-repainting nature, customizable parameters, and visual clarity, this indicator equips traders with a competitive edge in the financial markets. By harnessing the advantages offered by the Nadaraya-Watson Envelope Indicator, traders can navigate the complexities of trading with confidence and precision. Unlock the potential of this advanced indicator and elevate your trading strategy to new heights.
RAINBOW AVERAGES - INDICATOR - (AS) - 1/3
-INTRODUCTION:
This is the first of three scripts I intend to publish using rainbow indicators. This script serves as a groundwork for the other two. It is a RAINBOW MOVING AVERAGES indicator primarily designed for trend detection. The upcoming script will also be an indicator but with overlay=false (below the chart, not on it) and will utilize RAINBOW BANDS and RAINBOW OSCILLATOR. The third script will be a strategy combining all of them.
RAINBOW moving averages can be used in various ways, but this script is mainly intended for trend analysis. It is meant to be used with overlay=true, but if the user wishes, it can be viewed below the chart. To achieve this, you need to change the code from overlay=true to false and turn off the first switch that plots the rainbow on the chart (or simply move the indicator to a new pane below). By doing this, you will be able to see how all four conditions used to detect trends work on the chart. But let's not get ahead of ourselves.
-WHAT IS IT:
In its simplest form, this indicator uses 10 moving averages colored like a rainbow. The calculation is as follows:
MA0: This is the main moving average and can be defined with the type (SMA, EMA, RMA, WMA, SINE), length, and price source. However, the second moving average (MA1) is calculated using MA0 as its source, MA2 uses MA1 as the data source, and so on, until the last one, MA9. Hence, there are 10 moving averages. The first moving average is special as all the others derive from it. This indicator has many potential uses, such as entry/exit signals, volatility indication, and stop-loss placement, but for now, we will focus on trend detection.
-TREND DETECTION:
The indicator offers four different background color options based on the user's preference:
0-NONE: No background color is applied as no trend detection tools is being used (boring)
1-CHANGE: The background color is determined by summing the changes of all 10 moving averages (from two bars). If the sum is positive and not falling, the background color is GREEN. If the sum is negative and not rising, the background color is RED. From early testing, it works well for the beginning of a movement but not so much for a lasting trend.
2-RAINBW: The background color is green when all the moving averages are in ascending order, indicating a bullish trend. It is red when all the moving averages are in descending order, indicating a bearish trend. For example, if MA1>MA2>MA3>MA4..., the background color is green. If MA1 threshold, and red indicates width < -threshold.
4-DIRECT: The background color is determined by counting the number of moving averages that are either above or below the input source. If the specified number of moving averages is above the source, the background color is green. If the specified number of moving averages is below the source, the background color is red. If all ten MAs are below the price source, the indicator will show 10, and if all ten MAs are above, it will show -10. The specific value will be set later in the settings (same for 3-TSHOLD variant). This method works well for lasting trends.
Note: If the indicator is turned into a below-chart version, all four color options can be seen as separate indicators.
-PARAMETERS - SETTINGS:
The first line is an on/off switch to plot the skittles indicator (and some info in the tooltip). The second line has already been discussed, which is the background color and the selection of the source (only used for MA0!).
The line "MA1: TYP/LEN" is where we define the parameters of MA0 (important). We choose from the types of moving averages (SMA, EMA, RMA, WMA, SINE) and set the length.
Important Note: It says MA1, but it should be MA0!.
The next line defines whether we want to smooth MA1 (which is actually MA0) and the period for smoothing. When smoothing is turned on, MA0 will be smoothed using a 3-pole super smoother. It's worth noting that although this only applies to MA0, as the other MAs are derived from it, they will also be smoothed.
In the line below, we define the type and length of MAs for MA2 (and other MAs except MA0). The same type and length are used for MA1 to MA9. It's important to remember that these values should be smaller. For example, if we set 55, it means that MA1 is the average of 55 periods of MA0, MA2 will be 55 periods of MA1, and so on. I encourage trying different combinations of MA types as it can be easily adjusted for ur type of trading. RMA looks quirky.
Moving on to the last line, we define some inputs for the background color:
TSH: The threshold value when using 3-TSHOLD-BGC. It's a good idea to change the chart to a pane below for easier adjustment. The default values are based on EURUSD-5M.
BG_DIR: The value that must be crossed or equal to the MA score if using 4-DIRECT-BGC. There are 10 MAs, so the maximum value is also 10. For example, if you set it to 9, it means that at least 9 MAs must be below/above the price for the script to detect a trend. Higher values are recommended as most of the time, this indicator oscillates either around the maximum or minimum value.
-SUMMARY OF SETTINGS:
L1 - PLOT MAs and general info tooltip
L2 - Select the source for MA0 and type of trend detection.
L3 - Set the type and length of MA0 (important).
L4 - Turn smoothing on/off for MA0 and set the period for super smoothing.
L5 - Set the type and length for the rest of the MAs.
L6 - Set values if using 4-DIRECT or 3-TSHOLD for the trend detection.
-OTHERS:
To see trend indicators, you need to turn off the plotting of MAs (first line), and then choose the variant you want for the background color. This will plot it on the chart below.
Keep in mind that M1 int settings stands for MA0 and MA2 for all of the 9 MAs left.
Yes, it may seem more complicated than it actually is. In a nutshell, these are 10 MAs, and each one after MA0 uses the previous one as its source. Plus few conditions for range detection. rest is mainly plots and colors.
There are tooltips to help you with the parameters.
I hope this will be useful to someone. If you have any ideas, feedback, or spot errors in the code, LET ME KNOW.
Stay tuned for the remaining two scripts using skittles indicators and check out my other scripts.
-ALSO:
I'm always looking for ideas for interesting indicators and strategies that I could code, so if you don't know Pinescript, just message me, and I would be glad to write your own indicator/strategy for free, obviously.
-----May the force of the market be with you, and until we meet again,
StdDev ChannelsThis script draws two sets of standard deviation channels on the price chart, providing a nuanced view of price volatility over different lengths.
The script starts by declaring a set of user-defined inputs allowing traders to customize the tool according to their individual requirements. The price input sets the source of the price data, defaulting to the closing price but customizable to use open, high, or low prices. The deviations parameter defines the width of the channels, with larger numbers resulting in wider channels. The length and length2 inputs represent the number of periods (in bars) that the script considers when calculating the regression line and standard deviation. Traders can also personalize the visual aspects of the indicator on the chart using the color, linewidth, and linestyle parameters.
Calculation of Standard Deviation:
The core of this script lies in calculating the regression line and standard deviation. This is where the InertiaAll function comes into play. This function calculates the linear regression line, which serves as the middle line of each channel. The function takes in two parameters: y (price data) and n (length for calculation). It returns an array containing the values for the regression line (InertiaTS), counter variable (x), slope of the line (a), and y-intercept (b). The standard deviation is then calculated using the built-in function ta.stdev, which measures the amount of variation or dispersion from the average.
After the calculation, the script proceeds to draw the channels. It creates two sets of lines (upper, middle, and lower) for each channel. These lines are initialized at the lowest price point on the chart (low). The coordinates for these lines get updated in the last section of the script, which runs only on the last bar on the chart (if barstate.islast). The functions line.set_xy1 and line.set_xy2 are used to adjust the starting and ending points for each line, forming the channels.
If the "full range" toggle is enabled, the script uses the maximum number of bars available on the chart to calculate the regression and standard deviation. This can give a broader perspective of the price's volatility over the entire available data range.
A Basic Strategy
The channels generated by this script may inform your trading decisions. If the price hits the upper line of a channel, it could suggest an 'overbought' condition indicating a potential selling opportunity. Conversely, if the price hits the lower line, it might signal an 'oversold' condition, suggesting a buying opportunity. The second channel, calculated over a different length, may serve to confirm these signals or identify longer-term trends.
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.
Pro Trading Art - Double Top & Bottom with alertThis indicator is based on ta.pivothigh and ta.pivotlow function. And with the help of different ph and pl I am detecting double top and double bottom.
Features
1. All signal are on realtime means no repaint
2. Able to detect precise double top & bottom
Input Field
Pivot Length : Default 10 => Use to detect pivot point
V Bottom & V Top Pattern [Misu]█ This indicator shows V bottom & V top patterns as well as potential V bottom & V top.
These V bottom & V top are chart powerful reversal patterns.
They appear in all markets and time-frames, but due to the nature of the aggressive moves that take place when a market reverses direction, it can be difficult to identify this pattern in real-time.
To address this problem, I added potential V pattern as well as the confirmed one.
█ Usages:
You can use V top & V bottoms for reversal zones.
You can use it for scalping strategies, as a main buy & sell signal.
Potential V patterns can be used to anticipate the market, in addition to volatility or momentum indicators, for example.
█ How it works?
This indicator uses pivot points to determine potential V patterns and confirm them.
Paramaters are available to filter breakouts of varying strengths.
Patterns also have a "max number bars" to be validated.
█ Why a Strategy type indicator?
Due to the many different parameters, this indicator is a strategy type.
This way you can overview the best settings depending on your pair & timeframe.
Parameters are available to filter.
█ Parameters:
Deviation: Parameter used to calculate parameters.
Depth: Parameter used to calculate parameters.
Confirmation Type: Type of signal used to confirme the pattern.
> Mid Pivot: pattern will confirm on mid pivot breakout.
> Opposit Pivot: pattern will confirm on opposit pivot breakout.
> No confirmation: no confirmation.
Lenght Avg Body: Lenght used to calculate the average body size.
First Breakout Factor: This factor multiplied by the "body avg" filters out the non-significant breakout of potential V pattern.
Confirmation Breakout Factor: This factor multiplied by the "body avg" filters out the non-significant breakout for the confirmation.
Max Bars Confirmation: The maximum number of bars needed to validate the pattern.
Hodrick-Prescott Channel [Loxx]Hodrick-Prescott Channel is a fast and slow moving average that moves inside a channel. Breakouts are when the fast ma crosses up over the slow ma and breakdowns are the opposite. The white moving average is the fast ma, the slow moving average is the red/green ma.
What is Hodrick–Prescott filter?
The Hodrick–Prescott filter (also known as Hodrick–Prescott decomposition) is a mathematical tool used in macroeconomics, especially in real business cycle theory, to remove the cyclical component of a time series from raw data. It is used to obtain a smoothed-curve representation of a time series, one that is more sensitive to long-term than to short-term fluctuations. The adjustment of the sensitivity of the trend to short-term fluctuations is achieved by modifying a multiplier Lambda.
The filter was popularized in the field of economics in the 1990s by economists Robert J. Hodrick and Nobel Memorial Prize winner Edward C. Prescott, though it was first proposed much earlier by E. T. Whittaker in 1923.
There are some drawbacks to use the HP filter than you can read here: en.wikipedia.org
Included
Bar coloring
Signals
Alerts