Resampling Reverse Engineering Bands [DW]

This is an experimental study designed to reverse engineer price levels from centered oscillators at user defined sample rates.
This study aims to educate users on the process of oscillator reverse engineering, and to give users an alternative perspective on some of the most commonly used oscillators in the trading game.

Reverse engineering price levels from an oscillator is actually a rather simple, straightforward process.
Rather than plugging price values into a function to solve for oscillator values, we rearrange the function using some basic algebraic operations and plug in a specified oscillator value to solve for price values instead.
This process tells us what price value is needed in order for the oscillator to equal a certain value.
For example, if you wanted to know what price value would be considered “overbought” or “oversold” according to your oscillator, you can do that using this process.

In this study, the reverse engineering functions are used to calculate the price values of user defined high and low oscillator thresholds, and the price values for the oscillator center.
This allows you to visualize what prices will trigger thresholds as a sort of confidence interval, which is information that isn't inherently available when simply analyzing the oscillator directly.

This script is equipped with three reverse engineering functions to choose from for calculating the band values:
-> Reverse Relative Strength Index (RRSI)
-> Reverse Stochastic Oscillator (RStoch)
-> Reverse Commodity Channel Index (RCCI)
You can easily select the function you want to utilize from the "Band Calculation Type" dropdown tab.

These functions are specially designed to calculate at any sample rate (up to 1 bar per sample) utilizing the process of downsampling that I introduced in my Resampling Filter Pack.
The sample rate can be determined with any of these three methods:
-> BPS - Resamples based on the number of bars.
-> Interval - Resamples based on time in multiples of current charting timeframe.
-> PA - Resamples based on changes in price action by a specified size. The PA algorithm in this script is derived from my Range Filter algorithm.
The range for PA method can be sized in points, pips, ticks, % of price, ATR, average change, and absolute quantity.

Utilizing downsampled rates allows you to visualize the reverse engineered values of an oscillator calculated at larger sample scales.
This can be rather beneficial for trend analysis since lower sample rates completely remove certain levels of noise.
By default, the sample rate is set to 1 BPS , which is the same as bar-to-bar calculation. Feel free to experiment with the sample rate parameters and configure them how you like.

Custom bar colors are included as well. The color scheme is based on disparity between sources and the reverse engineered center level.

In addition, background highlights are included to indicate when price is outside the bands, thus indicating "overbought" and "oversold" conditions according to the thresholds you set.

I also included four external output variables for easy integration of signals with other scripts:
-> Trend Signals (Current Resolution Prices) - Outputs 1 for bullish and -1 for bearish based on disparity between current resolution source and the central level output.
-> Trend Signals (Resampled Prices) - Outputs 1 for bullish and -1 for bearish based on disparity between resampled source and the central level output.
-> Outside Band Signal (Current Resolution Prices) - Outputs 1 for overbought and -1 for oversold based on current resolution source being outside the bands. Returns 0 otherwise.
-> Outside Band Signal (Resampled Prices) - Outputs 1 for overbought and -1 for oversold based on resampled source being outside the bands. Returns 0 otherwise.
To use these signals with another script, simply select the corresponding external output you want to use from your script's source input dropdown tab.

Reverse engineering oscillators is a simple, yet powerful approach to incorporate into your momentum or trend analysis setup.
By incorporating projected price levels from oscillators into our analysis setups, we are able to gain valuable insights, make (potentially) smarter trading decisions, and visualize the oscillators we know and love in a totally different way.

I hope you all find this script useful and enjoyable!
إزالة من البرامج النصية المفضلة أضف إلى البرامج النصية المفضلة
For my full list of premium tools, check the blog:

Reach out on Telegram:


This publication is now featured in our Editors' Picks. In the name of all TradingView traders, thank you for your valuable contribution to the TradingView community, and congrats!
+3 رد
Thanks, so cool and useful.
+3 رد
You are the best!
+3 رد
Great script!
Really to the point and well explained!

Gr, JD.
+3 رد
@Duyck, Thanks man. I'm glad you like it!
+1 رد
Big Thanks for your nice indicator.really enjoy to use it, wishes your success.
+2 رد
Wonderful god gifted creation... you don't need any indicator, only price action, worth a million dollar. Also if you can make a small guidance note on how to trade, that would help many
+2 رد
@sg2019, The way you trade with this ultimately depends on your style. There are many ways to integrate it with your setup. There isn't a "one size fits all" solution for trading with this.

Play with the indicator. Experiment with it and take advantage of what you find to be useful for your trade setups.
+1 رد
sg2019 DonovanWall
@DonovanWall, if you can supplement this tool in a short video, that would help many
Thanks for your work! Time to build some puzzles with it :D
+2 رد
الصفحة الرئيسية منصة الأسهم منصًة العملات منصّة العملات الرقمية جدول الأعمال الاقتصادي كيف تعمل مميزات الرسم البياني أسعار العضوية إحالة صديق قوانين الموقع مركز المساعدة حلول المواقع الإلكترونية والوسطاء الأدوات حلول الرسوم البيانية مكتبة الرسوم البيانية صغيرة الحجم المدوّنة والأخبار تويتر
ملف التعريف إعدادات الصفحة الشخصية الحساب وإعداد الفواتير الأصدقاء المُحالون العملات الافتراضية تذاكر الدعم الخاصة بي مركز المساعدة التحاليل المنشورة المتابعين تُتابع رسالة خاصة المحادثة تسجيل الخروج