EMA Cross + Divergence strategy (Div. signals by The Divergent)A sample strategy demonstrating the usage of The Divergent divergence indicator and The Divergent Library .
The Divergent is an advanced divergence indicator which you can easily incorporate into your own strategies.
In order to use this strategy (and to use the signals in your own strategy), you need to have the Pro version of The Divergent applied to your chart.
For more information, please see the comments inlined in the code.
انفراج سعري
The Divergent LibraryLibrary "TheDivergentLibrary"
The Divergent Library is only useful when combined with the Pro version of The Divergent - Advanced divergence indicator . This is because the Basic (free) version of The Divergent does not expose the "Divergence Signal" value.
Usage instructions:
1. Create a new chart
2. Add The Divergent (Pro) indicator to your chart
3. Create a new strategy, import this library, add a "source" input, link it to "The Divergent: Divergence Signal", and use the library to decode the divergence signals from The Divergent (You can find example strategy code published in our profile)
4. Act on the divergences signalled by The Divergent
---
isRegularBullishEnabled(context) Returns a boolean value indicating whether Regular Bullish divergence detection is enabled in The Divergent.
Parameters:
context : The context of The Divergent Library.
Returns: A boolean value indicating whether Regular Bullish divergence detection is enabled in The Divergent.
isHiddenBullishEnabled(context) Returns a boolean value indicating whether Hidden Bullish divergence detection is enabled in The Divergent.
Parameters:
context : The context of The Divergent Library.
Returns: A boolean value indicating whether Hidden Bullish divergence detection is enabled in The Divergent.
isRegularBearishEnabled(context) Returns a boolean value indicating whether Regular Bearish divergence detection is enabled in The Divergent.
Parameters:
context : The context of The Divergent Library.
Returns: A boolean value indicating whether Regular Bearish divergence detection is enabled in The Divergent.
isHiddenBearishEnabled(context) Returns a boolean value indicating whether Hidden Bearish divergence detection is enabled in The Divergent.
Parameters:
context : The context of The Divergent Library.
Returns: A boolean value indicating whether Hidden Bearish divergence detection is enabled in The Divergent.
getPivotDetectionSource(context) Returns the 'Pivot Detection Source' setting of The Divergent. The returned value can be either "Oscillator" or "Price".
Parameters:
context : The context of The Divergent Library.
Returns: One of the following string values: "Oscillator" or "Price".
getPivotDetectionMode(context) Returns the 'Pivot Detection Mode' setting of The Divergent. The returned value can be either "Bodies" or "Wicks".
Parameters:
context : The context of The Divergent Library.
Returns: One of the following string values: "Bodies" or "Wicks".
isLinked(context) Returns a boolean value indicating the link status to The Divergent indicator.
Parameters:
context : The context of The Divergent Library.
Returns: A boolean value indicating the link status to The Divergent indicator.
init(firstBarSignal, displayLinkStatus, debug) Initialises The Divergent Library's context with the signal produced by The Divergent on the first bar. The value returned from this function is called the "context of The Divergent Library". Some of the other functions of this library requires you to pass in this context.
Parameters:
firstBarSignal : The signal from The Divergent indicator on the first bar.
displayLinkStatus : A boolean value indicating whether the Link Status window should be displayed in the bottom left corner of the chart. Defaults to true.
debug : A boolean value indicating whether the Link Status window should display debug information. Defaults to false.
Returns: A bool array containing the context of The Divergent Library.
processSignal(signal) Processes a signal from The Divergent and returns a 5-tuple with the decoded signal: [ int divergenceType, int priceBarIndexStart, int priceBarIndexEnd, int oscillatorBarIndexStart, int oscillatorBarIndexEnd]. `divergenceType` can be one of the following values: na → No divergence was detected, 1 → Regular Bullish, 2 → Regular Bullish early, 3 → Hidden Bullish, 4 → Hidden Bullish early, 5 → Regular Bearish, 6 → Regular Bearish early, 7 → Hidden Bearish, 8 → Hidden Bearish early.
Parameters:
signal : The signal from The Divergent indicator.
Returns: A 5-tuple with the following values: [ int divergenceType, int priceBarIndexStart, int priceBarIndexEnd, int oscillatorBarIndexStart, int oscillatorBarIndexEnd].
[JL] Stochastic Divergence AlertCompare two cross area:
k is increasing, low is lower and previous k is less than bottom level then it is bottom divergence
k is decrease, high is higher and previous k is more than top level then it is top divergence
With long term moving average(400), seems that Stochastic Divergence is more accurate than RSI Divergence on 1m chart.
TSI in Dynamic Zones with Divergence and Pivot PointsTrue Strength Index , or TSI is considered a "leading indicator" - in contrast to a "lagging indicator" just as Moving Averages it does not show a confirmation what already happened, but it shows what can happen in the future. For example: The chart is climbing while the TSI oscillator is slowly declining, gets weaker and weaker, maybe even prints bearish divergences? That means that a reversal might be occurring soon. Leading indicators are best paired with Stop and Resistance Lines, General Trendlines , Fib Retracements etc. Your chart is approaching a very important Resistance Trendline but the TSI shows a very positive signal? That means there is a high probability that the Resistance is going to be pushed through and becomes Support in the future.
What are those circles?
-These are Divergences. Red for Regular-Bearish. Orange for Hidden-Bearish. Green for Regular-Bullish. Aqua for Hidden-Bullish.
What are those triangles?
- These are Pivots . They show when the TSI oscillator might reverse, this is important to know because many times the price action follows this move.
What are these blue or orange areas?
- Those are dynamic zones. For the analysis of the TSI its important to know if the indicator is in a state of oversold or overbought to filter out ranging price movement. Normally those zones are static, in this version of the TSI oscillator dynamic zones were added to show a dynamic calculation whether the TSI oscillator is oversold, overbought or ranging.
Please keep in mind that this indicator is a tool and not a strategy, do not blindly trade signals, do your own research first! Use this indicator in conjunction with other indicators to get multiple confirmations.
Baekdoo compressed multi EMA box and its crossover indicatorHi forks,
I'm trader Baekdoosan who trading Equity from South Korea. This Baekdoo compressed multi EMA box and its crossover indicator tells us good trading time for swing trading.
Here is the idea. As you can see formula, I put ema of 5 days to 100 days.
and draw box when all disparity of the EMAs are less than 5%
I put those value in input variable as 105 (100 means same as max/min disparity ratio, 105 means max is 5% greater than min). This can be used 110 (10% of box) based on your needs.
Once box are drew, I put indicator when it crossover the box with 5 times larger than 60 days' highest volume. Then I put triangle indicator. This will be good trading point for short-mid term trading. you can check historical chart to evaluate this.
Hope this will help your trading on equity as well as crypto. I didn't try it on futures . Best of luck all of you. Gazua~!
+ Rate of ChangeNOTE!* If you were using my previous + Rate of Change (and OBV) indicator, I will not be updating that. OBV was moved to my + Breadth & Volume indicator.
This indicator here is basically and updated version of the old indicator, without OBV.
The Rate of Change, or RoC, is a momentum indicator that measures the percentage change in price between the current period and the price n periods ago.
It oscillates above and below a zeroline, basically showing positive or negative momentum.
I applied the OBV's calculation to it, but without the inclusion of volume (also added a lookback period) to see what would happen. I rather liked the result.
I call this the "Cumulative Rate of Change." I only recently realized that this is actually just the OBV without volume, however the OBV does not have a lookback period, and this indicator does.
Doing some more fiddling, I realized that removing both the signum and the volume from the calculation gets you basically a price chart, but calculated as the change in price over n periods. I'm leaving this in because maybe someone discovers they really like having a line chart with moving averages or some other indicator on it to leave their main chart indicator free (giving a more clear look at price action). Can't hurt, right?
Default lookback is set to 1, but play with longer settings (especially if using the traditional RoC, which is by default in TV set to 10, and is nigh on useless at 1--I like 13).
Default source is set to each candle close, but give ohlc4 a look. It smooths out the indicator a bit, and because it's an average of the open, high, low, and close it should give a better idea of what price in general is doing.
Moving averages, Bollinger Bands, Donchian Channels, candle coloring and alerts are my usual additions.
Below are some comparison images of the different indicators wrapped up in here.
Comparison of Cumulative Rate of Change with two different sources. Lookback set to 1.
Cumulative Rate of Change as a price chart, essentially.
And, lastly, the traditional Rate of Change indicator.
Inverse Divergence [HeWhoMustNotBeNamed]Experimental.
In regular scenario divergence calculation follows these procedure
Pivots on price are considered as primary source
They are compared with pivots on oscillators
Trend bias of price is used
This is an experimental version where
Pivots on oscillators are considered as primary source
They are compared with pivots on price
Trend bias of oscillator is used. Using percentrank to define oscillator trend
Caution: Not meant for trading :)
+ REX OscillatorSo, what is the REX oscillator, you might be asking yourself.
"The Rex oscillator is an indicator that measures market behavior based on the relationship of the close to the open, high and low values of the same bar. A big difference between the high and close on a bar indicates weakness, and wide disparity between the low and close indicates strength. The difference between open and close also indicates market performance."
The True Value of a Bar (TVB) gives an indication of how healthy the market is. A negative close and a positive TVB (or vice versa) is an indication of the market building strength on the opposing side of the trend. The Rex oscillator is a moving average of the TVB value with the specified period.
I first came across this watching one of many No Nonsense Forex videos. Mostly, from comments I've read, it is used as an exit indicator for people who trade with a system similar or identical to the one VP espouses in his NNFX blog. I think it's perfectly apt to use as an entry indicator as well, or even as both, perhaps, depending on the moving average you chose to apply to the TVB.
There are a few other versions of this on tradingview, but I thought I'd make an updated version. Added Donchian Channels because I like the idea of a dynamic sort of overbought/sold area. I left out the basis because the indicator pivots around a center line, and has a signal line as well. A basis line just seemed like too much, and would likely not be very useful.
The additional usual things that I incorporate into my indicators are included here: optional candle coloring, alerts, and probably a too large selection of moving averages.
Credit to Nemozny for the FRAMA calculation. I may add that to other indicators I have.
Binary ComboThis script combines Stochastic Divergence and WaveTrend Crosses.
Stochastic Divergence may be useful for seeing a shift in momentum before the price action reflects it.
WaveTrend gives us context to the short term trend.
You can combine these together to find good entries.
RSI Linear Regression with ZigZag by zdmreBoth the RSI (Relative Strength Index) and the Linear Regression ( LR ) rank among the most popular momentum indicators used in trading. When used in combination with other technical indicators (ZigZag), both RSI, LR and ZigZag can offer value in validating trade opportunities to optimize your risk management practices.
Here’s a look at how to use RSI, LR and ZigZag (Can be used for divergence patterns.) as part of your trade analysis.
If you have new ideas to improve this indicator then let me know please.
***Use it at your own risk
MTF DPO-RSI IndicatorThis indicator uses the principle of taking the RSI of DPO readings across multiple time frames in order to provide trade signals and an overarching view of market conditions to the trader. My hope with creating this indicator was to present more divergence based signals than your typical indicator, while still keeping those signals at a high quality.
In the settings menu, you may specify:
Indicator Timeframe - the chart resolution that is used to calculate values.
Source DPO Length - the number of bars used to calculate the Detrended Price Oscillator value. The DPO value is the source for the RSI calculations.
DPO Hull Smoothing - how much smoothing is applied to the DPO . Smoothing is accomplished by taking a Hull Moving Average of the closing price, and using this to calculate the DPO value.
RSI Length - the number of bars used to calculate the RSI of the DPO value.
Time Multipliers 1 through 6 - use this to define what resolution each plot will represent. A value of 1 will represent the current Indicator Timeframe. A value of 3 will represent 3 times the current Indicator Timeframe, etc.
Show Plot 1 through 6 - toggles the display of plots.
How I trade with this indicator:
A value of under 30 represents an over sold state for that particular plot. A value of over 70 represents an overbought state for that plot.
Identify divergences on a lower timeframe plot which are apparent in overbought or oversold conditions, and confirm the signal with an overbought or oversold condition, or a divergence on a higher timeframe plot. Divergences which begin in oversold or overbought territory and end inside the 30-70 range tend to be more reliable signals, in my experience. Like all indicators, this is best when used in conjunction with other indicators. Trend indicators, such as double EMA's and Supertrend are my favorite pairing, and a stochastic RSI is a good tool to have as well.
This is my first published indicator! If you find unique ways to use it, drop me a message. I'd love to know what you find. :)
Divergence-Support/ResistenceAnother script based on zigzag, divergence, and to yield support and resistence levels.
This idea started with below two concepts:
▶ Support and resistence are simply levels where price has rejected to go further down or up. Usually, we can derive this based on pivots. But, if we start looking at every pivot, there will be many of them and may be confusing to understand which one to consider.
▶ Lot of people asked about one of my previous script on divergence detector on how to use it. I believe divergence should be considered as area of support and resistence because, they only amount to temporary weakness in momentum and nothing more. As per my understanding
Trend > Hidden Divergence > Divergence > Oscillator Levels of Overbought and Oversold
⬜ Process
▶ Now combining the above two concepts - what we are trying to do here is draw support resistence lines only on pivots which has observed either divergence or hidden divergence. Continuation and indecision pivots are ignored.
▶ Input requires only few parameters.
Zigzag lengths and oscillator to be used. Oscillator periods are automatically calculated based on zigzag length. Hence no other information required. You can also chose custom oscillator via external source.
▶ Display include horizontal lines of support/resistence which are drawn from the candle from where divergence or hidden divergence is detected.
▶ Support resistence lines are colored based on divergence. Green shades for bullish divergence and bullish hidden divergence whereas red shades for bearish divervence and bearish hidden divergence. Please note, red and green lines does not mean they only provide resistence or support. Any lines which are below the price should be treated as support and any line which are above the price should be treated as resistence.
▶ Divergence symbols are also printed on the bar from where divergence/hidden divergence is detected.
↗ - Bullish Hidden Divergence
↘ - Bearish Hidden Divergence
⤴ - Bullish Divergence
⤵ - Bearish Divergence
▶ Script also demonstrates usage of libraries effectively. I have used following libraries in this code.
import HeWhoMustNotBeNamed/ zigzag /2 as zg
import HeWhoMustNotBeNamed/enhanced_ta/8 as eta
import HeWhoMustNotBeNamed/ supertrend /4 as st
Can be good combination to use it with harmonic patterns.
Volume Price Trend with Divergence and Pivot Points The volume price trend indicator is used to determine the balance between a security’s demand and supply. The percentage change in the share price trend shows the relative supply or demand of a particular security, while volume indicates the force behind the trend. The VPT indicator is similar to the on-balance volume (OBV) indicator in that it measures cumulative volume and provides traders with information about a security’s money flow.
This is Volume Price Trend or VPT recalculated to be an Oscillator, a Divergence hunter was added, also Pivot Points and Alerts.
VPT is considered a "leading indicator" - in contrast to a "lagging indicator" just as Moving Averages it does not show a confirmation what already happened, but it shows what can happen in the future. For example: The chart is climbing while the VPT oscillator is slowly declining, gets weaker and weaker, maybe even prints bearish divergences? That means that a reversal might be occurring soon. Leading indicators are best paired with Stop and Resistance Lines, general Trendlines , Fib Retracements etc...Your chart is approaching a very important Resistance Trendline but the VPT shows a very positive signal? That means there is a high probability that the Resistance is going to be pushed though and becomes Support in the future.
What are those circles?
-These are Divergences. Red for Regular-Bearish. Orange for Hidden-Bearish. Green for Regular-Bullish. Aqua for Hidden-Bullish.
What are those triangles?
- These are Pivots . They show when the VPT oscillator might reverse, this is important to know because many times the price action follows this move.
Please keep in mind that this indicator is a tool and not a strategy, do not blindly trade signals, do your own research first! Use this indicator in conjunction with other indicators to get multiple confirmations.
CDC DivergencesA handy little indicator to help identify different kinds of convergences/divergences
The indicator compares price movements with the momentum and volume movements, Hidden divergences are left out, at least in the first version, because I wanted this indicator to be as simple as possible.
The divergences are shown with labels, user can change the momentum/volume indicator used to identify divergences in the settings.
RSI Overbought Oversold Divergence Strategy w/ Buy/Sell SignalsThis indicator is a copy of my RSI Overbought/Oversold Divergence Indicator with-Alerts
Only difference is that the alerts are disabled, instead it uses tradingviews strategy tester signals
If you want alerts just use the other indicator
RSI Overbought Divergence Indicator with AlertsThis indicator alerts you only if there are divergences after price was oversold or overbought
True Strength Index Histogram [Futures Market]This is a modified version of True Strength Index to fit the scalping trading style in futures market
RSI OBLIVION This is a powerful tool if combined with other parameters. It's an advanced version of an RSI .
It shows OB and OS conditions and price direction or shift of the trend.
This indicator can be used in various ways with all markets.
The current settings are designed to work with futures market.
Combined with our TSI and Price action, RSI OBLIVION is the most reliable KPI out there.
Reached out to us for assistance.
On-chart Wavetrend Divergence with PivotsThis is an OnChart WaveTrend Divergence Indicator with Pivots and Alerts
LazyBears WaveTrend Indicator or also known as "Market Cipher" is an Indicator that is based on Moving Averages, therefore its an "lagging indicator". Lagging indicators are best used in combination with leading indicators. In this script the "leading indicator" component are Daily, Weekly or Monthly Pivots. These Pivots can be used as dynamic Support and Resistance, Stoploss, Take Profit etc.
This indicator combination is best used in larger timeframes. For lower timeframes you might need to change settings to your liking.
What are those circles?
-These are the WaveTrend Divergences. Red for Regular-Bearish. Orange for Hidden-Bearish. Green for Regular-Bullish. Aqua for Hidden-Bullish.
Please keep in mind that this indicator is a tool and not a strategy, do not blindly trade signals, do your own research first! Use this indicator in conjunction with other indicators to get multiple confirmations.
MACD AdvancedHello traders!
As you know, MACD is one of the oldest and the most popular indicators for trading. It seems to be a «Hello world indicator» of most technical analysis beginners. It’s easy to interpret and rather useful for many styles of trading. There are many arguments about its accuracy but in my opinion, this indicator can show very good results. However, you should squeeze every drop of its opportunities and we'll help you with it. We invented this script to make the lives of both professionals and freshmen easier.
Our new indicator uses all the opportunities that MACD gives. It takes into consideration divergencies, crossovers, the MACD, and signal line location. It seems to be rather difficult to take into consideration all MACD signals when you don’t use algorithmic trading, but it’ll be trivial using our script. We have integrated some innovations that’ll make traders’ staff easier. As you know, the crossover is considered to be a false signal in conjunction with hidden divergence which predicts another movement. Thus, we catch all types of divergencies and if it’s hidden of another «value» we skip it. However, if there's a crossover with bullish divergence or cross under with bearish, the signal seems to be strong and accurate. In this case, divergence is playing for us and makes the point of entrance more trustable. Our script takes into consideration this case and the innovative divergence chaser doesn’t give any mistakes. Moreover, if crossover takes place above zero line and crosses under bellow it, these signals are considered to be false too. It’s a trivial task comparing with the previous, thus it’s extremely simple for our script. We called it MACD Advanced cause it uses all the power of MACD with the power of invasive divergence chasers. The usage of it is trivial. Just add it to the chart, tune the parameters like MACD and tune the divergence chaser and get very accurate signals. We decided not to draw the bars to make signals more visible. It seems to be very nice!
I hope guys you'll enjoy it and it'll become a part of your trading staff.
Multi-ZigZag Multi-Oscillator Trend DetectorThis table is intended to give you snapshot of how price and oscillators are moving along with zigzag pivots.
This is done in the same lines of Zigzag-Trend-Divergence-Detector
But, here are the differences
Table shows multiple oscillator movements at a same time instead of one selected oscillator
Divergence is not calculated and also supertrend based trend. Trend can be calculated based on zigzag movements. However, lets keep this for future enhancements.
This system also uses multiple zigzags instead of just one.
⬜ Process
▶ Derive multiple zigzags - Code is taken from Multi-ZigZag
▶ Along with zigzags - also calculate different oscillators and attach it to zigzag pivot.
▶ Calculate directions of zigzag pivots and corresponding oscillators.
▶ Plot everything in the table on last bar.
⬜ Table components
Table contains following data:
Directional legends are:
⇈ - Higher High (Green)
⇊ - Lower Low (Red)
⭡- Lower High (Orange)
⭣ - Higher Low (Lime)
⬜ Input Parameters
▶ Source : Default is close. If Unchecked - uses high/low data for calculating pivots. Can also use external input such as OBV
▶ Stats : Gives option to select the depth of output (History) and also lets you chose text size and table position.
▶ Oscillators : Oscillator length is derived by multiplying multiplier to zigzag length. For example, for zigzag 5, with 4 as multiplier, all oscillators are calculated with length 20. But, same for zigzag 8 will be 32 and so on.
▶ Available oscillators :
CCI - Commodity Channel Index
CMO - Chande Momentum Oscillator
COG - Center Of Gravity
MFI - Money Flow Index (Shows only if volume is present)
MOM - Momentum oscillator
ROC - Rate Of Change
RSI - Relative Strength Index
TSI - Total Strength Index
WPR - William Percent R
BB - Bollinger Percent B
KC - Keltner Channel Percent K
DC - Donchian Channel Percent D
ADC - Adoptive Donchian Channel Percent D ( Adoptive-Donchian-Channel )
⬜ Challenges
There are 12 oscillators and each zigzag has different length. Which means, there are 48 combinations of the ocillators.
First challenge was generating these values without creating lots of static initialization. Also, note, if the functions are not called on each bar, then they will not yield correct result. This is achieved through initializer function which runs on every bar and stores the oscillator values in an array which emulates multi dimensional array oscillator X zigzag length.
Next challenge was getting these values within function when we need it. While doing so I realized that values stored in array also have historical series and calling array.get will actully get you the entire series and not just the value. This is an important takeaway for me and this can be used for further complex implementations.
Thanks to @LonesomeTheBlue and @LucF for some timely suggestions and interesting technical discussions :)
Moving Average Oscillator by [DM]Greetings colleagues
Today I share an indicator that I had been thinking about for a long time. Its a easy idea but not easy to exploit"
The signals are generated the same as a MACD but the signal lengths are different.
In its standard form, the average signal of all signals is shown.
It has been designed for all those who use moving stockings in a conventional way and do not want to see the moving stockings in the price.
The options are endless on the indicator.
Show or hide all signals
Show or hide fill color of the signals
Show or hide fill gradient color of the signals
Show or hide horizontal lines
Graduation of horizontal lines with only one parameter
Show or hide fill color of horizontal lines
Show or hide fill gradient color of the horizontal lines
Alarms can be configured with any crossover
All sign lengths can be adjusted
You can change the color of each horizontal line and / or hide