OPEN-SOURCE SCRIPT

Stochastic with Divergences

Reuploading as there was an issue with the description.
This indicator uses the popular Stochastic indicator as its base. I have included the ability to draw divergences on the indicator as they occur live. By default it will be off, select the settings for the indicator and about halfway down there will be a dropdown menu that says "Off". Select it and then select which divergences you want to draw: Regular, Hidden, or Both. I like to draw both. I find that hidden divergence is really nice during a trending market and the regular divergence is works great in a range market. I also feel that the regular divergence is great during a trending market if you are given the signal but then wait for the next price movement for a double top/bottom to occur. The Stochastic indicator itself is often used in a ranging market by selling when it is overbought and buying once it indicates oversold (much like the RSI indicator). I find that it can work in trending markets if you only take overbought in a down trend and oversold in an up trend. In the above picture you can see that I had used it to trade this downtrend using both the Hidden Divergence and Sell Signals to catch the trend continuation until it failed on the fourth trade. From here I would usually start using the Stochastic as simply an oscillating indicator and buy/sell based on overbought/oversold. I've also added an option to enable the Stochastic RSI if you'd rather use that, as well as a fill option which simply colors in the space between the Stochastic and Signal lines. The Signals option will put on highlights of when to buy or sell based on overbought/oversold areas that agree with the long term trend (based on the 200 EMA).

Divergence is a short way of saying there was a higher or lower movement compared to normal but the price did not represent that movement, indicating strength or weakness in a specific direction.
Regular divergence is an indication of a trend reversal. Regular bullish divergence occurs when the price chart shows a lower low while the stochastic shows a higher low. Regular bearish divergence occurs when the price chart shows a higher high while the stochastic shows a lower high.
Hidden divergence is an indication of a trend continuation. Hidden bullish divergence occurs when the price chart shows a higher low while the stochastic shows a lower low. Hidden bearish divergence occurs when the price chart shows a lower high while the stochastic shows a higher high.

The "Only Trending Divergences" option, if enabled, will only show bearish divergences during a down trend (price is below 200 EMA) and only show bullish divergences during an uptrend (price is above 200 EMA). I like to use this option and have set it to ON by default.
The "Middle Filter" option, if enabled, ensures that Highs on the stochastic indicator will not be counted as Highs unless they are above the middle value of the oscillator (which is 50), same goes for lows: they will not be counted as Lows unless they are below the middle value of the oscillator.


I also include buy/sell signals that coincide with the trend (based on the 200 EMA). If price is currently below the 200 EMA and the stochastic indicator is overbought (over 80), you can get a sell signal when it the blue line crosses down below 80. This sell signal shows that you are in a down trend and the price just was overbought but is now likely to continue pushing downwards. The opposite works for buy signals: Above 200 EMA, stochastic goes below 20, when it crosses above 20 it will show a green highlight to indicate price is likely to push upwards.

I think the default options are likely the best to use. The only one I tend to change on occasion is the "Pivots to look back" which I adjust usually to either 1 or 3.

Stochastic Oscillatorstochasticdivergencestochasticoscillatorstochastic-rsiStochastic RSI (STOCH RSI)

Skrip open-source

Dengan semangat TradingView yang sesungguhnya, penulis skrip ini telah menerbitkannya sebagai sumber terbuka, sehingga para trader dapat memahami dan memverifikasinya. Hormat untuk penulisnya! Anda dapat menggunakannya secara gratis, namun penggunaan kembali kode ini dalam publikasi diatur oleh Tata Tertib. Anda dapat memfavoritkannya untuk digunakan pada chart

Inggin menggunakan skrip ini pada chart?

Pernyataan Penyangkalan