Valery85

перекупленности/перепроданности

22
перекупленности/перепроданности
Open-source script

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.

Disclaimer

The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.

Want to use this script on a chart?
study(title="Подсветка", shorttitle= "Подсветка", overlay=true)
// AUDCAD 70-80-28-10
//1 Часть. Подсвечиваем перекупленность/перепроданность, учитывая состояние RSI 14 и Stochastic.
cl = close
op = open
_high = high
_low = low
rsi_ = rsi(close, 14)
st = stoch(close, high, low, 25)
//Перекупленность: RSI >70, Stochastic > 80
rsiUP = input(title="Высокий RSI", type=integer, defval=70,  minval=10, maxval=100)
stUP = input(title="Перекупленность стохастика", type=integer, defval=80,  minval=30, maxval=100)
rsiDown = input(title="Низкий RSI", type=integer, defval=30,  minval=10, maxval=100)
stDown = input(title="Перепроданность стохастика", type=integer, defval=20,  minval=0, maxval=100)
StochAndRSIup = rsi_>rsiUP and st >stUP
//Перепроданность. RSI <30, , Stochastic <20
StochAndRSIdown = rsi_ <rsiDown and st <stDown
smoothK = 3
smoothD = 3
lengthRSI = 14
lengthStoch = 8
src = close
rsi1 = rsi(src, lengthRSI)
k = sma(stoch(rsi1, rsi1, rsi1, lengthStoch), smoothK)
d = sma(k, smoothD)
down = cross(k,d) and StochAndRSIdown[1]  and  k<stDown
up = cross(k,d) and StochAndRSIup[1] and k>stUP
barcolor( down  ?  yellow : na)
barcolor(up ? lime : na )