Divergence Toolkit (Real-Time)The Divergence Toolkit is designed to automatically detect divergences between the price of an underlying asset and any other @TradingView built-in or community-built indicator or script. This algorithm provides a comprehensive solution for identifying both regular and hidden divergences, empowering traders with valuable insights into potential trend reversals.
🔲 Methodology
Divergences occur when there is a disagreement between the price action of an asset and the corresponding indicator. Let's review the conditions for regular and hidden divergences.
Regular divergences indicate a potential reversal in the current trend.
Regular Bullish Divergence
Price Action - Forms a lower low.
Indicator - Forms a higher low.
Interpretation - Suggests that while the price is making new lows, the indicator is showing increasing strength, signaling a potential upward reversal.
Regular Bearish Divergence
Price Action - Forms a higher high.
Indicator - Forms a lower high.
Interpretation - Indicates that despite the price making new highs, the indicator is weakening, hinting at a potential downward reversal.
Hidden divergences indicate a potential continuation of the existing trend.
Hidden Bullish Divergence
Price Action - Forms a higher low.
Indicator - Forms a lower low.
Interpretation - Suggests that even though the price is retracing, the indicator shows increasing strength, indicating a potential continuation of the upward trend.
Hidden Bearish Divergence
Price Action - Forms a lower high.
Indicator - Forms a higher high.
Interpretation - Indicates that despite a retracement in price, the indicator is still strong, signaling a potential continuation of the downward trend.
In both regular and hidden divergences, the key is to observe the relationship between the price action and the indicator. Divergences can provide valuable insights into potential trend reversals or continuations.
The methodology employed in this script involves the detection of divergences through conditional price levels rather than relying on detected pivots. Traditionally, divergences are created by identifying pivots in both the underlying asset and the oscillator. However, this script employs a trailing stop on the oscillator to detect potential swings, providing a real-time approach to identifying divergences, you may find more info about it here (SuperTrend Toolkit) . We detect swings or pivots simply by testing for crosses between the indicator and its trailing stop.
type oscillator
float o = Oscillator Value
float s = Trailing Stop Value
oscillator osc = oscillator.new()
bool l = ta.crossunder(osc.o, osc.s) => Utilized as a formed high
bool h = ta.crossover (osc.o, osc.s) => Utilized as a formed low
// Note: these conditions alone could cause repainting when they are met but canceled at a later time before the bar closes. Hence, we wait for a confirmed bar.
// The script also includes the option to immediately alert when the conditions are met, if you choose so.
By testing for conditional price levels, the script achieves similar outcomes without the delays associated with pivot-based methods.
type bar
float o = open
float h = high
float l = low
float c = close
bar b = bar.new()
bool hi = b.h < b.h => A higher price level has been created
bool lo = b.l > b.l => A lower price level has been created
// Note: These conditions do not check for certain price swings hence they may seldom result in inaccurate detection.
🔲 Setup Guide
A simple example on one of my public scripts, Standardized MACD
🔲 Utility
We may auto-detect divergences to spot trend reversals & continuations.
🔲 Settings
Source - Choose an oscillator source of which to base the Toolkit on.
Zeroing - The Mid-Line value of the oscillator, for example RSI & MFI use 50.
Sensitivity - Calibrates the sensitivity of which Divergencies are detected, higher values result in more detections but less accuracy.
Lifetime - Maximum timespan to detect a Divergence.
Repaint - Switched on, the script will trigger Divergencies as they happen in Real-Time, could cause repainting when the conditions are met but canceled at a later time before bar closes.
🔲 Alerts
Bearish Divergence
Bullish Divergence
Bearish Hidden Divergence
Bullish Hidden Divergence
As well as the option to trigger 'any alert' call.
The Divergence Toolkit provides traders with a dynamic tool for spotting potential trend reversals and continuations. Its innovative approach to real-time divergence detection enhances the timeliness of identifying market opportunities.
Realtime
Volume Tick ExperimentThis ticks-based indicator provides real-time volume information for a trading asset. Volume is analyzed and updated continuously, not just at candle close. It is based on DGT's Bull vs Bear Power indicator but adds a gas signal that activates when buying or selling volume percentage reaches a predetermined threshold.
This indicator can also help traders determine the direction and aggressiveness of pushes in buying or selling volume. By monitoring the volume percentages and gas signals, traders can get an idea of whether the market is pushing in a particular direction and how strong the push is. This information can be helpful in making trading decisions and identifying potential entry or exit points.
The indicator uses open, high, low, and close prices of the asset to calculate volume information. It determines the average volume over a selected period and calculates volume for both buying and selling. This information is used to calculate the percentage of buying and selling volume. A gas signal is triggered when either the buying or selling percentage reaches a predetermined threshold.
Enjoy!
Tick based chart [DotH]Version 1.0 - 2nd January 2023
Hi All,
This is my first published indicator, although I have written several hundreds for private use.
Description
Tick based chart
I got intrigued while reading about tick based charts on this page (please note this link/website owner is not affiliated with me) , so I decided to see if it would be possible to recreate this type of chart in TradingView, and here's the results.
This is an implementation for displaying a tick based chart in Trading View. There are benefits to using ticks based candles, as each candle represents the same number of "price moves" rather than an unknown number of moves.
Tick based charts are charts with candles that are rendered in the same way as traditional candles. However, instead of rendering a new candle at a specific time period,tick based candles are rendered after a set number of ticks have occured. For example, in a 50 tick chart, each candle that you see represents exactly 50 ticks, i.e. 50 price changes/moves. Having a view of what happens on the tick level, may help some traders evaluate what is happening within very large candles, or even detect a change in trend, volatility or some other metric which otherwise may not be visible using a standard chart.
Please note that this indicator DOES NOT match/synchronize timewise with the main chart in TradingView. You must view it independently. If you need to see what times are represented in the tick chart, you can look at the custom time labels and X-Axis grid lines in it to get an idea what parts of the tick based chart correspond to the main chart.
Limitations/known issues:
Currently the indicator has been restricted to 100 candles. This is for limiting the line and box usage to a max of 300 objects.
On timeframes above 1 minute, the seconds values will always be 0. In order to be able to see seconds values in the chart scale you need to be on a second level chart, which requires a premium TradingView subscription.
Changing the parameters in the settings will cause the chart to empty and start redrawing from its first candle again. This is because the tick chart is being drawn from realtime data, unlike the standard TradingView charts.
TODOs & Bugs:
Add some moving average indicators (SMA, EMA as a minimum)
Add a corresponding tick based volume chart
Create RSI, MACD, BB variations of this indicator
If you have any ideas/suggestions or bug reports, please feel free to let me know, however keep in mind that I do not have too much spare time to add things, so updates are going to be sporadic.
ABOUT CODE REUSE:
The code is free to use/change. However, if you plan to use this code to make a derivative indicator or strategy, it would be nice to know, so let me know if you feel like it!
MTF CCI + Realtime DivergencesMulti-timeframe Commodity Channel Index (CCI) + Realtime Divergences + Alerts
This version of the CCI includes the following features:
- Optional 2x sets of triple-timeframe overbought and oversold signals with fully configurable timeframes and overbought and oversold thresholds, can indicate where 3 selected timeframes are all overbought or all oversold at the same time, with alert option.
- Optional divergence lines drawn directly onto the oscillator in realtime, with alert options.
- Configurable pivot periods to fine tune the divergences drawn in order to suit different trading styles and timeframes, including the ability to enable automatic adjustment of pivot period per chart timeframe.
- Alternate timeframe feature allows you to configure the oscillator to use data from a different timeframe than the chart it is loaded on.
- 'Hide oscillator' feature allows traders to hide the oscillator itself, leaving only the background colours indicating the overbought and oversold periods and/or MTF overbought and oversold confluences, as seen in the chart image.
- Also includes standard configurable CCI options, including CCI length and source type. Defaults set to length 20, and hlc3 source type.
- Optional Flip oscillator feature, allows users to flip the oscillator upside down, for use with Tradingviews 'Flip chart' feature (Alt+i), for the purpose of manually spotting divergences, where the trader has a strong natural bias in one direction, so that they can flip both the chart and the oscillator.
- Optional 'Fade oscillator' feature, which will fade out all but the most recent period, reducing visual noise on the chart.
While this version of the CCI has the ability to draw divergences in realtime along with related alerts so you can be notified as divergences occur without spending all day watching the charts, the main purpose of this indicator was to provide the triple-timeframe overbought and oversold confluence signals, in an attempt to add more confluence, weight and reliability to the single timeframe overbought and oversold states, commonly used for trade entry confluence. It's primary purpose is intended for scalping reversal trades on lower timeframes, typically between 1-15 minutes, which can be used in conjunction with the regular divergences the indicator can highlight. The triple timeframe overbought can often indicate near term reversals to the downside, with the triple timeframe oversold often indicating neartime reversals to the upside. The default timeframes for this confluence are set to check the 1m, 5m and 15m timeframes together, ideal for scalping the < 15 minute charts. The default settings for the MTF #1 timeframes (1m, 5m and 15m) are best used on a <5 minute chart.
Its design and use case is based upon the original MTF Stoch RSI + Realtime Divergences found here .
Commodity Channel Index (CCI)
Investopedia has described the popular oscillator as follows:
“The Commodity Channel Index (CCI) is a momentum-based oscillator used to help determine when an investment vehicle is reaching a condition of being overbought or oversold.
Developed by Donald Lambert, this technical indicator assesses price trend direction and strength, allowing traders to determine if they want to enter or exit a trade, refrain from taking a trade, or add to an existing position. In this way, the indicator can be used to provide trade signals when it acts in a certain way.”
You can read more about the CCI, its use cases and calculations here .
How do traders use overbought and oversold levels in their trading?
The oversold level, that is traditionally when the CCI is above the 100 level is typically interpreted as being 'overbought', and below the -100 level is typically considered 'oversold'. Traders will often use the CCI at an overbought level as a confluence for entry into a short position, and the CCI at an oversold level as a confluence for an entry into a long position. These levels do not mean that price will necessarily reverse at those levels in a reliable way, however. This is why this version of the CCI employs the triple timeframe overbought and oversold confluence, in an attempt to add a more confluence and reliability to this usage of the CCI. While traditionally, the overbought and oversold levels are below -100 for oversold, and above 100 for overbought, he default threshold settings of this indicator have been increased to provide fewer, stronger signals, especially suited to the low timeframes and highly volatile assets.
What are divergences?
Divergence is when the price of an asset is moving in the opposite direction of a technical indicator, such as an oscillator, or is moving contrary to other data. Divergence warns that the current price trend may be weakening, and in some cases may lead to the price changing direction.
There are 4 main types of divergence, which are split into 2 categories;
regular divergences and hidden divergences. Regular divergences indicate possible trend reversals, and hidden divergences indicate possible trend continuation.
Regular bullish divergence: An indication of a potential trend reversal, from the current downtrend, to an uptrend.
Regular bearish divergence: An indication of a potential trend reversal, from the current uptrend, to a downtrend.
Hidden bullish divergence: An indication of a potential uptrend continuation.
Hidden bearish divergence: An indication of a potential downtrend continuation.
How do traders use divergences in their trading?
A divergence is considered a leading indicator in technical analysis , meaning it has the ability to indicate a potential price move in the short term future.
Hidden bullish and hidden bearish divergences, which indicate a potential continuation of the current trend are sometimes considered a good place for traders to begin, since trend continuation occurs more frequently than reversals, or trend changes.
When trading regular bullish divergences and regular bearish divergences, which are indications of a trend reversal, the probability of it doing so may increase when these occur at a strong support or resistance level . A common mistake new traders make is to get into a regular divergence trade too early, assuming it will immediately reverse, but these can continue to form for some time before the trend eventually changes, by using forms of support or resistance as an added confluence, such as when price reaches a moving average, the success rate when trading these patterns may increase.
Typically, traders will manually draw lines across the swing highs and swing lows of both the price chart and the oscillator to see whether they appear to present a divergence, this indicator will draw them for you, quickly and clearly, and can notify you when they occur.
Setting alerts.
With this indicator you can set alerts to notify you when any/all of the above types of divergences occur, on any chart timeframe you choose, and also when the triple timeframe overbought and oversold confluences occur.
Configurable pivot period.
You can adjust the default pivot period values to suit your prefered trading style and timeframe. If you like to trade a shorter time frame, lowering the default lookback values will make the divergences drawn more sensitive to short term price action. By default, this indicator has enabled the automatic adjustment of the pivot periods for 4 configurable timeframes, in a bid to optimise the divergences drawn when the indicator is loaded onto any of the 4 timeframes. These timeframes and the auto adjusted pivot periods on each of them can also be reconfigured within the settings menu.
Disclaimer: This script includes code adapted from the Divergence for Many Indicators v4 by LonesomeTheBlue . With special thanks.
Divergence for Many Panel (D4MP+)Divergence for Many Panel (D4MP+)
This Divergence for Many Panel indicator is built upon the realtme divergence drawing code originally authored by LonesomeTheBlue, now in the form of a panel indicator.
The available oscillators, hand picked for their ability to identify high quality divergences currently include:
- Ultimate Oscillator (UO)
- True Strength Index (TSI)
- Money Flow Index (MFI)
- Relative Strength Index (RSI)
- Stochastic RSI
- Time Segmented Volume (TSV)
- Cumulative Delta Volume (CDV)
Note : this list of available oscillators may be added to or altered at a later date.
The indicator includes the following features:
- Ability to select any of the above oscillators
- Optional divergence lines drawn directly onto the oscillator in realtime .
- Configurable alerts to notify you when divergences occur.
- Configurable pivot lookback periods to fine tune the divergences drawn in order to suit different trading styles and timeframes, including the ability to enable automatic adjustment of pivot period per chart timeframe.
- Background colouring option to indicate when the selected oscillator has crossed above or below its centerline.
- Alternate timeframe feature allows you to configure the oscillator to use data from a different timeframe than the chart it is loaded on.
- Oscillator name label, so you can clearly see which oscillator is selected, in the case you have multiple loaded onto a chart.
- Optional adjustable range bands.
- Automatic adjustment of line colours, centerlines and range band levels on a per oscillator basis by default.
- Ability to customise the colours of each of the oscillators.
What is the Ultimate Oscillator ( UO )?
“The Ultimate Oscillator indicator (UO) indicator is a technical analysis tool used to measure momentum across three varying timeframes. The problem with many momentum oscillators is that after a rapid advance or decline in price, they can form false divergence trading signals. For example, after a rapid rise in price, a bearish divergence signal may present itself, however price continues to rise. The ultimate Oscillator attempts to correct this by using multiple timeframes in its calculation as opposed to just one timeframe which is what is used in most other momentum oscillators.”
What is the True Strength Index ( TSI )?
"The true strength index (TSI) is a technical momentum oscillator used to identify trends and reversals. The indicator may be useful for determining overbought and oversold conditions, indicating potential trend direction changes via centerline or signal line crossovers, and warning of trend weakness through divergence."
What is the Money Flow Index ( MFI )?
“The Money Flow Index ( MFI ) is a technical oscillator that uses price and volume data for identifying overbought or oversold signals in an asset. It can also be used to spot divergences which warn of a trend change in price. The oscillator moves between 0 and 100. Unlike conventional oscillators such as the Relative Strength Index ( RSI ), the Money Flow Index incorporates both price and volume data, as opposed to just price. For this reason, some analysts call MFI the volume-weighted RSI .”
What is the Relative Strength Index ( RSI )?
"The relative strength index (RSI) is a momentum indicator used in technical analysis. RSI measures the speed and magnitude of a security's recent price changes to evaluate overvalued or undervalued conditions in the price of that security. The RSI can do more than point to overbought and oversold securities. It can also indicate securities that may be primed for a trend reversal or corrective pullback in price. It can signal when to buy and sell. Traditionally, an RSI reading of 70 or above indicates an overbought situation. A reading of 30 or below indicates an oversold condition. It is also commonly used to identify divergences."
What is the Stochastic RSI (StochRSI)?
"The Stochastic RSI (StochRSI) is an indicator used in technical analysis that ranges between zero and one (or zero and 100 on some charting platforms) and is created by applying the Stochastic oscillator formula to a set of relative strength index (RSI) values rather than to standard price data. Using RSI values within the Stochastic formula gives traders an idea of whether the current RSI value is overbought or oversold. The StochRSI oscillator was developed to take advantage of both momentum indicators in order to create a more sensitive indicator that is attuned to a specific security's historical performance rather than a generalized analysis of price change."
What Is Time Segmented Volume?
"Time segmented volume (TSV) is a technical analysis indicator developed by Worden Brothers Inc. that segments a stock's price and volume according to specific time intervals. The price and volume data is then compared to uncover periods of accumulation (buying) and distribution (selling)."
What is Cumulative Volume Delta ( CDV )?
"The CDV analyses the net buying at market price and net selling at market price. This means, that volume delta is measuring whether it is the buyers or sellers that are more aggressive in taking the current market price. It measures the degree of intent by buyers and sellers, which can be used to indicate who is more dominant. The CDV can be used to help identify possible trends and also divergences"
What are divergences?
Divergence is when the price of an asset is moving in the opposite direction of a technical indicator, such as an oscillator, or is moving contrary to other data. Divergence warns that the current price trend may be weakening, and in some cases may lead to the price changing direction.
There are 4 main types of divergence, which are split into 2 categories;
regular divergences and hidden divergences. Regular divergences indicate possible trend reversals, and hidden divergences indicate possible trend continuation.
Regular bullish divergence: An indication of a potential trend reversal, from the current downtrend, to an uptrend.
Regular bearish divergence: An indication of a potential trend reversal, from the current uptrend, to a downtrend.
Hidden bullish divergence: An indication of a potential uptrend continuation.
Hidden bearish divergence: An indication of a potential downtrend continuation.
Setting alerts.
With this indicator you can set alerts to notify you when any/all of the above types of divergences occur, on any chart timeframe you choose.
Configurable pivot periods.
You can adjust the default pivot periods to suit your prefered trading style and timeframe. If you like to trade a shorter time frame, lowering the default lookback values will make the divergences drawn more sensitive to short term price action.
How do traders use divergences in their trading?
A divergence is considered a leading indicator in technical analysis , meaning it has the ability to indicate a potential price move in the short term future.
Hidden bullish and hidden bearish divergences, which indicate a potential continuation of the current trend are sometimes considered a good place for traders to begin, since trend continuation occurs more frequently than reversals, or trend changes.
When trading regular bullish divergences and regular bearish divergences, which are indications of a trend reversal, the probability of it doing so may increase when these occur at a strong support or resistance level . A common mistake new traders make is to get into a regular divergence trade too early, assuming it will immediately reverse, but these can continue to form for some time before the trend eventually changes, by using forms of support or resistance as an added confluence, such as when price reaches a moving average, the success rate when trading these patterns may increase.
Typically, traders will manually draw lines across the swing highs and swing lows of both the price chart and the oscillator to see whether they appear to present a divergence, this indicator will draw them for you, quickly and clearly, and can notify you when they occur.
Disclaimer : This script includes code from several stock indicators by Tradingview as well as the Divergence for Many Indicators v4 by LonesomeTheBlue. With special thanks.
RF+ Divergence Scalping SystemRF+ Divergence Scalping System + Custom Signals + Alerts.
This chart overlay indicator has been developed for the low timeframe divergence scalper.
Built upon the realtime divergence drawing code from the Divergence for Many indicator originally authored by Lonsometheblue, this chart overlay indicator bundles several additional unique features and modifications to serve as an all-in-one divergence scalping system. The current key features at the time of publishing are listed below (features are optional and can be enabled or disabled):
- Fully configurable realtime divergence drawing and alerting feature that can draw divergences directly on the chart using data sourced from up to 11 oscillators selected by the user, which have been included specifically for their ability to detect divergences, including oscillators not presently included in the original Divergence for Many indicator, such as the Ultimate Oscillator and TSI.
- Optional on chart table showing a summary of key statuses of various indicators, and nearby divergences.
- 2 x Range Filters with custom settings used for low timeframe trend detection.
- 3 x configurable multi-timeframe Stochastic RSI overbought and oversold signals with presentation options.
- On-chart pivot points drawn automatically.
- Automatically adjusted pivot period for up to 4 configurable time frames to fine tune divergences drawn for optimal divergence detection.
- Real-price line for use with Heikin Ashi candles, with styling options.
- Real-price close dots for use with Heikin Ashi candles, with styling options.
- A selection of custom signals that can be printed on-chart and alerted.
- Sessions indicator for the London, New York, Tokyo and Sydney trading sessions, including daylight savings toggle, and unique ‘invert background color’ option, which colours the entire chart - except the trading session you have selected, leaving your chart clear of distracting background color.
- Up to 4 fully configurable moving averages.
- Additional configurable settings for numerous built in indicators, allowing you to alter the lengths and source types, including the UO, TSI, MFI, TSV, 2 x Range Filters.
- Configurable RSI Trend detection signal filter used in a number of the signals, which filters buy signals where the RSI is over the RSI moving average, and only prints sell signals where RSI is under the moving average.
- Customisable on-chart watermark, with inputs for a custom title, subtitle, and also an optional symbol | timeframe | date feature.
The Oscillators able to be selected for use in drawing divergences at the time of publishing are as follows:
- Ultimate Oscillator (UO)
- True Strength Indicator (TSI)
- Money Flow Index (MFI)
- Cumulative Delta Volume (CDV)
- Time Segmented Volume (TSV)
- Commodity Channel Index (CCI)
- Awesome Oscillator
- Relative Strength Index (RSI)
- Stochastic
- On Balance Volume (OBV)
- MACD Histogram
What are divergences?
Divergence is when the price of an asset is moving in the opposite direction of a technical indicator, such as an oscillator, or is moving contrary to other data. Divergence warns that the current price trend may be weakening, and in some cases may lead to the price changing direction.
There are 4 main types of divergence, which are split into 2 categories;
regular divergences and hidden divergences. Regular divergences indicate possible trend reversals, and hidden divergences indicate possible trend continuation.
Regular bullish divergence: An indication of a potential trend reversal, from the current downtrend, to an uptrend.
Regular bearish divergence: An indication of a potential trend reversal, from the current uptrend, to a downtrend.
Hidden bullish divergence: An indication of a potential uptrend continuation.
Hidden bearish divergence: An indication of a potential downtrend continuation.
Setting alerts.
With this indicator you can set alerts to notify you when any/all of the above types of divergences occur, on any chart timeframe you choose, also when the triple timeframe Stochastic RSI overbought and oversold confluences occur, as well as when custom signals are printed.
Configurable pivot period values.
You can adjust the default pivot period values to suit your prefered trading style and timeframe. If you like to trade a shorter time frame, lowering the default lookback values will make the divergences drawn more sensitive to short term price action. By default, this indicator has enabled the automatic adjustment of the pivot periods for 4 configurable time frames, in a bid to optimize the divergences drawn when the indicator is loaded onto any of the 4 time frames selected. These time frames and their associated pivot periods can be fully reconfigured within the settings menu. By default, these have been further optimized for the low timeframe scalper trading on the 1-15 minute time frames.
How do traders use divergences in their trading?
A divergence is considered a leading indicator in technical analysis , meaning it has the ability to indicate a potential price move in the short term future.
Hidden bullish and hidden bearish divergences, which indicate a potential continuation of the current trend are sometimes considered a good place for traders to begin, since trend continuation occurs more frequently than reversals, or trend changes.
When trading regular bullish divergences and regular bearish divergences, which are indications of a trend reversal, the probability of it doing so may increase when these occur at a strong support or resistance level . A common mistake new traders make is to get into a regular divergence trade too early, assuming it will immediately reverse, but these can continue to form for some time before the trend eventually changes, by using forms of support or resistance as an added confluence, such as when price reaches a moving average, the success rate when trading these patterns may increase.
Typically, traders will manually draw lines across the swing highs and swing lows of both the price chart and the oscillator to see whether they appear to present a divergence, this indicator will draw them for you, quickly and clearly, and can notify you when they occur.
How do traders use overbought and oversold levels in their trading?
The oversold level is when the Stochastic RSI is above the 80 level is typically interpreted as being 'overbought', and below the 20 level is typically considered 'oversold'. Traders will often use the Stochastic RSI at, or crossing down from an overbought level as a confluence for entry into a short position, and the Stochastic RSI at, or crossing up from an oversold level as a confluence for an entry into a long position. These levels do not mean that price will necessarily reverse at those levels in a reliable way, however. This is why this version of the Stoch RSI employs the triple timeframe overbought and oversold confluence, in an attempt to add a more confluence and reliability to this usage of the Stoch RSI.
This indicator is intended for use in conjunction with related panel indicators including the TSI+ (True Strength Indicator + Realtime Divergences), UO+ (Ultimate Oscillator + Realtime Divergences), and optionally the STRSI+ (MTF Stochastic RSI + Realtime Divergences) and MFI+ (Money Flow Index + Realtime Divergences) available via this authors’ Tradingview profile, under the scripts section. The realtime divergence drawing code will not identify all divergences, so it is suggested that you also have panel indicators to observe. Each panel indicator also offers additional means of entry confirmation into divergence trades, for example, the Stochastic can indicate when it is crossing down from overbought or up from oversold, the TSi can indicate when the 2 TSI bands cross over one another upward or downward, and the UO and MFI can indicate an entry confluence when they are nearing, or crossing their centerlines, for more confidence in your divergence trade entries.
Additional information on the settings for this indicator can be found via the tooltips within the settings menu itself. Further information on feature updates, and usage tips & tricks will be added to the comments section below in due course.
Disclaimer: This indicator uses code adapted from the Divergence for Many v4 indicator authored by Lonesometheblue, and several stock indicators authored by Tradingview. With many thanks.
MTF Stoch RSI + Realtime DivergencesMulti-timeframe Stochastic RSI + Realtime Divergences + Alerts + Pivot lookback periods.
This version of the Stochastic RSI adds the following additional features to the stock UO by Tradingview:
- Optional 3 x Multiple-timeframe overbought and oversold signals, indicating where 3 selected timeframes are all overbought (>80) or all oversold (<20) at the same time, with alert option.
- Optional divergence lines drawn directly onto the oscillator in realtime, with alert options.
- Configurable lookback periods to fine tune the divergences drawn in order to suit different trading styles and timeframes, including the ability to enable automatic adjustment of pivot period per chart timeframe.
- Alternate timeframe feature allows you to configure the oscillator to use data from a different timeframe than the chart it is loaded on.
- Indications where the Stoch RSI is crossing down from above the overbought threshold (<80) and crossing above the oversold threshold (>20) levels on a given user selected timeframe, by printing gold dots on the indicator.
- Also includes standard configurable Stoch RSI options, including k length, d length, RSI length, Stochastic length, and source type (close, hl2, etc)
While this version of the Stochastic RSI has the ability to draw divergences in realtime along with related settings and alerts so you can be notified as divergences occur without spending all day watching the charts, the main purpose of this indicator was to provide the triple multiple-timeframe overbought and oversold confluence signals and alerts, in an attempt to add more confluence, weight and reliability to the single timeframe overbought and oversold states, commonly used for trade entry confluence. It's primary purpose is intended for scalping on lower timeframes, typically between 1-15 minutes. The triple timeframe overbought can often indicate near term reversals to the downside, with the triple timeframe oversold often indicating neartime reversals to the upside. The default timeframes for this confluence are set to check the 1 minute, 5 minute, and 15 minute timeframes, ideal for scalping the < 15 minute charts.
The Stochastic RSI
The popular oscillator has been described as follows:
“The Stochastic RSI is an indicator used in technical analysis that ranges between zero and one (or zero and 100 on some charting platforms) and is created by applying the Stochastic oscillator formula to a set of relative strength index (RSI) values rather than to standard price data. Using RSI values within the Stochastic formula gives traders an idea of whether the current RSI value is overbought or oversold. The Stochastic RSI oscillator was developed to take advantage of both momentum indicators in order to create a more sensitive indicator that is attuned to a specific security's historical performance rather than a generalized analysis of price change.”
How do traders use overbought and oversold levels in their trading?
The oversold level, that is when the Stochastic RSI is above the 80 level is typically interpreted as being 'overbought', and below the 20 level is typically considered 'oversold'. Traders will often use the Stochastic RSI at an overbought level as a confluence for entry into a short position, and the Stochastic RSI at an oversold level as a confluence for an entry into a long position. These levels do not mean that price will necessarily reverse at those levels in a reliable way, however. This is why this version of the Stoch RSI employs the triple timeframe overbought and oversold confluence, in an attempt to add a more confluence and reliability to this usage of the Stoch RSI.
What are divergences?
Divergence is when the price of an asset is moving in the opposite direction of a technical indicator, such as an oscillator, or is moving contrary to other data. Divergence warns that the current price trend may be weakening, and in some cases may lead to the price changing direction.
There are 4 main types of divergence, which are split into 2 categories;
regular divergences and hidden divergences. Regular divergences indicate possible trend reversals, and hidden divergences indicate possible trend continuation.
Regular bullish divergence: An indication of a potential trend reversal, from the current downtrend, to an uptrend.
Regular bearish divergence: An indication of a potential trend reversal, from the current uptrend, to a downtrend.
Hidden bullish divergence: An indication of a potential uptrend continuation.
Hidden bearish divergence: An indication of a potential downtrend continuation.
Setting alerts.
With this indicator you can set alerts to notify you when any/all of the above types of divergences occur, on any chart timeframe you choose, and also when the triple timeframe overbought and oversold confluences occur.
Configurable pivot lookback values.
You can adjust the default pivot lookback values to suit your prefered trading style and timeframe. If you like to trade a shorter time frame, lowering the default lookback values will make the divergences drawn more sensitive to short term price action. By default, this indicator has enabled the automatic adjustment of the pivot periods for 4 configurable timeframes, in a bid to optimise the divergences drawn when the indicator is loaded onto any of the 4 timeframes. These timeframes and the auto adjusted pivot periods on each of them can also be reconfigured within the settings menu.
How do traders use divergences in their trading?
A divergence is considered a leading indicator in technical analysis , meaning it has the ability to indicate a potential price move in the short term future.
Hidden bullish and hidden bearish divergences, which indicate a potential continuation of the current trend are sometimes considered a good place for traders to begin, since trend continuation occurs more frequently than reversals, or trend changes.
When trading regular bullish divergences and regular bearish divergences, which are indications of a trend reversal, the probability of it doing so may increase when these occur at a strong support or resistance level . A common mistake new traders make is to get into a regular divergence trade too early, assuming it will immediately reverse, but these can continue to form for some time before the trend eventually changes, by using forms of support or resistance as an added confluence, such as when price reaches a moving average, the success rate when trading these patterns may increase.
Typically, traders will manually draw lines across the swing highs and swing lows of both the price chart and the oscillator to see whether they appear to present a divergence, this indicator will draw them for you, quickly and clearly, and can notify you when they occur.
Disclaimer: This script includes code from the stock UO by Tradingview as well as the Divergence for Many Indicators v4 by LonesomeTheBlue.
Ultimate Oscillator + Realtime DivergencesUltimate Oscillator (UO) + Realtime Divergences + Alerts + Lookback periods.
This version of the Ultimate Oscillator adds the following 5 additional features to the stock UO by Tradingview:
- Optional divergence lines drawn directly onto the oscillator in realtime
- Configurable alerts to notify you when divergences occur, as well as centerline crossovers.
- Configurable lookback periods to fine tune the divergences drawn in order to suit different trading styles and timeframes.
- Background colouring option to indicate when the UO has crossed the centerline, or optionally when both the UO and an external oscillator, which can be linked via the settings, have both crossed their centerlines.
- Alternate timeframe feature allows you to configure the oscillator to use data from a different timeframe than the chart it is loaded on.
This indicator adds additional features onto the stock Ultimate Oscillator by Tradingview, whose core calculations remain unchanged. Namely the configurable option to automatically and clearly draw divergence lines onto the oscillator for you as they occur in realtime. It also has the addition of unique alerts, so you can be notified as divergences occur without spending all day watching the charts. Furthermore, this version of the Ultimate Oscillator comes with configurable lookback periods, which can be configured in order to adjust the length of the divergences, in order to suit shorter or higher timeframe trading approaches.
The Ultimate Oscillator
Tradingview describes the Ultimate Oscillator as follows:
“The Ultimate Oscillator indicator (UO) indicator is a technical analysis tool used to measure momentum across three varying timeframes. The problem with many momentum oscillators is that after a rapid advance or decline in price, they can form false divergence trading signals. For example, after a rapid rise in price, a bearish divergence signal may present itself, however price continues to rise. The ultimate Oscillator attempts to correct this by using multiple timeframes in its calculation as opposed to just one timeframe which is what is used in most other momentum oscillators.”
More information on the history, use cases and calculations of the Ultimate Oscillator can be found here: www.tradingview.com
What are divergences?
Divergence is when the price of an asset is moving in the opposite direction of a technical indicator, such as an oscillator, or is moving contrary to other data. Divergence warns that the current price trend may be weakening, and in some cases may lead to the price changing direction.
There are 4 main types of divergence, which are split into 2 categories;
regular divergences and hidden divergences. Regular divergences indicate possible trend reversals, and hidden divergences indicate possible trend continuation.
Regular bullish divergence: An indication of a potential trend reversal, from the current downtrend, to an uptrend.
Regular bearish divergence: An indication of a potential trend reversal, from the current uptrend, to a downtrend.
Hidden bullish divergence: An indication of a potential uptrend continuation.
Hidden bearish divergence: An indication of a potential downtrend continuation.
Setting alerts.
With this indicator you can set alerts to notify you when any/all of the above types of divergences occur, on any chart timeframe you choose.
Configurable lookback values.
You can adjust the default lookback values to suit your prefered trading style and timeframe. If you like to trade a shorter time frame, lowering the default lookback values will make the divergences drawn more sensitive to short term price action.
How do traders use divergences in their trading?
A divergence is considered a leading indicator in technical analysis , meaning it has the ability to indicate a potential price move in the short term future.
Hidden bullish and hidden bearish divergences, which indicate a potential continuation of the current trend are sometimes considered a good place for traders to begin, since trend continuation occurs more frequently than reversals, or trend changes.
When trading regular bullish divergences and regular bearish divergences, which are indications of a trend reversal, the probability of it doing so may increase when these occur at a strong support or resistance level . A common mistake new traders make is to get into a regular divergence trade too early, assuming it will immediately reverse, but these can continue to form for some time before the trend eventually changes, by using forms of support or resistance as an added confluence, such as when price reaches a moving average, the success rate when trading these patterns may increase.
Typically, traders will manually draw lines across the swing highs and swing lows of both the price chart and the oscillator to see whether they appear to present a divergence, this indicator will draw them for you, quickly and clearly, and can notify you when they occur.
Disclaimer: This script includes code from the stock UO by Tradingview as well as the Divergence for Many Indicators v4 by LonesomeTheBlue.
True Strength Indicator + Realtime DivergencesTrue Strength Indicator (TSI) + Realtime Divergences + Alerts + Lookback periods.
This version of the True Strength Indicator adds the following 5 additional features to the stock TSI by Tradingview:
- Optional divergence lines drawn directly onto the oscillator in realtime.
- Configurable alerts to notify you when divergences occur, as well as when the TSI and lagline bands crossover one another, when the oscillator begins heading up, or heading down.
- Configurable lookback periods to fine tune the divergences drawn in order to suit different trading styles and timeframes.
- Background colouring option to indicate when the two TSI bands, the TSI line and the TSI lagline, have crossed one another, either moving upwards or downwards, or optionally when the two TSI bands have crossed upwards and an external oscillator, which can be linked via the settings, has crossed above its centerline, and the TSI bands have crossed downwards and the external oscillator has crossed below its centerline.
- Alternate timeframe feature allows you to configure the oscillator to use data from a different timeframe than the chart it is loaded on.
This indicator adds additional features onto the stock TSI by Tradingview, whose core calculations remain unchanged, although this version has different settings as default to suit a shorter time period (it uses 6, 13, 4 by default, whereas the stock TSI typically ships with higher values, e.g. 25, 13, 13). Namely the configurable option to automatically, quickly and clearly draw divergence lines onto the oscillator for you as they occur in realtime. It also has the addition of unique alerts, so you can be notified when divergences occur without spending all day watching the charts. Furthermore, this version of the TSI comes with configurable lookback periods, which can be configured in order to adjust the sensitivity of the divergences, in order to suit shorter or higher timeframe trading approaches.
The True Strength Indicator
Tradingview describes the True Strength Indicator as follows:
“The True Strength Index (TSI) is a momentum oscillator that ranges between limits of -100 and +100 and has a base value of 0. Momentum is positive when the oscillator is positive (pointing to a bullish market bias) and vice versa. It was developed by William Blau and consists of 2 lines: the index line and an exponential moving average of the TSI, called the signal line. Traders may look for any of the following 5 types of conditions: overbought, oversold, centerline crossover, divergence and signal line crossover. The indicator is often used in combination with other signals..”
What are divergences?
Divergence is when the price of an asset is moving in the opposite direction of a technical indicator, such as an oscillator, or is moving contrary to other data. Divergence warns that the current price trend may be weakening, and in some cases may lead to the price changing direction.
There are 4 main types of divergence, which are split into 2 categories;
regular divergences and hidden divergences. Regular divergences indicate possible trend reversals, and hidden divergences indicate possible trend continuation.
Regular bullish divergence: An indication of a potential trend reversal, from the current downtrend, to an uptrend.
Regular bearish divergence: An indication of a potential trend reversal, from the current uptrend, to a downtrend.
Hidden bullish divergence: An indication of a potential uptrend continuation.
Hidden bearish divergence: An indication of a potential downtrend continuation.
Setting alerts.
With this indicator you can set alerts to notify you when any/all of the above types of divergences occur, on any chart timeframe you choose.
Configurable lookback values.
You can adjust the default lookback values to suit your prefered trading style and timeframe. If you like to trade a shorter time frame, lowering the default lookback values will make the divergences drawn more sensitive to short term price action.
How do traders use divergences in their trading?
A divergence is considered a leading indicator in technical analysis , meaning it has the ability to indicate a potential price move in the short term future.
Hidden bullish and hidden bearish divergences, which indicate a potential continuation of the current trend are sometimes considered a good place for traders to begin, since trend continuation occurs more frequently than reversals, or trend changes.
When trading regular bullish divergences and regular bearish divergences, which are indications of a trend reversal, the probability of it doing so may increase when these occur at a strong support or resistance level . A common mistake new traders make is to get into a regular divergence trade too early, assuming it will immediately reverse, but these can continue to form for some time before the trend eventually changes, by using forms of support or resistance as an added confluence, such as when price reaches a moving average, the success rate when trading these patterns may increase.
Typically, traders will manually draw lines across the swing highs and swing lows of both the price chart and the oscillator to see whether they appear to present a divergence, this indicator will draw them for you, quickly and clearly, and can notify you when they occur.
Disclaimer: This script includes code from the stock TSI by Tradingview as well as the Divergence for Many Indicators v4 by LonesomeTheBlue
Real-time price distribution in candlesThis indicator splits the candle time into 30 units to indicate where the price was at each time.
In the case of a 1-hour time zone, 60 minutes / 30 = 2 minutes, so this display the location of the price every 2 minutes.
In case of 1 minute time zone, it is displayed every 2 seconds.
CAUTION
If a transaction does not occur, the display may be omitted.
You can change the color of the opening and closing prices and the size of the dots.
Intrabar Price/Volume Change (experimental)This experimental script shows the intrabar progression of price/volume
It can only be used with live data, when you switch timeframe or ticker, it will start over again.
When you let the script run, you'll get insight of what is going on during the bar progression.
On each tick, when the price goes up, a green line will be drawn,
if it goes down, a red line is drawn. The higher the difference with previous price, the wider the line.
The same with volume (lighter, broader lines), only it will always be drawn in the same direction as price goes.
You can set the max width of the lines, when a spike is larger then previous lines, the rest will be adjusted, so the ratio stays the same
The center line (position can be changed) has 2 colors (only on second and minute timeframes) -> this makes it easy to see the bar progression, each change in color represents a new bar
Lines can be drawn on 2 sides, or at 1 side, also they can be reversed
Many thanks to @LonesomeTheBlue and @LucF for their inspiration, help and guidance!
Cheers!
Bar Percent CompleteThis is an example script for checking how far the current bar has progressed towards it's completed state. This works for any time frame, eliminating extra logic calls and conversions for each timeframe.period. It is not intended to be a standalone indicator, but rather as a resource for additional logic triggers on the real time bar of a pine script.
The main caveat is that pine script calculations occur on a per-tick basis. This means that the completion percentage can exceed the percentage threshold before any logic is executed. This happens when the next tick occurs after the threshold. The relevance then will depend on the activity of the underlying asset. Longer time frames on low activity assets will likely be more relevant than their shorter time frame counterparts.
MTF WatchList Charts [Anan]█ OVERVIEW
I am happy to present this script with a nice idea!
You can now customize a watchlist with your preferred time frame and any symbol from any market.
The main purpose is to be aware of any moves and watch a brief overview of the chart.
█ FEATURES
- 8 customizable symbols with the option to show/hide anyone
- Multi time frame support
- 3 Types of charts (Candles / Heikin Ashi / Line)
- Displaying up to 10 candles for every chart
- Customizable chart colors
- Option to Show/hide Price
- Option to Show/hide Price Line
- Option to change Labels and Text Size
- Show Symbol name and used time frame
- Option to change gaps between charts
- Hover over on the top of any candle to see (Open/High/Low/Close) Prices
█ SCREENSHOTS
-----------------------------------------------
Special thanks to @dgtrd for inspiration and for the amazing framework used here ( HTF Candles by DGT )
Special thanks to Pine Chat @fareidzulkifli @Bjorgum @JohnBaron @fpainchaud
Security() Correction - Realtime vs. Historical BarsProblem
Pine's implementation of the security() function behaves differently in realtime vs. historical bars. Specifically, for historical bars, calling security() for a time frame (TF) larger/slower than the current chart's TF will return information about the last completed bar of the higher TF. However, for realtime bars (i.e. if you allow the chart to continue to plot in realtime), security() returns information about the presently in-progress bar of the higher TF. Clearly, this leads to discontinuity that is arbitrarily dependent upon when the user last loaded or refreshed the chart.
Solution
Fortunately, after understanding the problem, solving it is trivial: use security() normally for historical bars, but switch to explicitly requesting prior candle bars once the indicator is operating on realtime bars. I leave the source open here for any to use as they see fit. For testing, I include an input to allow switching back and forth between standard and corrected behavior.
Figure 1 displays the standard behavior we see in security() calls, and Figure 2 displays the behavior after my correction:
Figure 1: Typical security() behavior in Pine
Figure 2: Corrected security() behavior, forcing historical and realtime bars to refer to the same higher TF bar offset.
I publish this mostly as a reminder to myself, so I will not forget and then have to figure it out again next time it comes up in my scripting.
V21: Initial release.
Not closed yet scriptI made this to serve as a reminder if a candle is not closed yet. This is to avoid entering a trade based on a candle that is not closed because this candle could look alot different by the time it closes. Good luck.
cooltoyz: Volume Delta RealTime v1.0This is a tool, shows the volume variation % strength related to the X past candles.
The current candle is shown in real time, until candle closes.
The visualization of the candle time to close is a thin line, that is 100% for all past candles and slowly goes up for the current candle.
Best with an example:
with a 4h candle, 1 hour has wasted already. This is 25% of all the candle time. So, if volume is also at 25% of the last candles traded, we can expect(yeah, you wish) that by candle close, around 100% of the last volumes average will be traded.
Or two:
in a 4h candle, we're at 10mins., around 8% of total candle time. If volume traded is already at 57% of average past volumes, something big is going on.
Note 1: in the indicator's "Format" pop-up there is a "candle minutes" field, it MUST match the chart timeframe in minutes (ex: 4h=240min)
Note 2: the back volume function check can be switched between the methods "highest value" or "average", in the Format->inputs
Note 3: when a new candle opens, it will go craaayeeezeee!!, because the extreme small values introduce a lot of rounding errors. just let it go, it calms it self after ~0.5% of candle time has passed.
There are more examples and details in the early version of this indicator, check my published scripts.
cooltoyz: ghost candleThis is a tool. Do with it what you like :)
The ghost candle works by drawing a bigger time frame candles in ghost mode over a chart. The time frame is default of 4h, can be changed in the "format" pop-up.
What we see in a time frame as the "wick", is really a set of candles when looked at lower resolutions/timeframes, that info is crunched into the OHLC format. But, when we look at a represntation of the "internals" of a candle, the wicks are not just a single candle that "walked out of the reservation".
So, in this ghost mode, a wick makes no sense visually. In this case, the OHLC is represented as a darker area for the main candle body, and lighter zones for the wicks. Just another way to sing the same song...
Note 1: the ghost candles are skewed, due to the way that TV plots a line. It's most visible when a chart is very zoomed.
Note 2:As result of the TV real time engine, the last candle presents sometimes mixed colors. There's no easy way to fix it, so until the candle closes, if you see weird colors, well, that's life :)
Realtime Volume Checker : reloadedthe main rules are in version 1.0 of this indicator, here: and they provide useful info to make sense of the indicator
two important improvements:
1 - the candle period is now provided in minutes
2 - the volume MA size does not make an average abymore, now IT CHOOSES the highest value in the range. this provides less, but more significant signals.
Real Time Volume checkerThis indicator was designed to work in real time, and needs the "calculate on every tick" turned on. It verifies if the volume from the current candle is increasing more or less than the average.
Example using 5 min. candles:
1 minute is 20% of the time for the candle. So, if the volume is at 20% or below of the vol.average, the market is stable(price not moving much). If at 1 minute(20% of time) volume is say, at 37%, a big move is happening.
The color of the candle shows the movement direction. A gray means the volume was not important, below average.
The historical candles show how much volume infuenced the price for the corresponding candle.
The current candle is working REAL TIME.
The blue line shows how much time has passed for the candle to complete. All candles are 100% complete(yeah, duh), except for the last one, the line touches zero at start of candle, and slowly fills up to1(1=100%)until the candle ends.
INPUTS:
vol MA size: sets the lenght of the volume average. set to your heard desires
candle Period: set to the number of seconds in the period you chose. 5min = 300, 1h = 3600 and so on. Must be correct, or the results turn into crap
Limit: the value below which the candle is a "non-important" candle. 1 = 100% of average
NOTE: in the very first seconds, the indicator goes crazy. it's expected, due to computed values very close to zero used in the math. after some seconds it stabilizes :)