OPEN-SOURCE SCRIPT

# Hybrid Overbought/Oversold Overlay

Introduction

This is a new representation of my well-known oscillator
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!
hybridOscillatorsoverbought-oversold

## 오픈 소스 스크립트

진정한 TradingView 정신에 따라, 이 스크립트의 저자는 트레이더들이 이해하고 검증할 수 있도록 오픈 소스로 공개했습니다. 저자에게 박수를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 출판물에서 이 코드를 재사용하는 것은 하우스 룰에 의해 관리됩니다. 님은 즐겨찾기로 이 스크립트를 차트에서 쓸 수 있습니다.