█ REASONS WHY WE PUBLISH THIS:
1. Background. @Motgench was the first to introduce the idea of a reverse coded in Pinescript.
We have decided to release our reverse for free to protect people from paying for a bad copy and being misled by people with bad intentions. We also want to prove that this is not a competition of sales; just us trying to do the right thing for the community.
2. A new approach. After discussions with @Wugamlo, we found some problems in the reverse calculations that we didn't mention before. We have found that there are different approaches to calculate reverse . You can set the %K = %D when it crosses, or you can decompose %D into (%K) on the right side. So, we added Wugamlo's approach to this indicator. The current KD dynamic is when %K = %D, so it may stick closer to price and more reactive in real-time. The current KD static is when we decompose the %D, and it is more accurate in historical calculations.
3. Issues with the Reverse . One of the important reasons why we decided to not charge people for this script is because we discovered that no matter which approach we took, the reverse value may produce errors. The main reason is that calculation depends not only on closing price, but also high-low . For example, when the reverse value creates a higher-high or higher-low, the original calculation in the reverse doesn't update to that high or low, so even if the price reaches that point, it might not cross. Therefore, the calculation of Reverse may be unstable and sometimes gives false values, particularly when you see very high or low value overshoot. It may work better when a cross is near.
For Reverse and Reverse Wavetrend, the issues described above don’t apply because we calculate them based on the closing price. Reverse Fisher is subtly affected but it sticks with price more closely so the effect is not significant.
We decided the is not a suitable indicator for reverse engineering, and we don't recommend people blindly read it and trust its value.
4. Christmas is near. This script is a gift to the community. For the people who bought our traditional revolution package, we will replace the reverse with another cool indicator. We will be releasing paid script for free every Christmas.
The Rest is Similar to the invite only script descriptions:
We provide two ways of reverse calculation. Current reverse value and forecasted value.
Current K and Current D option is just the simple reverse calculation of .
However, we found due to oscillator’s calculation (based on high, low and close), the indicator repaints or update value too much. For example, when price moves up, the reverse value also moves up a lot, it’s too reactive to the current price. So we made the reverse even better by forecasting the value by the open of next bar. This makes the indicator much more stable to the current price and allows you to anticipate the crossing of the oscillator one step ahead.
Even though it's "forecast", it's just simple math trick. The value of oscillator is calculated by the length of the sample size. When it does the calculation on the next bar, it will erase the last bar in the sample and add a new bar which equals to the one bar ago closing price. By moving all the data of price forward by one bar we produce a 100% accurate forecast of the value the indicator will produce by the closing of the current bar or open of next bar.
One usage of Using Forecast K and Forecast D is that you can anticipate the turning point one bar ahead:
One Bar before the actual cross
When they actually crossed
All display, The forecast K and D leads the current K and D by one bar, it's almost like one bar offset ahead.
Now we can apply this forecast VS original concept on reverse . It makes even more impact . It reduces lag and overshoot. It's also more stable to changes in the current price. So the reversal price value won't change too much intrabar.
Reverse Forecast VS Reverse Original
Reverse Forecast leads Reverse Current one bar ahead
One bar before cross
After they both cross
Our recommendation in K,D options:
For people who want to anticipate turning point earlier, they should use forecast K and forecast D options.
For people who like more confirmation, they should use current K and current D options. (Static more stable and accurate in history, Dynamic more reactive in real time)
Warning: For forecast value, even though its 100% accurate. The value can still change due to the next bar value. Eg: Current Bar close below forecast level, the next bar can close above to reverse the result.
Settings functions explanation:
K,D, and Smooth length is the same as K,D and smooth length
"Show cross value panel" and "Show overbought and oversold Panel" allows users to display or hide a panel with crossing or overbought and oversold price.
"Overbought and Oversold Style" changes the display of the overbought and oversold price of .
Option "Line Levels" plots horizontal lines of the price when K reaches overbought and oversold level.
Option "Bands" plots the historical running value of the price when K reaches overbought and oversold level. The user should tick off log display of the chart when they choose "Bands" option.
'Line Levels" and "Bands" have the same current value just different displays.
User can choose to plot or hide the overbought and oversold price by ticking and unticking the "plot overbought price" and "plot oversold price"
They can also adjust the oversold and overbought value of (Default is 80 and 20).
"Stoch Cross Smoothing" enables users to smooth out the reverse . It turns the reverse into a close to moving average smooth filter.
User can adjust the length of smoothing to change the smoothness of the filter.
"Plot Historical Value" the value when it crosses in the past on the running reverse .
User can choose the display K or D value when it crosses.
"Plot Crossing Circles" plots circles on the reverse when crosses.
There's a bug in Tradingview label system. When the background of the label is transparent, the text will get burry when we scroll in and out on the chart. When this happens, changing any settings on the panel could refresh the text display. It could also be avoided by ticking the "dark background" setting to make the background not transparent.
For prices that require more decimal places, users can type in the decimals places they want in the “decimal” setting.
Added stepline function
As we mentioned above, there's some serious limitations about reverse stochastic. Because when price reaches the reverse stoch value, the stochastic does not always cross.
There's a limit for stochastic value. We know the highest value for %K before smooth is 100 and lowest value is 0.
After smoothing of %K and %D. The max and min value range for stoch is even smaller.
The reverse stochastic indicator is only accurate if the value it provides doesn't create a new high or new low in price.
When there's a new high in price in the lookback period we choose, the stoch k = 100. When there's a new low in price, stoch k = 0.
For %K the highest value it can get after smooth is k + k + ... k / smoothk. And k = 100 when the value is max.
MaxK = 100 + k + k + ... k / smoothk
MinK = 0 + k + k + ... k / smoothk
%D is the smoothed %K. Therefore it also has a limit.
MaxD = MaxK + %k + %k + ... %k / smoothD
MinD = MinK + %k + %k + ... %k / smoothD
So when there's a new high in price, we know the value of MaxK and MaxD, MinK and MinD.
If MaxK < MaxD, then it's impossible for K to cross up above D
If MinK < MinD, then it's impossible for K to cross below D
This Chart Displays when there's impossible cross
the Panel under is displaying maxK, maxD, minK and MinD
The green background means the reverse stoch value creates new high, the red background means the reverse stoch value creates new low
The 0 and 1 blue lines displays the impossible cross situation. 1 means impossible, 0 means possible.
As you can see, most of the time when reverse stoch creates a new high or low in price, the stoch is impossible to cross
You can also see from the chart. The impossible cross situation which is displayed by yellow crosses happens quite often. In fact, we backtest the resutls. It happens about 30% of the time. That's why the reverse stoch function calculation is highly unstable and it may give the wrong value when it's actually impossible for stoch to reverse. Make sure you read the descriptions, use the correct version and have a deep understanding of the reverse stoch calculation before you use.
Sign up on our website to get access to our indicators.
Join Our Discord for further discussions:
In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in a publication is governed by House Rules. You can favorite it to use it on a chart.