balipour

Reverse Stochastic [BApig Gift]

balipour Premium Telah dikemaskini   
Reverse Indicator calculation: Oscillators value output are calculated based on the input price (open, high, low or close). This means certain input price can generate the according to the output value of the oscillator. They are both sides of an equation, the process is reversible. Once we know one side of the equation, we can get the value of the other side. We can turn any oscillator into a moving average like indicator on price. This indicator is the reverse calculation of stochastic oscillator. They provide users the exact price level input needed for the stochastic to reach a certain value (crossover, oversold, overbought).

█ REASONS WHY WE PUBLISH THIS:

1. Background. @Motgench was the first to introduce the idea of a reverse stochastic coded in Pinescript.
We have decided to release our reverse stoch 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 stoch calculations that we didn't mention before. We have found that there are different approaches to calculate reverse stochastic . You can set the %K = %D when it crosses, or you can decompose %D into sma (%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 Stochastic . 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 stoch value may produce errors. The main reason is that stochastic 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 stoch 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 Stoch 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 RSI 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 stochastic 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 stochastic with another cool indicator. We will be releasing paid script for free every Christmas.

Merry Christmas.

═════════════════════════════════════════════════════════════════════════
The Rest is Similar to the invite only script descriptions:

Crossover:

Overbought

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 stochastic .

However, we found due to stochastic 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 stochastic 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 stochastic 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 stochastic cross
When they actually crossed

All stochastic 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 stochastic concept on reverse stochastic . 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 Stoch Forecast VS Reverse Stoch Original

Reverse Stoch Forecast leads Reverse Stoch Current one bar ahead

One bar before stoch 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 stochastic K,D and smooth length

"Show stochastic cross value panel" and "Show overbought and oversold Panel" allows users to display or hide a panel with stoch crossing or overbought and oversold price.

"Overbought and Oversold Style" changes the display of the overbought and oversold price of stochastic .

Option "Line Levels" plots horizontal lines of the price when stochastic K reaches overbought and oversold level.

Option "Bands" plots the historical running value of the price when stochastic 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 stochastic (Default is 80 and 20).

"Stoch Cross Smoothing" enables users to smooth out the reverse stochastic . It turns the reverse stoch into a close to moving average smooth filter.
User can adjust the length of smoothing to change the smoothness of the filter.

"Plot Stoch Historical Value" the stochastic value when it crosses in the past on the running reverse stoch .
User can choose the display K or D value when it crosses.

"Plot Crossing Circles" plots circles on the reverse stoch when stoch 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.
Nota Keluaran:
Added Warning Crosses For When it's impossible to cross over the stochastic oscillator to the other side.
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.
Nota Keluaran:
Fixed Chart Descriptions

Banned because we made all the math phobic line drawing TA idiots suffering from Apophenia here look way dumber than they would like to appear (to all normal people who have yet to realize the depth of their stupidity & the degree of their horribleness).
Skrip sumber terbuka

Dalam semangat TradingView yang sebenar, penulis skrip ini telah menerbitkannya dengan menggunakan sumber terbuka supaya pedagang-pedagang dapat memahami dan mengesahkannya. Sorakan kepada penulis! Anda dapat menggunakannya secara percuma tetapi penggunaan semula kod ini dalam penerbitan adalah dikawalselia oleh Peraturan Dalaman. Anda boleh menyukainya untuk menggunakannya pada carta.

Penafian

Maklumat dan penerbitan adalah tidak dimaksudkan untuk menjadi, dan tidak membentuk, nasihat untuk kewangan, pelaburan, perdagangan dan jenis-jenis lain atau cadangan yang dibekalkan atau disahkan oleh TradingView. Baca dengan lebih lanjut di Terma Penggunaan.

Ingin menggunakan skrip ini pada carta?