Swing Oscillator [AstrideUnicorn]The Swing Oscillator is an indicator that can help you catch small price movements, called swings. Swings are minor trends that occur when price moves between the highs and lows of a trend or range. Because of the short-term nature of swings, a new movement should be identified as soon as possible.
The indicator is based on our original formula, which averages the length of candlestick bodies and compares the result to several thresholds. This allows the algorithm to determine the direction and strength of the price movement.
HOW TO USE
When the indicator is above the zero level and colored green, it means that the price is in an upward swing. When the indicator is below the zero level and colored red, the price is in a downward swing. When the indicator is blue, the price swing is slowing down or the market is moving sideways. The amplitude of the oscillator shows the price volatility.
M-oscillator
MA Cross ScreenerThis script lets you pick 20 symbols to check for ma crosses. The way it works is it scans all 20 of your symbols for moving average crosses and then it sends an both a regular alert and a visual alert inside of the indicator. I found that ma cross strategies are very popular right now so I thought it would be nice to have one indicator instead of 20 discord servers. The features include: 20 custom symbols, alerts, custom colors, ma select, and custom time frames. If you want to use the custom time frame option, use the lowest time frame possible. That way you wont have gaps. If you have any comments please voice them, that includes suggestions!
I hope you all find this useful!
QQE Student's T-Distribution Bollinger Bands Oscillator Credit to all of the developers on this project (aka all of the places I got the code from lol) @eylwithsteph @storma @Fractured @lejmer @AlexGrover @Montyjus @Jiehonglim @StephXAGs @peacefulLizard50262 @gorx1 @above-c-level
This script utilizes @above-c-level 's Student's T-Distribution script to give us a great estimation of volatility. I took this idea and apply it to the QQE filter! That being said I have added a boat load of features as to make this script as useful to as many people as possible. This is the Osc version
Included averages: 'TMA', 'ALMA', 'EMA', 'DEMA', 'TEMA', 'WMA', 'VWMA', 'SMA', 'SMMA', 'HMA', 'LSMA', 'JMA', 'VAMA', 'FRAMA', 'ZLEMA', 'KAMA', 'IDWMA', 'FLMSA', 'PEMA', 'HCF', 'TIF', 'MF', 'ARMA', 'DAF', 'WRMA', 'RMA', 'RAF', 'A2RMA', 'QQE 1', 'QQE 2','Centroid',"Harmonic Mean","Geometric Mean","Quadratic Mean","Median","Trimean","Midhinge","Midrange","VWAP"
Included Features: Smoothing, Additional Moving Average, Log Space, Mean Momentum via Derivative, Normalization, Convergence DIvergence, Candle View
Use this just like macd/rsi but instead this directly reflects the band version! It also shows really valid support and resistance. Use this in combination with the band version for more power.
QQE Student's T-Distribution Bollinger BandsCredit to all of the developers on this project (aka all of the places I got the code from lol) @eylwithsteph @storma @Fractured @lejmer @AlexGrover @Montyjus @Jiehonglim @StephXAGs @peacefulLizard50262 @gorx1 @above-c-level
This script utilizes @above-c-level 's Student's T-Distribution script to give us a great estimation of volatility. I took this idea and apply it to the QQE filter! That being said I have added a boat load of features as to make this script as useful to as many people as possible.
Included averages: 'TMA', 'ALMA', 'EMA', 'DEMA', 'TEMA', 'WMA', 'VWMA', 'SMA', 'SMMA', 'HMA', 'LSMA', 'JMA', 'VAMA', 'FRAMA', 'ZLEMA', 'KAMA', 'IDWMA', 'FLMSA', 'PEMA', 'HCF', 'TIF', 'MF', 'ARMA', 'DAF', 'WRMA', 'RMA', 'RAF', 'A2RMA', 'QQE 1', 'QQE 2','Centroid',"Harmonic Mean","Geometric Mean","Quadratic Mean","Median","Trimean","Midhinge","Midrange","VWAP"
Included Features: Smoothing, Additional Moving Average, Log Space, Mean Momentum via Derivative
Use this just like BB but instead (as long as you are on qqe) you get real prices that are stable! It also shows really valid support and resistance. Use this in combination with the osc version for more power.
Open Close TrendThis is a simple trend indicator that gives you a few options on how to view the data. The way this works is it takes the open, close, high and low and it smooths them with an exponential moving average. Next we smooth a bit with a simple moving average to clear up the data. Finally we normalize everything to the average high and low. With this you can compare the average closing price to the average opening price. If the closing price is greater than the opening price then it is in an up trend and visa versa. You can also find reversals by looking for divergences. I have included a few features in this script including: Normalization, 200ma centering, Background color divergence convergence, histogram to see convergence divergence, and custom colors. I hope you all enjoy this simple release! I know I had fun making this.
[MAD] Fibonacci retracementThis is just a Fibonacci Retracement tool with some interactive information based on the actual closing price
How to use:
add the script,
input left bottom with the 1st click,
input top with the 2nd click
Informations you can see than:
Fiblevel (Price) %till_this_point = pricedifference
additional:
Bottom of the fib
Range Up in % + Price-Range
Range Down in %
you can shift the comma with the decimal functions for trading shitcoins as example
if looking into the past, level/price will follow, liveinfo using the close is than hidden
what will follow:
reverse
log/linear
autogrow when range will be wicked
maybe alerts on levels... have to think about how to capture correctly
Multi-Indicator Divergence ScreenerHere is a new screener for everyone.
I have applied my Better Divergence On Any Indicator logic to scan 3 different indicators and up to 6 different assets at one time. Shoutout to LonesomeTheBlue and QuantNomad for their respective work on divergence and scanner scripts. I've implemented similar logic to put together this scanner.
So far, I have added support for RSI, OBV, MACD, MFI, Stochastic, and FSR, though I'm happy to add more by request. Please note, for simplicity, I have removed the logic to filter for only overbought/oversold divergences. Because this can scan both centered oscillators and non-centered indicators, overbought/oversold does not apply to all of them. I may try to find a way to work in back in later, as time allows.
Personally, I like to find confluences different types of indicators. For instance, agreeable divergence with a centered strength oscillator like RSI and a volume based indicator like OBV gives me more confidence that there will be follow-through.
Like in the Better Divergence script, you can opt to scan for confirmed divergences, potential divergences, or both.
You have the option to show or hide a table that will tell you exactly which assets have divergence, on which indicator they were found, and how many points of divergence were identified. By default, bull divergences will be green, bear will be red, but you can change these base colors to your liking. Confirmed divergences are shown with a solid background, while potentials (if selected) are shown with transparent background. If all 3 of your chosen indicators have divergence in the same direction, the asset name will show in the bull or bear color to highlight the confluence.
Alerts have also been set up to fire on bar close. The message will essentially tell you the same thing the table does, but in condensed format.
You can choose to have alerts fire any time there is any divergence detected across all assets, only when there are divergences on at least 2 of the chosen indicators for a given asset, or limit them to only when all 3 indicators show divergence in agreement.
Bull Bear Power VoidThere are a million oscillators out there based on volume. My biggest problem with them is that they simply tell you whether you have volume to the upside or volume to the down side. it's kind of tricks you with the lack of information into thinking you have a change in your trend or that you're going to be able to break out of a range across a moving average or through some trend line or support and resistance.
However many of these Oscillators are failing because they lacked to tell you one key thing. they tell you that you have volume but they never tell you if it's enough volume.
Even a popular indicator like the MACD can have its MACD Line crossing upwards over the signal, telling you that you have an uptrend but again it's still failing to give you the results of how much volume you have and is it enough volume in that crossover. It boils down to the one key fact that with out volume there is no momentum. This should be able to make trading crossovers a lot easier.
So in today's video I'm going to show you the newest addition to the trading View Community Scripts and it is called,
"The Bull Bear Void Volume Oscillator"
From my own testing, this oscillator can predict weather the next candle will get you the move you need or not.
In the markets you cannot have anything good without volume. after you have volume you have momentum. you cannot have momentum without volume and this is the key thing that causes people to fail when they look for breakouts, trend reversals, or if they're wondering whether this move is a fake out.
This indicator is based on the study volume spread analysis or VSA.
This indicator is designed to be paired perfectly with the Heiken Ashi Algo oscillator.
www.INSERTA-LINK-HERE.com
This indicator is strictly to be used as a confirmation indicator and not to be used by itself to tell you when to buy or sell.
what are its parts.
The void
is a bullish and bearish Cloud that appear extending from the center of words and the center down words. This is the average range of volume. anything that appears to close inside of this void is usually a ranging volume and it is not enough to break the trend or break out.
The MACD and MACD Signal Line
Just like using the macd these two lines indicate whether the trend is moving up for the trend is moving down
The Colored Columns
RED Column - Indicates volume movie downward
Light Red - indicates volume is pulling back from a downward move
Green - indicates volume is moving upwards
Light Green - indicates volume is moving down from an outboard move
Rules for a SELL CONFIRMATION TRADE
The macd line must be underneath the signal line and the macd line must be below the midline.
A bullish column must appear below the midline and it must extend outside of the red void.
if you are using the heikin-ashi Aldo oscillator you must also have a red heiken Ashi candle close below -10.
To do a by trade you simply reverse the rules.
SPX Fair Value Strategy UltimateThis is a strategy using the SPX Fair Value derived from Net Liquidity.
Net Liquidity function is simply: Fed Balance Sheet - Treasury General Account - Reverse Repo Balance
Formula for calculating the fair value of SPX using Net Liquidity looks like this: net_liquidity/1000000000/1.1 -1625
The SPX Fair Value is then subtracted from the SPX value which creates an oscillating diff value.
When diff is greater than 350, SPX is considered overbought and we go short/sell.
When diff is less than -150, SPX is considered oversold and we cover/buy.
The net liquidity values I calculate outside of TradingView. If you'd like the strategy to work for future dates, you'll need to update them.
Paremeters:
Strategy: Short Only, Long Only, Long/Short
Inverse (bool): check if using an inverse ETF to go long instead of short.
Start After Date: When the strategy should start trading
Close Date: Day to close open trades. I just like it to get complete results rather than the strategy ending with open trades.
Divergence BacktesterThere is n number of possible ways in which we can backtest divergence and this is just a start :)
In this script, we are trying to count how many times the pivots made HH, HL, LH, LL after a particular divergence state.
An example of using data is as below:
The script keeps track of each pivot sentiment and resulting next pivot state. As mentioned in the chart snapshot, we can look at two of the previous pivot states and collect stats on how each of these state impacted price action.
As mentioned before, this is just tip of iceberg. Further combinations for which we can do backtest are:
1. m X n combinations of last pivot and last to last pivot divergence state
2. divergence combined with double divergence state.
Only issue to explore further is lack of space on the chart as tables can take up huge space.
PS: As you can see based on historical stats, probability of divergence impacting the change of trend is very low in most cases.
Alpha ADX DI+/DI- V5 by MUNIF SHAIKHMODIFIED ADX DI+/DI- V5
Usage: To use this indicator for entry: when DMI+ crosses over DMI-, there is a bullish sentiment, however ADX also needs to be above 25 to be significant, otherwise the move is not necessarily sustainable.
Inversely, when DMI+ crosses under DMI- and ADX is above 25, then the sentiment is significantly bearish , but if ADX is below 20, the signal should be disregarded.
The line control represents, if the ADX is greater than the line of 25, the price trend is considered strong
FieryTrading: Buy The Dip - Sell The RipDear Tradingview community,
Today I want to share a very powerful, yet easy to use indicator with you. The indicator will find local tops or bottoms and will help you determine when it's a good time to trade a potential reversal.
How does it work?
The indicator makes use of the RSI to detect extremities and waits until the RSI reverses. Furthermore, a long-term moving average is used to determine whether we're in bullish or bearish market conditions. In bullish conditions the indicator will only go long, in bearish conditions the indicator will only go short.
How do I use it?
Favorite the indicator and apply it to your chart! You can add an alert to the indicator to receive a message once it has detected a good point for a reversal trade.
The indicator can be used on all assets and on all timeframes. Personally, I've found the 1 - 4 hourly timeframes to yield the best results.
Good luck!
Stochastic Vix Fix SVIX (Tartigradia)The Stochastic Vix or Stochastic VixFix (SVIX), just like the Williams VixFix, is a realized volatility indicator, and can help in finding market bottoms as well as tops without requiring bollinger bands or any other construct, as the SVIX is bounded between 0-100 which allows for an objective thresholding regardless of the past.
Mathematically, SVIX is the complement of the original Stochastic Oscillator, with such a simple transform reproducing Williams' VixFix and the VIX index signals of high volatility and hence of market bottoms quite accurately but within a bounded 0-100 range. Having a predefined range allows to find markets bottoms without needing to compare to past prices using a bollinger band (Chris Moody on TradingView) nor a moving average (Hesta 2015), as a simple threshold condition (by default above 80) is sufficient to reliably signal interesting entry points at bottoming prices.
Having a predefined range allows to find markets bottoms without needing to compare to past prices using a bollinger band (Chris Moody on TradingView) nor a moving average (Hesta 2015), as a simple threshold condition (by default above 80) is sufficient to reliably signal interesting entry points at bottoming prices.
Indeed, as Williams describes in his paper, markets tend to find the lowest prices during times of highest volatility, which usually accompany times of highest fear.
Although the VixFix originally only indicates market bottoms, the Stochastic VixFix can also indicate good times to exit, when SVIX is at a low value (default: below 20), but just like the original VixFix and VIX index, exit signals are as usual much less reliable than long entries signals, because: 1) mature markets such as SP500 tend to increase over the long term, 2) when market fall, retail traders panic and hence volatility skyrockets and bottom is more reliably signalled, but at market tops, no one is panicking, price action only loses momentum because of liquidity drying up.
Compared to Hesta 2015 strategy of using a moving average over Williams' VixFix to generate entry signals, SVIX generates much fewer false positives during ranging markets, which drastically reduce Hesta 2015 strategy profitability as this incurs quite a lot of losses.
This indicator goes further than the original SVIX, by restoring the smoothed D and second-level smoothed D2 oscillators from the original Stochastic Oscillator, and use a 14-period ZLMA instead of the original 20-period SMA, to generate smoother yet responsive signals compared to using just the raw SVIX (by default, this is disabled, as the original raw SVIX is used to produce more entry signals).
Usage:
Set the timescale to daily or weekly preferably, to reduce false positives.
When the background is highlighted in green or when the highlight disappears, it is usually a good time to enter a long position.
Red background highlighting can be enabled to signal good exit zones, but these generate a lot of false positives.
To further reduce false positives, the SVIX_MA can be used to generate signals instead of the raw SVIX.
For more information on Williams' Vix Fix, which is a strategy published under public domain:
The VIX Fix, Larry Williams, Active Trader magazine, December 2007, web.archive.org
Fixing the VIX: An Indicator to Beat Fear, Amber Hestla-Barnhart, Journal of Technical Analysis, March 13, 2015, ssrn.com
For more information on the Stochastic Vix Fix (SVIX), published under Creative Commons:
Replicating the CBOE VIX using a synthetic volatility index trading algorithm, Dayne Cary and Gary van Vuuren, Cogent Economics & Finance, Volume 7, 2019, Issue 1, doi.org
Note: strangely, in the paper, the authors failed to mention that the SVIX is the complement of the original Stochastic Oscillator, instead reproducing just the original equation. The correct equation for the SVIX was retroengineered by comparing charts they published in the paper with charts generated by this pinescript indicator.
For a more complete indicator, see:
[MAD] almost RSII continue to add things to the multibit ready indicators:
This is a modified RSI indicator with some useful additions to make it bottrading ready:
Centered around 0, so from +50 to -50.
Short-Triggerline
Long Triggerline
following value mods are possible:
POW factor --> rsi^POW
final smoothings:
SMA smoothing (level 1)
EMA smoothing (level 2)
switch all smoothings on/off
signals on:
Crossout (moves outside the high/low).
Crossin (moves back inside the high/low)
Direction change outside
Direction change inside
Signal filter output
This is a multibit capable indicator, so signal and filter can be exported to a multibit capable daisychain.
More information can be found here:
have fun
HMA Slope OscillatorA Hull Moving Average (HMA) slope oscillator. It uses a HMA slope to identify up/down trends. Usage is simple: adjust the HMA and signal length according to your needs. Long orders start when the bar changes from under (the zero line) to over the zero line. You can also spot "early" long entries when the bar moves close to the zero line. Short orders should be placed when a red bar appears after blue bars (top of the mountain).
"Play" with the length to find the best settings for your trading strategy.
** I have not added alerts. If you need alerts just let me know and I will be happy to update this indicator.
Fisherized CCIIntroduction
This here is a non-repainting indicator where I use inverse Fisher transformation and smoothing on the well-known CCI (Commdity Channel Index) momentum indicator.
"The Inverse Fisher Transform" describes the calculation and use of the inverse Fisher transform by Dr . Ehlers in 2004. The transform is applied to any indicator with a known probability distribution function. It enables to transform an indicator signal into the range between +1 and -1. This can help to eliminate the noise of an indicator.
The CCI is an momentum indicator which describes the distance of the price to the average price.
For smoothing I used the Hann Window and NET (Noise Elimination Technique) methods.
Additional Features
Divergence Analysis
Trend-adaptive Histogram
Timeframe selection
Usage
It is usually used to spot potential trend reverals or mean-reversion (against the trend) trades on lower timeframes. IMO it can be even used to spot trend-following trades. It always depends on which settings you have, which timeframe do you use and which indicators you combine with it.
The suggested timeframe for this indicator is 15 min (with the length setting on 50).
The histogram with adaptive mode enabled could be used as filter applied on the buy and sell signals.
The divergence analysis can help to spot additional entries/exits or confirm the buy and sell signals.
Always try to find the best settings! This indicators has a lot of customization options you should take advantage of.
Signals
The indicator uses the following logic to generate the buy and sell signals:
Normal
Buy -> When CCI and MA go above the top band (usually +100) and cross
Sell -> When CCI and MA go below the the bottom band (usually -100) and cross
Fisherized
Buy -> When CCI and MA go above the the zero line and cross
Sell -> When CCI and MA go below the the zero line and cross
Have fun with the indicator! I am open for feedback and questions. :)
Mega Pendulum IndicatorThe MPI (Mega Pendulum Indicator) is a fusion between the Pendulum Indicator and the Swing Indicator and is used with specific trading rules.
The MPI is a semi-bounded oscillator comprised of two lines. The first bounded line is the Pendulum Indicator which oscillates between 0 and 100 but generally oscillates between 20 and 80. The second semi-bounded line is the Swing Indicator which generally oscillates between -10 and 10.
The conditions for trading the Mega Pendulum Indicator are as follows:
* Buy: Whenever the Pendulum indicator crosses over its signal line (a 5-period moving average) and at the same time, the Swing Indicator must cross over -10 after having been below it.
* Sell: Whenever the Pendulum indicator crosses below its signal line (a 5-period moving average) and at the same time, the Swing Indicator must cross under -10 after having been above it.
Qube [AstrideUnicorn]Qube is an indicator that shows market regimes. It is able to detect medium and long term trends and ranging markets. If the indicator bars are colored blue and are between the two blue lines, it means that the market is in sideways movement or consolidation. If indicator bars cross the upper boundary and are colored green, it means that the market is in an uptrend. Red bars crossing the lower blue line indicate a downward trend. The red or green columns are further referred as signal bars.
The indicator is based on the normalized momentum oscillator raised to the third power. This is done to increase the sensitivity of the indicator and to emphasize the difference between the market modes.
The indicator can be used in different ways. One of them is determining the trend direction based on the last signal bar. Even if the current indicator bar is blue (showing range or consolidation), the user should consider the longer-term market mode as upward if the last signal bar is green. And vice versa, if the last signal bar is red, the current market bias is downward. One other way to use the indicator is to catch active price impulses, when columns of the same color (red or green) appear consecutively.
SpreadTrade - Auto-Cointegration (ps5)Decsription: Auto-Cointegration-Based Pair Trading Strategy (revised version)
To review, there are three popular styles of Pair trading: distance-based pair trading, correlation-based pair trading and cointegration-based pair trading. Typically, they require preliminary statistical estimation of the viability of the corresponding strategy.
Basically a pair trade strategy boils down to shorting the outperforming instrument and going long on the underperforming instrument whenever the temporary correlation weakens which means one instrument is going up and another is going down. Apart from the typical cointegration strategy which employs two cointegrated instruments, this script uses just one instrument, in base timeframe and in lagged timeframe, actually making it an auto-cointegration, or better still, an auto-correlation strategy.
Notice that each moving average function may require different Threshold settings.The orange cross symbol indicates the exit points. To filter out the signals use higher values for the LongWindow and the Threshold parameters. Also pay attention that in some cases with some moving averages the color of the signals has to be inverted.
Chef MomentumChef momentum is a simple stochastic indicator that uses the hull moving average (hma). The oscillator can be used like most oscillators available.
Default setting:
%K length: 25
%K smoothing: 100
The user can adapt the parameters to study other values.
how to use :
When the length of the stoch K crossover hline 25 , a green circle appears which indicates the potential arrival of momentum.
When the length of the stock K crossover hline 80 , a red circle appears indicating the potential end of the momentum.
deviation from fixed-timeframe-maIt is like an improved version of the deviation rate from the R-type (Radioyazi) moving average line used in stocks.
5RMA deviation rate is red and 25RMA deviation rate is blue. RMA is the average of the opening, high, low and closing prices. You can change it to SMA or close price in the settings.
Pink is (5RMA+25RMA)/2.
Each line is a band, the upper end is the high price, the lower end is the low price, and the middle line is the closing price. If you don't need the high/low price band, you can turn it off in the settings.
The gray line is the difference between the red 5RMA deviation rate and the blue 25RMA deviation rate.
It draws the results on the daily chart even on the intraday chart.
株で使われるR式(RadiOyazi)移動平均線からの乖離率の改良版のようなものです。
5RMA乖離率が赤で、25RMA乖離率が青です。RMAは、始値、高値、安値、終値の平均です。設定でSMAにも終値にも変更できます。
ピンクが(5RMA+25RMA)/2です。
各線が帯になってますが、上端が高値、下端が安値、中の線が終値です。高値・安値の帯が要らなければ、設定で消せます。
グレーの線は、赤の5RMA乖離率と青の25RMA乖離率の差です。
日中足でも日足での結果を描画します。
Relatively Good Adviser This indicator uses the RSI as the backbone of an extremely sensitive two-indicator trend following system.
This indicator is unique in that it uses the RSI as an anchor to attempt to solve for color where there is divergence nearby.
Oscillator Workbench — Chart [LucF]█ OVERVIEW
This indicator uses an on-chart visual framework to help traders with the interpretation of any oscillator's behavior. The advantage of using this tool is that you do not need to know all the ins and outs of a particular oscillator such as RSI, CCI, Stochastic, etc. Your choice of oscillator and settings in this indicator will change its visuals, which allows you to evaluate different configurations in the context of how the workbench models oscillator behavior. My hope is that by using the workbench, you may come up with an oscillator selection and settings that produce visual cues you find useful in your trading.
The workbench works on any symbol and timeframe. It uses the same presentation engine as my Delta Volume Channels indicator; those already familiar with it will feel right at home here.
█ CONCEPTS
Oscillators
An oscillator is any signal that moves up and down a centerline. The centerline value is often zero or 50. Because the range of oscillator values is different than that of the symbol prices we look at on our charts, it is usually impossible to display an oscillator on the chart, so we typically put oscillators in a separate pane where they live in their own space. Each oscillator has its own profile and properties that dictate its behavior and interpretation. Oscillators can be bounded , meaning their values oscillate between fixed values such as 0 to 100 or +1 to -1, or unbounded when their maximum and minimum values are undefined.
Oscillator weight
How do you display an oscillator's value on a chart showing prices when both values are not on the same scale? The method I use here converts the oscillator's value into a percentage that is used to weigh a reference line. The weight of the oscillator is calculated by maintaining its highest and lowest value above and below its centerline since the beginning of the chart's history. The oscillator's relative position in either of those spaces is then converted to a percentage, yielding a positive or negative value depending on whether the oscillator is above or below its centerline. This method works equally well with bounded and unbounded oscillators.
Oscillator Channel
The oscillator channel is the space between two moving averages: the reference line and a weighted version of that line. The reference line is a moving average of a type, source and length which you select. The weighted line uses the same settings, but it averages the oscillator-weighted price source.
The weight applied to the source of the reference line can also include the relative size of the bar's volume in relation to previous bars. The effect of this is that the oscillator's weight on bars with higher total volume will carry greater weight than those with lesser volume.
The oscillator channel can be in one of four states, each having its corresponding color:
• Bull (teal): The weighted line is above the reference line.
• Strong bull (lime): The bull condition is fulfilled and the bar's close is above the reference line and both the reference and the weighted lines are rising.
• Bear (maroon): The weighted line is below the reference line.
• Strong bear (pink): The bear condition is fulfilled and the bar's close is below the reference line and both the reference and the weighted lines are falling.
Divergences
In the context of this indicator, a divergence is any bar where the slope of the reference line does not match that of the weighted line. No directional bias is assigned to divergences when they occur. You can also choose to define divergences as differences in polarity between the oscillator's slope and the polarity of close-to-close values. This indicator's divergences are designed to identify transition levels. They have no polarity; their bullish/bearish bias is determined by the behavior of price relative to the divergence channel after the divergence channel is built.
Divergence Channel
The divergence channel is the space between two levels (by default, the bar's low and high ) saved when divergences occur. When price has breached a channel and a new divergence occurs, a new channel is created. Until that new channel is breached, bars where additional divergences occur will expand the channel's levels if the bar's price points are outside the channel.
Price breaches of the divergence channel will change its state. Divergence channels can be in one of five different states:
• Bull (teal): Price has breached the channel to the upside.
• Strong bull (lime): The bull condition is fulfilled and the oscillator channel is in the strong bull state.
• Bear (maroon): Price has breached the channel to the downside.
• Strong bear (pink): The bear condition is fulfilled and the oscillator channel is in the strong bear state.
• Neutral (gray): The channel has not been breached.
█ HOW TO USE THE INDICATOR
Load the indicator on an active chart (see here if you don't know how).
The default configuration displays:
• The Divergence channel's levels.
• Bar colors using the state of the oscillator channel.
The default settings use:
• RSI as the oscillator, using the close source and a length of 20 bars.
• An Arnaud-Legoux moving average on the close and a length of 20 bars as the reference line.
• The weighted version of the reference line uses only the oscillator's weight, i.e., without the relative volume's weight.
The weighted line is capped to three standard deviations of the reference.
• The divergence channel's levels are determined using the high and low of the bars where divergences occur.
Breaches of the channel require a bar's low to move above the top of the channel, and the bar's high to move below the channel's bottom.
No markers appear on the chart; if you want to create alerts from this script, you will need first to define the conditions that will trigger the markers, then create the alert, which will trigger on those same conditions.
To learn more about how to use this indicator, you must understand the concepts it uses and the information it displays, which requires reading this description. There are no videos to explain it.
█ FEATURES
The script's inputs are divided in five sections: "Oscillator", "Oscillator channel", "Divergence channel", "Bar Coloring" and "Marker/Alert Conditions".
Oscillator
This is where you configure the oscillator you want to study. Thirty oscillators are available to choose from, but you can also use an oscillator from another indicator that is on your chart, if you want. When you select an external indicator's plot as the oscillator, you must also specify the value of its centerline.
Oscillator Channel
Here, you control the visibility and colors of the reference line, its weighted version, and the oscillator channel between them.
You also specify what type of moving average you want to use as a reference line, its source and its length. This acts as the oscillator channel's baseline. The weighted line is also a moving average of the same type and length as the reference line, except that it will be calculated from the weighted version of the source used in the reference line. By default, the weighted line is capped to three standard deviations of the reference line. You can change that value, and also elect to cap using a multiple of ATR instead. The cap provides a mechanism to control how far the weighted line swings from the reference line. This section is also where you can enable the relative volume component of the weight.
Divergence Channel
This is where you control the appearance of the divergence channel and the key price values used in determining the channel's levels and breaching conditions. These choices have an impact on the behavior of the channel. More generous level prices like the default low and high selection will produce more conservative channels, as will the default choice for breach prices.
In this section, you can also enable a mode where an attempt is made to estimate the channel's bias before price breaches the channel. When it is enabled, successive increases/decreases of the channel's top and bottom levels are counted as new divergences occur. When one count is greater than the other, a bull/bear bias is inferred from it. You can also change the detection mode of divergences, and choose to display a mark above or below bars where divergences occur.
Bar Coloring
You specify here:
• The method used to color chart bars, if you choose to do so.
• If you want to hollow out the bodies of bars where volume has not increased since the last bar.
Marker/Alert Conditions
Here, you specify the conditions that will trigger up or down markers. The trigger conditions can include a combination of state transitions of the oscillator and the divergence channels. The triggering conditions can be filtered using a variety of conditions.
Configuring the marker conditions is necessary before creating an alert from this script, as the alert will use the marker conditions to trigger.
Realtime values will repaint, as is usually the case with oscillators, but markers only appear on bar closes, so they will not repaint. Keep in mind, when looking at markers on historical bars, that they are positioned on the bar when it closes — NOT when it opens.
Raw values
The raw values calculated by this script can be inspected using the Data Window, including the oscillator's value and the weights.
█ INTERPRETATION
Except when mentioned otherwise, this section's charts use the indicator's default settings, with different visual components turned on or off.
The aim of the oscillator channel is to provide a visual representation of an oscillator's general behavior. The simplest characteristic of the channel is its bull/bear state, determined by whether the weighted line is above or below the reference line. One can then distinguish between its bull and strong bull states, as transitions from strong bull to bull states will generally happen when trends are losing steam. While one should not infer a reversal from such transitions, they can be a good place to tighten stops. Only time will tell if a reversal will occur. One or more divergences will often occur before reversals. This shows the oscillator channel, with the reference line and the thicker, weighted line:
The nature of the divergence channel 's design makes it particularly adept at identifying consolidation areas if its settings are kept on the conservative side. The divergence channel will also reveal transition areas. A gray divergence channel should usually be considered a no-trade zone. More adventurous traders can use the oscillator channel to orient their trade entries if they accept the risk of trading in a neutral divergence channel, which by definition will not have been breached by price. This show only the divergence channels:
This chart shows divergence channels and their levels, and colors bars on divergences and on the state of the oscillator channel, which is not visible on the chart:
If your charts are already busy with other stuff you want to hold on to, you could consider using only the chart bar coloring component of this indicator. Here we only color bars using the combined state of the oscillator and divergence channel, and we do not color the bodies of bars where volume has not increased. Note that my chart's settings do not color the candle bodies:
At its simplest, one way to use this indicator would be to look for overlaps of the strong bull/bear colors in both the oscillator channel and a divergence channel, as these identify points where price is breaching the divergence channel when the oscillator's state is consistent with the direction of the breach.
Tip
One way to use the Workbench is to combine it with my Delta Volume Channels indicator. If both indicators use the same MA as a reference line, you can display its delta volume channel instead of the oscillator channel.
This chart shows such a setup. The Workbench displays its divergence levels, the weighted reference line using the default RSI oscillator, and colors bars on divergences. The DV Channels indicator only displays its delta volume channel, which uses the same MA as the workbench for its baseline. This way you can ascertain the volume delta situation in contrast with the visuals of the Workbench:
█ LIMITATIONS
• For some of the oscillators, assumptions are made concerning their different parameters when they are more complex than just a source and length.
See the `oscCalc()` function in this indicator's code for all the details, and ask me in a comment if you can't find the information you need.
• When an oscillator using volume is selected and no volume information is available for the chart's symbol, an error will occur.
• The method I use to convert an oscillator's value into a percentage is fragile in the early history of datasets
because of the nascent expression of the oscillator's range during those early bars.
█ NOTES
Working with this workbench
This indicator is called a workbench for a reason; it is designed for traders interested in exploring its behavior with different oscillators and settings, in the hope they can come up with a setup that suits their trading methodology. I cannot tell you which setup is the best because its setup should be compatible with your trading methodology, which may require faster or slower transitions, thus different configurations of the settings affecting the calculations of the divergence channels.
For Pine Script™ Coders
• This script uses the new overload of the fill() function which now makes it possible to do vertical gradients in Pine. I use it for both channels displayed by this script.
• I use the new arguments for plot() 's `display` parameter to control where the script plots some of its values,
namely those I only want to appear in the script's status line and in the Data Window.
• I used my ta library for some of the oscillator calculations and helper functions.
• I also used TradingView's ta library for other oscillator calculations.
• I wrote my script using the revised recommendations in the Style Guide from the Pine v5 User Manual.