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.
Envelope (ENV)
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:
Auto-Length Adaptive ChannelsIntroduction
The key innovation of the ALAC is the implementation of dynamic length identification, which allows the indicator to adjust to the "market beat" or dominant cycle in real-time.
The Auto-Length Adaptive Channels (ALAC) is a flexible technical analysis tool that combines the benefits of five different approaches to market band and price deviation calculations.
Traders often tend to overthink of what length their indicators should use, and this is the main idea behind this script. It automatically calculates length based on pivot points, averaging the distance that is in between of current market highs and lows.
This approach is very helpful to identify market deviations, because deviations are always calculated and compared to previous market behavior.
How it works
The indicator uses a Detrended Rhythm Oscillator (DRO) to identify the dominant cycle in the market. This length information is then used to calculate different market bands and price deviations. The ALAC combines five different methodologies to compute these bands:
1 - Bollinger Bands
2 - Keltner Channels
3 - Envelope
4 - Average True Range Channels
5 - Donchian Channels
By averaging these calculations, the ALAC produces an overall market band that generalizes the approaches of these five methods into a single, adaptive channel.
How to Use
When the price is at the upper band, this might suggest that the asset is overbought and may be due for a price correction. Conversely, when the price is at the lower band, the asset may be oversold and due for a price increase.
The space between the bands represents the market's volatility. Wider bands indicate higher volatility, while narrower bands suggest lower volatility.
Indicator Settings
The settings of the ALAC allow for customization to suit different trading strategies:
Use Autolength?: This allows the indicator to automatically adjust the length of the dominant cycle.
Usual Length: If "Use Autolength?" is disabled, this setting allows the user to manually specify the length of the cycle.
Moving Average Type: This selects the type of moving average to be used in the calculations. Options include SMA, EMA, ALMA, DEMA, JMA, KAMA, SMMA, TMA, TSF, VMA, VAMA, VWMA, WMA, and ZLEMA.
Channel Multiplier: This adjusts the distance between the bands.
Channel Multiplier Step: This changes the step size of the channel multiplier. Each next market band will be multiplied by a previous one. You can potentially use values below 1, which will plot bands inside the first, main channel.
Use DPO instead of source data?: This setting uses the DPO for calculations instead of the source data. Basically, this is how you can add or eliminate trend from calculation of an average leg-up / leg-down move.
Fast: This adjusts the fast length of the DPO.
Slow: This adjusts the slow length of the DPO.
Zig-zag Period: This adjusts the period of the zig-zag pattern used in the DPO.
(!) For more information about DPO visit official TradingView description here: link
Also, I want to say thanks to @StockMarketCycles for initial idea of Detrended Rhythm Oscillator (DRO) that I use in this script.
The Adaptive Average Channel is a powerful and versatile indicator that combines the strengths of multiple technical analysis methods.
In summary, with the ALAC, you can:
1 - Dynamically adapt to any asset and price action with automatic calculation of dominant cycle lengths.
2 - Identify potential overbought and oversold conditions with the adaptive market bands.
3 - Customize your analysis with various settings, including moving average type and channel multiplier.
4 - Enhance your trading strategy by using the indicator in conjunction with other forms of analysis.
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.
Smart Trend EnvelopeThe "Smart Trend Envelope" indicator is a powerful tool that combines the "Nadaraya-Watson Envelope " indicator by LuxAlgo and the "Strongest Trendline" indicator by Julien_Eche.
This indicator provides valuable insights into price trends and projection confidence levels in financial markets. However, it's important to note that the indicator may repaint, meaning that the displayed results can change after the fact.
The "Strongest Trendline" indicator by Julien_Eche focuses on identifying the strongest trendlines using logarithmic transformations of price data. It calculates the slope, average, and intercept of each trendline over user-defined lengths. The indicator also provides standard deviation, Pearson's R correlation coefficient, and upper/lower deviation values to assess the strength and reliability of the trendlines.
In addition, the "Nadaraya-Watson Envelope " indicator developed by LuxAlgo utilizes the Nadaraya-Watson kernel regression technique. It applies a kernel function to smooth the price data and estimate future price movements. The indicator allows adjustment of the bandwidth parameter and multiplier to control the width of the envelope lines around the smoothed line.
Combining these two indicators, the "Smart Trend Envelope" indicator offers traders and investors a comprehensive analysis of price trends and projection confidence levels. It automatically selects the strongest trendline length based on the highest Pearson's R correlation coefficient. Traders can observe the trendlines on the price chart, along with upper and lower envelope lines generated by the Nadaraya-Watson smoothing technique.
The "Smart Trend Envelope" indicator has several qualities that make it a valuable tool for technical analysis:
1. Automatic Length Selection: The indicator dynamically selects the optimal trendline length based on the highest Pearson's R correlation coefficient, ensuring accurate trend analysis.
2. Projection Confidence Level: The indicator provides a projection confidence level ranging from "Ultra Weak" to "Ultra Strong." This allows traders to assess the reliability of the projected trend and make informed trading decisions.
3. Color-Coded Visualization: The indicator uses color schemes, such as teal and red, to highlight the direction of the trend and the corresponding envelope lines. This visual representation makes it easier to interpret the market trends at a glance.
4. Customizable Settings: Traders can adjust parameters such as bandwidth, multiplier, line color, and line width to tailor the indicator to their specific trading strategies and preferences.
The "Smart Trend Envelope" indicator has been specifically designed and coded to be used in logarithmic scale. It takes advantage of the logarithmic scale's ability to represent exponential price movements accurately. Therefore, it is highly recommended to use this indicator with the chart set to logarithmic scale for optimal performance and reliable trend analysis, especially on higher timeframes.
It's important to remember that the "Smart Trend Envelope" indicator may repaint, meaning that the displayed results can change after the fact. Traders should use this indicator as a tool for generating trade ideas and confirmation, rather than relying solely on its historical values. Combining the indicator with other technical analysis tools and considering fundamental factors can lead to more robust trading strategies.
TrueLevel BandsTrueLevel Bands is a powerful trading indicator that employs linear regression and standard deviation to create dynamic, envelope-style bands around the price action of a financial instrument. These bands are designed to help traders identify potential support and resistance levels, trend direction, and volatility.
The TrueLevel Bands indicator consists of multiple envelope bands, each constructed using different timeframes or lengths, and a multiple (mult) factor. The multiple factor determines the width of the bands by adjusting the number of standard deviations from the linear regression line.
Key Features of TrueLevel Bands
1. Multi-Timeframe Analysis: Unlike traditional moving average-based indicators, TrueLevel Bands allow traders to incorporate multiple timeframes into their analysis. This helps traders capture both short-term and long-term market dynamics, offering a more comprehensive understanding of price behavior.
2. Customization: The TrueLevel Bands indicator offers a high level of customization, allowing traders to adjust the lengths and multiple factors to suit their trading style and preferences. This flexibility enables traders to fine-tune the indicator to work optimally with various instruments and market conditions.
3. Adaptive Volatility: By incorporating standard deviation, TrueLevel Bands can automatically adjust to changing market volatility. This feature enables the bands to expand during periods of high volatility and contract during periods of low volatility, providing traders with a more accurate representation of market dynamics.
4. Dynamic Support and Resistance Levels: TrueLevel Bands can help traders identify dynamic support and resistance levels, as the bands adjust in real-time according to price action. This can be particularly useful for traders looking to enter or exit positions based on support and resistance levels.
5. The "Global Trend Line" refers to the average of the bands used to indicate the overall trend.
Why TrueLevel Bands are Different from Classic Moving Averages
TrueLevel Bands differ from conventional moving averages in several ways:
1. Linear Regression: While moving averages are based on simple arithmetic means, TrueLevel Bands use linear regression to determine the centerline. This offers a more accurate representation of the trend and helps traders better assess potential entry and exit points.
2. Envelope Style Bands: Unlike moving averages, which are single lines, TrueLevel Bands form envelope-style bands around the price action. This provides traders with a visual representation of potential support and resistance levels, trend direction, and volatility.
3. Multi-Timeframe Analysis: Classic moving averages typically focus on a single timeframe. In contrast, TrueLevel Bands incorporate multiple timeframes, enabling traders to capture a broader understanding of market dynamics.
4. Adaptive Volatility: Traditional moving averages do not account for changing market volatility, whereas TrueLevel Bands automatically adjust to volatility shifts through the use of standard deviation.
The TrueLevel Bands indicator is a powerful, versatile tool that offers traders a unique approach to technical analysis. With its ability to adapt to changing market conditions, provide multi-timeframe analysis, and dynamic support and resistance levels, TrueLevel Bands can serve as an invaluable asset to both novice and experienced traders looking to gain an edge in the markets.
Extended Recursive Bands StrategyThe original indicator was created by alexgrover .
All credit goes to alexgrover for creating the indicator that this strategy uses.
This strategy was posted because there were multiple requests for it, and no strategy based on this indicator exists yet.
The Recursive Bands Indicator, an indicator specially created to be extremely efficient, I think you already know that calculation time is extra important in algorithmic trading, and this is the principal motivation for the creation of the proposed indicator. Originally described in Alex's paper "Pierrefeu, Alex (2019): Recursive Bands - A New Indicator For Technical Analysis", the indicator framework has been widely used in his previous uploaded indicators, however it would have been a shame to not upload it, however user experience being a major concern for me, I decided to add extra options, which explain the term "extended".
The Indicator
The indicator displays one upper and one lower band, every common usages applied to bands indicators such as support/resistance , breakout, trailing stop, etc, can also be applied to this one. Length controls how reactive the bands are, higher values will make the bands cross the price less often.
In order to provide more flexibility for the user alexgrover added the option to use various methods for the calculation of the indicator, therefore the indicator can use the average true range , standard deviation, average high-low range, and one totally exclusive method specially designed for this indicator.
Added logic:
We have implemented a logic that checks whether the bands have been following in the same direction for a set amount of bars. This logic must be true before it can enter trades. This is completely new code that was written by us entirely, and it makes a huge difference on strategy performance.
Strategy Long conditions:
1 — Price low is below the the lower band.
2 — The lower band keeps increasing in value until the 'lookback' setting amount of bars is reached.
Strategy Short conditions:
1 — Price high is above the upper band.
2 — The upper band keeps decreasing in value until the 'lookback' setting amount of bars is reached.
Strategy Properties:
We have set a default commission of 0.06% because these are Bybit's fees. The strategy uses an order size of 10% of equity, since drawdown is very low like this. We also use a 10 tick slippage to keep results realistic and account for this. All other settings were left as default apart from initial capital, just to decrease the size of the numbers.
Nadaraya-Watson non repainting [LPWN]// ENGLISH
The problem of the wonderfuls Nadaraya-Watson indicators is that they repainting, @jdehorty made an aproximation of the Nadaraya-Watson Estimator using raational Quadratic Kernel so i used this indicator as inspiration i just added the Upper and lower band using ATR with this we get an aproximation of Nadaraya-Watson Envelope without repainting
Settings:
Bandwidth. This is the number of bars that the indicator will use as a lookback window.
Relative Weighting Parameter. The alpha parameter for the Rational Quadratic Kernel function. This is a hyperparameter that controls the smoothness of the curve. A lower value of alpha will result in a smoother, more stretched-out curve, while a lower value will result in a more wiggly curve with a tighter fit to the data. As this parameter approaches 0, the longer time frames will exert more influence on the estimation, and as it approaches infinity, the curve will become identical to the one produced by the Gaussian Kernel.
Color Smoothing. Toggles the mechanism for coloring the estimation plot between rate of change and cross over modes.
ATR Period. Period to calculate the ATR (upper and lower bands)
Multiplier. Separation of the bands
// SPANISH
El problema de los maravillosos indicadores de Nadaraya-Watson es que repintan, @jdehorty hizo una aproximación delNadaraya-Watson Estimator usando un Kernel cuadrático racional, así que usé este indicador como inspiración y solo agregamos la banda superior e inferior usando ATR con esto obtenemos una aproximación de Nadaraya-Watson Envelope sin volver a pintar
Configuración:
Banda ancha. Este es el número de barras que el indicador utilizará como ventana retrospectiva.
Parámetro de ponderación relativa. El parámetro alfa para la función Rational Quadratic Kernel. Este es un hiperparámetro que controla la suavidad de la curva. Un valor más bajo de alfa dará como resultado una curva más suave y estirada, mientras que un valor más bajo dará como resultado una curva más ondulada con un ajuste más ajustado a los datos. A medida que este parámetro se acerque a 0, los marcos de tiempo más largos ejercerán más influencia en la estimación y, a medida que se acerque al infinito, la curva será idéntica a la que produce el Gaussian Kernel.
Suavizado de color. Alterna el mecanismo para colorear el gráfico de estimación entre la tasa de cambio y los modos cruzados.
Período ATR. Periodo para calcular el ATR (bandas superior e inferior)
Multiplicador. Separación de las bandas
ENVELOPE RSI - Buy Sell SignalsThis indicator is mainly based on Overbought and Oversold . Indicator for short-term trading. This way you can get small but acceptable signals.
The main basis of the indicator is as follows:
To buy, the indicator is waiting for the instrument to be oversold from the RSI point of view. Then, if the chart crosses the bottom line of the Envelope indicator from the bottom to the top, a buy signal is issued.
For sell, the indicator waits for the instrument to be overbought from the RSI perspective. Then, if the chart crosses the top line of the Envelope indicator from top to bottom, a sell signal is issued.
The general basis is the consonance of the price and the RSI indicator .
The best settings I came up with myself:
Time frame: 15 minutes
Overbought: 80
Oversell: 25
RSI Length: 8
It can be done on different instruments. But always set your profit and loss limits.
(Profit to loss ratio in this indicator can be 1: 1.)
Disclaimer : This information and trading indicators and tools provided neither is, nor should be construed, as an offer, or a solicitation of an offer, to buy or sell securities. You shall be fully responsible for any investment decision you make, and such decisions will be based solely on your evaluation of your financial circumstances, investment objectives, risk tolerance, and liquidity needs.
I am not liable for any profit, financial improvement, losses or damages, monetary or other that may result from the application of information contained within this indicator. Individual traders must use their own due diligence in analyzing featured trading indicators, other trading tools, webinars and other educational materials to determine if they represent suitable and useable features and capabilities for the individual trader.
Volatility ChannelThis script is based on an idea I have had for bands that react better to crypto volatility. It calculates a Donchian Channel, SMMA-Smoothed True Range, Bollinger Bands (standard deviation), and a Keltner Channel (average true range) and averages the components to construct its bands/envelopes. This way, hopefully band touches are a more reliable indicator of a temporary bottom, and so on. Secondary coloring for strength of trend is given as a gradient based on RSI.
Nadaraya-Watson Envelope [LuxAlgo]This indicator builds upon the previously posted Nadaraya-Watson smoothers. Here we have created an envelope indicator based on Kernel Smoothing with integrated alerts from crosses between the price and envelope extremities. Unlike the Nadaraya-Watson estimator, this indicator follows a contrarian methodology.
Please note that by default this indicator can be subject to repainting. Users can use a non-repainting smoothing method available from the settings. The triangle labels are designed so that the indicator remains useful in real-time applications.
🔶 USAGE
🔹 Non Repainting
This tool can outline extremes made by the prices. This is achieved by estimating the underlying trend in the price, then calculating the mean absolute deviations from it, the obtained result is added/subtracted to the estimated underlying trend.
The non-repainting method estimates the underlying trend in price using an "endpoint Nadaraya-Watson estimator", and would return similar results to more classical band indicators.
🔹 Repainting
The repainting method makes use of the Nadaraya-Watson estimator to estimate the underlying trend in the price. The construction of the band extremities is the same as in the non-repainting method.
We can expect the price to reverse when crossing one of the envelope extremities. Crosses between the price and the envelopes extremities are indicated with triangles on the chart.
For real-time applications, triangles are always displayed when a cross occurs and remain displayed at the location it first appeared even if the cross is no longer visible after a recalculation of the envelope.
By popular demand, we have integrated alerts for this indicator from the crosses between the price and the envelope extremities. However, we do not recommend this precise method to be used alone or for solely real-time applications. We do not have data supporting the performance of this tool over more classical bands/envelope/channels indicators.
🔶 SETTINGS
Bandwidth: Controls the degree of smoothness of the envelopes, with higher values returning smoother results.
Mult: Controls the envelope width.
Source: Input source of the indicator.
Repainting Smoothing: Determine if a repainting or non-repainting method should be used for the calculation of the indicator.
🔶 RELATED SCRIPTS
For more information on the Nadaraya-Watson estimator see:
[RedK] Stepped Moving Average Channel (SMAC)The Stepping Moving Average Channel (SMAC) is not an indicator - It is more of a trading tool that was put together to enable a trader to take advantage of relatively fast price moves with quick incremental gain - maybe by exploiting opportunities to trade basic options (Calls, Puts) or to help with in/out-type swing trades. This is more a price-level visualization tool so please use it with this in mind, and not as a trading tool by itself.
While it looks very similar to a Donchian channel, SMAC plots a stepping channel of the moving average of the high & low prices (channel borders) - with an envelope that is at a user-specified % distance from the channel borders.
This setup, when combined with other Moving Averages and lower indicators, may make it easier for a trader to prepare for a trade with clear entry and exit price levels being planned upfront.
For example, a trader wants to capture 2% of the next move, will set the envelope to 2% and have clearer view of entry/exit price levels for such a scenario. once the trader receives confirmation (from other indicators or charts) that the price is heading in the way expected, the SMAC may make it simpler and quicker to estimate (and visualize) the entry/exit price levels and track the movement.
* The stepping feature helps remove price noise and the auto-stepping feature is designed to "snap to" those mental price levels that trader gravitate towards.
* The moving average type I used here is the Compound Ratio MA (CoRA_Wave) .
* This MA type was selected because it has a very high responsiveness and good smoothness, and tracks the price values very closely.
* The MA type can be replaced within the code with any other MA as preferred.
The auto-stepping feature:
----------------------------------
User can override the auto-stepping by entering a manual step value
when the auto-stepping is active, it will attempt to pick the best step size based on the underlying price range and the timeframe selected.
The step selection may not be ideal in some combination of value / TF - i will continue to improve these combinations
Stepping can also be completely disabled - this bring SMAC back to a regular (though highly responsive) Hi/Lo MA channel with envelope
The Excel table snippet in the chart above shows the various step value / TF combinations.
Also the stepping values can be further customized by changing the appropriate part in the script.
Other features:
--------------------
* Rounding Options: The stepping calculations uses one of 2 selectable methods:
1 -- regular rounding (uses the round() function): which rounds the price up & down depending on where it is compared to the half-step value
example: a value of 17 with a step of 10 will be rounded to 20. a value of 13 in that case will be rounded to 10
2 -- Whole Step (uses the int() function): this will only consider whole/fully completed steps - if the average (hi or low) does not explicitly exceed the next step level, we will not get that next value.
example: both values of 17 and 13 with a step of 10 will be rounded to 10.
* The "Quick Table":
The Quick Table shows on the top-left - and can be disabled in the script settings - It shows the currently selected stepping mode and value - since the auto-step changes dynamically with the selected chart timeframe, this makes it easier for the trader to view the active "configuration"
overall, i hope some traders find this quick utility useful - if not to use, maybe to inspire other ideas
- please feel free to use or customize in any way you need. Feel free to share feedback and observations.
Average EnvelopeA script to calculate a support / resistance level which acts as either a bounce level or a flip level. This is rather a macro play guide than a day trade tool.
The average is calculated by taking into account monthly/weekly/daily highs and average them out.
The script also paints fib levels based on the values of the upper and the lower band.
While this was designed with a cryptocurrency market in mind (no 'close' values per-se) it holds with traditional markets as well.
stop out or margin call price levelsAbstract
This script finds the potential stop out or margin call price levels without considering timeframe.
This script computes stop out or margin call price levels that over leveraged positions buy cheap enough.
You can use this indicator to follow stop hunters.
Introduction
Stop hunting exists because of benefit conflict.
When most of retails traders are in the correct direction, big banks do not want to buy more expensive then retail traders.
Therefore, Big banks create sell pressure to make retail traders misunderstand their trade decisions are wrong.
When retail traders decide to cut loss, it is time big banks buy cheaper.
Many courses recommend average true range as a stop loss reference.
However, in different timeframe, average true ranges are different.
Therefore, we need to have a method to measure potential stop hunting levels which is not relative to timeframe.
There is a method because there are observable levels where over leveraged positions must cut loss.
For example, for a 100 leverage position, its margin call level is 0.005, so 0.005 drawdown is a potential stop hunting level.
Computing
For buy
potential stop out or margin call price level = low * ( 1 - ratio )
For sell
potential stop out or margin call price level = high * ( 1 + ratio )
Parameters
There are 4 levels available for adjusting.
The default values are :
(1) 0.001 : 500 leverage , 50% margin call
(2) 0.0025 : 200 leverage , 50% margin call
(3) 0.005 : 100 leverage , 50% margin call
(4) 0.010 : 50 leverage , 50% margin call
Usage
(1) Find an oversold price level. If you don't want to use an another indicator, you can use previous low.
(2) Memorize their stop out or margin call price levels of that level.
(2) Consider buy near those levels.
(3) If there are quick price rejection near those levels, better entry opportunities.
(4) Take profit and stop loss : you decide.
Conclusion
This script can find potential stop out or margin call price levels that over leveraged positions buy cheap enough.
If you are bored, you can consider find 100 signals you are interested in and share your observation.
Reference
Brokers, leverage and margin call threshold
Combo Backtest 123 Reversal & Moving Average Envelopes This is combo strategies for get a cumulative signal.
First strategy
This System was created from the Book "How I Tripled My Money In The
Futures Market" by Ulf Jensen, Page 183. This is reverse type of strategies.
The strategy buys at market, if close price is higher than the previous close
during 2 days and the meaning of 9-days Stochastic Slow Oscillator is lower than 50.
The strategy sells at market, if close price is lower than the previous close price
during 2 days and the meaning of 9-days Stochastic Fast Oscillator is higher than 50.
Second strategy
Moving Average Envelopes are percentage-based envelopes set above and
below a moving average. The moving average, which forms the base for
this indicator, can be a simple or exponential moving average. Each
envelope is then set the same percentage above or below the moving average.
This creates parallel bands that follow price action. With a moving average
as the base, Moving Average Envelopes can be used as a trend following indicator.
However, this indicator is not limited to just trend following. The envelopes
can also be used to identify overbought and oversold levels when the trend is
relatively flat.
WARNING:
- For purpose educate only
- This script to change bars colors.
Dynamic EnvelopeA dynamic envelope is designed to build an actual envelope that consider the volatility of a trading instrument.
A dynamic envelope is an ideal counter-trend indicator, it takes into account the nature of the movement of the instrument. At the same time, it does not require adjustment of parameters over time, it adjusts itself to volatility.
The indicator can be effectively used on any markets and instruments.
Динамический конверт предназначен для построения актуального конверта, который учитывает волатильность торгового инструмента.
Динамический конверт - это идеальный контртрендовый индикатор, он учитывает характер движения инструмента. При этом он не требует подгонки параметров со временем, он сам подстраивается под волатильность.
Индикатор можно эффективно использовать на любых рынках и инструментах.
HEYC-Bands-Strategy by HassonyaHey guys, HEYC-Bands-Strategy indicator is moving average envelopes trend tracker system are pivot-based envelopes set above and below a moving average. Envelope is then set the high and low above or below the moving average. This creates parallel bands that follow price action. With a moving average as the base, Moving Average Envelopes can be used as a trend following indicator. However, this indicator is not limited to just trend following. You can also use it as support and resistance. The indicator aims to ensure that you follow the trend with maximum consistency and stay in the trend.
The indicator has 15 different options that form the basis of the moving average. What options are these?
- EMA - Exponential Moving Average
- WMA - Weighted Moving Average
- VWMA - Volume-Weighted Moving Average
- DEMA - Double Exponential Moving Average
- TEMA - Triple Exponential Moving Average
- LAGMA - Laguerre Moving Average
- HULLMA - Hull Moving Average
- EHMA - Exponential Hull Moving Average
- ETMA - Exponential Triangular Moving Average
- SSMA - Super-Smoother Moving Average
- ALMA - Arnaud Legoux Moving Average
- VIDYA - Variable Index Dynamic Average
- STMA - Triangular Moving Average
- ZEMA - Zero-Lag Exponential Moving Average
- SMA - Simple Moving Average
With the simplest logic, you can use it as buy when the price closes on the band, and sell when the price closes below the band.
Vertical lines and background guide you in the buying/selling trend changes in the indicator settings.
Thanks for support
[blackcat] L2 Price Envelope TrackerLevel: 2
Background
Price envelopes sare shown at a set percentage above and below a moving average. They are used to indicate overbought and oversold levels and can be traded individually or in conjunction with a momentum indicator.
Function
L2 Price Envelope Tracker is an innovative indicator that use customized envelope of price to disclose overbought and oversold periods. With this function, long and short entries can be further developped in this pine script.
Key Signal
sma5 --> typical price moving average line
resistance --> upper envelope as resistance line
support ---> lower envelope as support line
Pros and Cons
Pros:
1. easy observe overbought and oversold zone
2. disclose exact long and short entries in overbought and oversold zones
Cons:
1. Only applicable for the trading pairs that support financial() functions. crypto/xau/xag/indice are not applicable
2. Need to tune r1 and s1 for different trading pairs
Remarks
NA
Readme
In real life, I am a prolific inventor. I have successfully applied for more than 60 international and regional patents in the past 12 years. But in the past two years or so, I have tried to transfer my creativity to the development of trading strategies. Tradingview is the ideal platform for me. I am selecting and contributing some of the hundreds of scripts to publish in Tradingview community. Welcome everyone to interact with me to discuss these interesting pine scripts.
The scripts posted are categorized into 5 levels according to my efforts or manhours put into these works.
Level 1 : interesting script snippets or distinctive improvement from classic indicators or strategy. Level 1 scripts can usually appear in more complex indicators as a function module or element.
Level 2 : composite indicator/strategy. By selecting or combining several independent or dependent functions or sub indicators in proper way, the composite script exhibits a resonance phenomenon which can filter out noise or fake trading signal to enhance trading confidence level.
Level 3 : comprehensive indicator/strategy. They are simple trading systems based on my strategies. They are commonly containing several or all of entry signal, close signal, stop loss, take profit, re-entry, risk management, and position sizing techniques. Even some interesting fundamental and mass psychological aspects are incorporated.
Level 4 : script snippets or functions that do not disclose source code. Interesting element that can reveal market laws and work as raw material for indicators and strategies. If you find Level 1~2 scripts are helpful, Level 4 is a private version that took me far more efforts to develop.
Level 5 : indicator/strategy that do not disclose source code. private version of Level 3 script with my accumulated script processing skills or a large number of custom functions. I had a private function library built in past two years. Level 5 scripts use many of them to achieve private trading strategy.
Moving Average Displaced Envelope Backtest Moving Average Displaced Envelope. These envelopes are calculated
by multiplying percentage factors with their displaced expotential
moving average (EMA) core.
How To Trade Using:
Adjust the envelopes percentage factors to control the quantity and
quality of the signals. If a previous high goes above the envelope
a sell signal is generated. Conversely, if the previous low goes below
the envelope a buy signal is given.
WARNING:
- For purpose educate only
- This script to change bars colors.
Moving Average Displaced Envelope Strategy Moving Average Displaced Envelope. These envelopes are calculated
by multiplying percentage factors with their displaced expotential
moving average (EMA) core.
How To Trade Using:
Adjust the envelopes percentage factors to control the quantity and
quality of the signals. If a previous high goes above the envelope
a sell signal is generated. Conversely, if the previous low goes below
the envelope a buy signal is given.
WARNING:
- For purpose educate only
- This script to change bars colors.
Moving Average Displaced Envelope Moving Average Displaced Envelope. These envelopes are calculated
by multiplying percentage factors with their displaced expotential
moving average (EMA) core.
How To Trade Using:
Adjust the envelopes percentage factors to control the quantity and
quality of the signals. If a previous high goes above the envelope
a sell signal is generated. Conversely, if the previous low goes below
the envelope a buy signal is given.
Bitcoin Margin Call Envelopes [saraphig & alexgrover]Bitcoin is the most well known digital currency, and allow two parties to make a transaction without the need of a central entity, this is why cryptocurrencies are said to be decentralized, there is no central unit in the transaction network, this can be achieved thanks to cryptography. Bitcoin is also the most traded cryptocurrency and has the largest market capitalization, this make it one of the most liquid cryptocurrency.
There has been tons of academic research studying the profitability of Bitcoin as well as its role as a safe heaven asset, with all giving mixed conclusions, some says that Bitcoin is to risky to be considered as an hedging instrument while others highlight similarities between Bitcoin and gold thus showing evidence on the usefulness of Bitcoin acting as an hedging instrument. Yet Bitcoin seems to attract more short term speculative investors rather than other ones that would use Bitcoin as an hedging instrument.
Once introduced, cryptocurrencies where of course heavily analyzed by technical analyst, and technical indicators where used by retail as well as institutional investors in order to forecast the future trends of bitcoin. I never really liked the idea of designing indicators that specifically worked for only one type of market and ever less on only one symbol. Yet the user @saraphig posted in Feb 20 an indicator called " Margin Call MovingAverage " who calculate liquidation price by using a volume weighted moving average. It took my attention and we decided to work together on a relatively more complete version that would include resistances levels.
I believe the proposed indicator might result useful to some users, the code also show a way to restrict the use of an indicator to only one symbol (line 9 to 16).
The Indicator
The indicator only work on BTCUSD, if you use another symbol you should see the following message:
The indicator plot 6 extremities, with 3 upper (resistance) extremities and 3 lower (support) extremities, each one based on the isolated margin mode liquidation price formula:
UPlp = MA/Leverage × (Leverage+1-(Leverage*0.005))
for upper extremities and:
DNlp = MA × Leverage/(Leverage+1-(Leverage*0.005))
for lower extremities.
Length control the period of the moving averages, with higher values of length increasing the probability of the price crossing an extremity. The Leverage's settings control how far away their associated extremities are from the price, with lower values of Leverage making the extremity farther away from the price, Leverage 3 control Up3 and Dn3, Leverage 2 control Up2 and Dn2, Leverage 1 control Up1 and Dn1, @saraphig recommend values for Leverage of either : 25, 20, 15, 10 ,5.
You can select 3 different types of moving average, the default moving average is the volume weighted moving average (VWMA), you can also choose a simple moving average (SMA) and the Kaufman adaptive moving average (KAMA).
Based on my understanding (which could be wrong) the original indicator aim to highlight points where margin calls might have occurred, hence the name of the indicator.
If you want a more "DSP" like description then i would say that each extremity represent a low-pass filter with a passband greater than 1 for upper extremities and lower than 1 for lower extremities, unlike bands indicators made by adding/subtracting a volatility indicator from another moving average this allow to conserve the original shape of the moving average, the downside of it being the inability to show properly on different scales.
here length = 200, on a 1h tf, each extremities are able to detect short-terms tops and bottoms. The extremity become wider when using lower time-frames.
You would then need to increase the Leverages settings, i recommend a time frame of 1h.
Conclusion
I'am not comfortable enough to make a conclusion, as i don't know the indicator that well, however i liked the original indicator posted by @saraphig and was curious about the idea behind it, studying the effect of margin calls on market liquidity as well as making indicators based on it might result a source of inspiration for other traders.
A big thanks to @saraphig who shared a lot of information about the original indicator and allowed me to post this one. I don't exclude working with him/her in the future, i invite you to follow him/her:
www.tradingview.com
Thx for reading and have a nice weekend! :3