Hybrid Overbought/Oversold OverlayIntroduction
This is a new representation of my well-known oscillator Hybrid Overbought/Oversold Detector overlaid on the chart. The script utilizes the following 12 different oscillators to bring forth a new indicator which I call it Hybrid OB/OS .
Utilized Oscillators
The utilized oscillators here are:
Bollinger Bands %B
Chaikin Money Flow (CMF)
Chande Momentum Oscillator (CMO)
Commodity Channel Index (CCI)
Disparity Index (DIX)
Keltner Channel %K
Money Flow Index (MFI)
Rate Of Change (ROC)
Relative Strength Index (RSI)
Relative Vigor Index (RVI/RVGI)
Stochastic
Twiggs Money Flow (TMF)
The challenging part of utilizing mentioned oscillators was that some of their formulas range are not similar and some of them does not have a mathematical range at all. So I used a normalization function to normalize all their output values to (0, 100) interval.
Overbought/Oversold Levels Calculation
I noticed that the levels which considered as OB/OS level by various traders for each of the utilized oscillators are so different, e.g., many traders consider 30 as OS level and 70 as OB level for RSI and some others take 20 and 80 as the levels, or some traders consider 20 and 80 as OS/OB levels for Stochastic oscillator. Also these levels could be different on different assets, e.g., OB/OS levels for CCI on EURUSD chart might be 80 and 20 while the levels on BTCUSDT chart might be 75 and 25, and so on.
So I decided to make a routine to automate the calculation of these levels using historical data. By this feature, my indicator would calculate the corresponding levels for the oscillators on current chart and then decide about the overbought/oversold situation of each one, which leads to a more accurate Hybrid OB/OS indication.
As the result, if all 12 individual oscillators say it's overbought/oversold, the Hybrid OB/OS shows 100% overbought/oversold, vice versa, if none of them say it's overbought/oversold, the Hybrid OB/OS shows 0, and so on.
The Overlaying Oscillator Problem!
A programming-related challenge here was that Pine Script assigns two separate spaces to the oscillators and the overlaid indicators, and the programmers are limited to use just one of them in each of their codes.
Knowing this, I was forced to simulate the oscillator space on the chart and display my oscillator as a diagram somehow. Of course it won't be as nice as the oscillator itself, because the relation between the main chart bars and the oscillator bars could not be obtained, but it's better than nothing!
Settings and Usage
The indicator settings contain some options about the calculations, the diagram display and the signals appearance. By default they are fine, but you could change them as you prefer.
This indicator is better to be used alongside other indicators as a confirmation (specially in counter-trend strategies I believe). Also it generates an external signal which you could use it in your own designed indicators as well.
Feel free to test it and also the former form of the Hybrid OB/OS . Good Luck!
Hybrid
RSI TrendRSI Hull Trend is a hybrid indicator with RSI of HULL Signal. The Hull MA is combined with RSI to see if the Hull MA Buy/Sell Signal is in overbought or oversold condition. Buy Sell Signals are plotted based on settings of OB/OS or RSI. This indicator is very useful to see if the Trend is in Exhaustion or Beginning of a Trend. Entry and Exit conditions can be more precise based on OB/OS condition of price action. In addition normal RSI trend is plotted with trend color from Hull MA. Best Performance with Heiken Ashi Candles.
OB/OS Settings provided
Hull Buy/Sell Signals plotted
Double RSI FAST and DEFAULT signal with crossover
Bar Color applied based on Hull RSI Trend
Hull Trend + RSI + Price Action
MACD Hybrid BSHMACD = Moving Average Convergence and Divergence
Hybrid = Combining the two main MACD signals into one indicator
BSH = Buy Sell Hold
This indicator looks for a crossover of the MACD moving averages (12ema and 26ema) in order to generate a buy/sell signal and a crossover of the MACD line (12ema minus 26ema) and MACD signal line (9ema of MACD line) in order to generate a completely seperate buy/sell signal. The two buy/sell signals are combined into a hybrid buy/sell/hold indicator which looks for one, neither, or both signals to be "buys." If both signals are buys (fast crossed above slow), a "buy" signal is given (green bar color). If only one signal is a buy, a "hold" signal is given (yellow bar color). If neither signal is a buy, a "sell" signal is given (red bar color). Note: MACD moving averages crossing over is the same thing as the MACD line crossing the zero level in the MACD indicator.
It makes sense to have the MACD indicator loaded as a reference when using this but it isn't required. The lines plotted on the chart are the 12ema and a signal line which is the MACD signal line shown relative to the 12ema rather than the MACD line. The 26ema is not plotted on the chart because the chart becomes cluttered, plus the moving averages crossing over is indicated with the MACD indicator.
This indicator should be used with other indicators such as ATR (1), RSI (14), Bollinger bands (20, 2), etc. in order to determine the best course of action when a signal is given. One way to use this as a strict system is to take a neutral cash position when a yellow "hold" signal is given, to go long when a
green "buy" signal is given, and to go short when a red "sell" signal is given. It can be observed that for many tickers and timeframes that green-yellow-green and red-yellow-red sequences are stronger signals than green-yellow-red and red-yellow-green signals.
Note: Chart type must be "bars" in order for the bar colorization to work properly
RSX-D [ID: AC-P]The "AC-P" version of Jaggedsoft's RSX Divergence and Everget's RSX script is my personal customized version of RSX with the following additions and modifications:
LSMA-D line that averages in three LSMA components to form a composite, the LSMA-D line. Offset for the LSMA-D line is set to -2 to offset latency from averaging togther the LSMA components to form a composite - recommended to adjust to your timeframe and asset/pair accordingly.
Divergence component from JustUncle, RicardoSantos, and Neobutane divergence scripts
Crossover indication and alerts for Midline, and custom M1 and M2 levels for both RSX and the LSMA-D line from Daveatt's CCI Stochastic Script
EMA21/55 zone cross highlighting option
SMA9/EMA45 MA option from my RSI sma/ema Cu script
Libertus Divergences and Pivot labels from Jaggedsoft's RSX Divergence script are hidden/off by default
Designed for darkmode by default. Minor visual changes from Jaggedsoft's and Everget's script(s) for darkmode and visual aesthetic.
Please Note:
Divergences that use fractal-based detection logic, offset, or a combination of both generally have a 1-2 bar/candle lag. This is an INHERENT limitation of divergence detection with fractals and offsets. Divergences generally will have a higher strikerate on HTF than LTF due to the 1-2 bar lag. While I'm not going to rule out a programming solution or math construct/formula that attempts to alleivates the 1-2 bar lag for divergences, this script is not it - please keep that in mind when using divergence components with a fractal base and offset.
LSMA-D is a composite of three LSMA lines, all with offset options. Different lengths and Offset values can compensate/adjust for the smoothing/latency from RSX, but only up to a certain point. For each LSMA, the least square regression line is calculated for the previous time periods, so the idea is that with finely tuned adjustments, you can get crossover/crossunder signals from the RSX with the LSMA-D line that you simply can't get with the SMA9/EMA45 due to the already smoothed RSX.
The defaults for the RSX and various components for the LSMA-D here will MOSTLY LIKELY NOT WORK OR BE APPLICABLE to every timeframe and asset that you trade - adjust, backtest, and test accordingly. The defaults are here are MEANT to be adjusted to the asset class and timeframe that you are trading.
If you're not familiar with the LSMA, tradingview author Alexgrover has a few great scripts that go into detail how the LSMA works, in addition to different interpretations and implementations of the LSMA.
References/Acknowledgements:
//@version=4
// Copyright (c) 2019-present, Alex Orekhov (everget)
// Jurik RSX script may be freely distributed under the MIT license.
//
//-------------------------------------------------------------------
// Acknowledgements:
//---- Base script:
// RSX Divergence — SharkCIA by Jaggedsoft
//
// Jurik Moving Average by Everget
//
//---- Divergences/Signals:
// Libertus RSI Divergences
//
// Price Divergence Dectector V3 by JustUncle
//
// Price Divergence Detector V2 by RicardoSantos
//
// Stochastic RSI with Divergences by Neobutane
//
// CCI Stochastic by Daveatt
//
//---- Misc. Reference:
// RSI SMA/EMA Cu by Auroagwei
//
// CBCI Cu by Auroagwei
//
// Chop and explode by fhenry0331
//
// T-Step LSMA by RafaelZioni
//
// Scripts by Jaggedsoft for structure and formatting
// Scripts by Everget for structure and formatting
//-------------------------------------------------------------------
// RSX-D v08
// Author: Auroagwei
// www.tradingview.com
//-------------------------------------------------------------------
Function : Stochastic Money Flow IndexThis function is similar to the stochastic rsi function.
The only difference is that Money Flow Index is used instead of rsi.
Oversold and overbought values were changed to 80 and 20.
Because the MFI's overbought and overbought zones are 20 and 80.
In MFI, I think that it can be more beneficial in liquid markets than stochastic rsi since volume is taken into account in contrast to RSI.
Regards.