AlexeyFirsov

ForNataly 1.0.1

Binguru Indicator
Remove from Favorite Scripts Add to Favorite Scripts
study(title="ForNataly", shorttitle= "ForNataly", overlay=true)

bf_spread = 0.0000
bf_period = 10 //период Болли
bf_period20 = 40 //период Болли
bf_stddev = 2
bf_profit = 0.1
bf_rsi = 40
bf_rsi_inner = 0

bf_middle = sma(close, bf_period)
bf_20 = sma(close, bf_period20)
rsi_ = rsi(close, 14)
st = stoch(close, high, low, 25)
bf_top = bf_middle + (stdev(close, bf_period) * bf_stddev)
bf_bottom = bf_middle - (stdev(close, bf_period) * bf_stddev)
bf_height = ((high + bf_spread) - (low - bf_spread)) * bf_profit
bf_short_entry = low - bf_spread
bf_short_stop = high + bf_spread
bf_short_exit = bf_short_entry - bf_height

bf_long_entry = high + bf_spread
bf_long_stop = low - bf_spread
bf_long_exit = bf_long_entry + bf_height

bf_long = close < bf_middle ? (close > bf_bottom ? true : false) : false
bf_short = close > bf_middle ? (close < bf_top ? true : false) : false

bf_lowest = low == lowest(bf_period / 2) ? ( low < bf_bottom ? true : false ) : false
bf_highest = high == highest(bf_period / 2) ? ( high > bf_top ? true : false ) : false

bf_rsi_long = rsi(close, 20) > (50 + bf_rsi_inner) ? (rsi(close, 20) < (50 + bf_rsi) ? true : false) : false
bf_rsi_short = rsi(close, 20) < (50 - bf_rsi_inner) ? (rsi(close, 20) > (50 - bf_rsi) ? true : false) : false
bf_go_long = bf_long ? ( bf_lowest ? ( bf_long_exit < (bf_middle - bf_spread) ? (bf_rsi_short ? true : false) : false ) : false ) : false
bf_go_short = bf_short ? ( bf_highest ? ( bf_short_exit > (bf_middle + bf_spread) ? (bf_rsi_long ? true : false) : false ) : false ) : false
bf_enter = bf_go_long ? bf_long_entry : ( bf_go_short ? bf_short_entry : bf_enter[1] )
bf_exit = bf_go_long ? bf_long_exit : ( bf_go_short ? bf_short_exit : bf_exit[1] )
bf_stop = bf_go_long ? bf_long_stop : ( bf_go_short ? bf_short_stop : bf_stop[1] )
//plot(bf_enter == bf_enter[bf_period] ? na : bf_enter, title="Entry", color=blue, style=circles, linewidth=2)
StochAndRSIup = rsi_>70 and st >80
StochAndRSIdown = rsi_ <30 and st <20


barcolor(StochAndRSIup   ? yellow : na)
barcolor(StochAndRSIdown  ? yellow : na)

//////////////////////////////////////////////////////////////////////
//Считаем стохастика
len = 14
smoothK = 3
smoothD = 3
upLine = 90
lowLine = 20

sbc = true
sbh = false 
sch = false
sl = true
sac = false
sacl = false

//Stoch formula
k = sma(stoch(close, high, low, len), smoothK)
d = sma(k, smoothD)

//Necessary for Highlight Bars
aboveLine = k > upLine ? 1 : 0
belowLine = k < lowLine ? 1 : 0 

//Only Necessary if you want you want Stochastic Croses
//Definition for Cross when Above High-Low lines
crossUp = (k[1] < d[1] and k[1] < lowLine[1]) and (k > d)  ? 1 : 0
crossDn = (k[1] > d[1] and k[1] > upLine[1]) and (k < d) ? 1 : 0

//Only Necessary if you want you want Stochastic Croses
//Definition for Cross that doesn't have to be above or below High and Low line.
crossUpAll = (k[1] < d[1] and k > d) ? 1 : 0
crossDownAll = (k[1] > d[1] and k < d) ? 1 : 0

overBought() => sbc and aboveLine 
overSold() => sbc and belowLine 

resStochUp = sl and crossUp
resStochDown = sl and crossDn

//plotchar(StochAndRSIup ? 1 : na, title="На продажу по RSI", char='↓', location=location.abovebar, color=blue, transp=0, offset=0)
//plotchar(StochAndRSIdown ? 1 : na, title="На покупку по RSI", char='↑', location=location.abovebar, color=blue, transp=0, offset=0)


finalUp = StochAndRSIup or  resStochUp
finalDown = resStochDown or StochAndRSIdown


plotchar(finalUp ? crossUp : na, title="Строгое соответствие на покупку", char='↑', location=location.belowbar, color=lime, transp=0, offset=0)
plotchar(finalDown ? crossDn : na, title="Строгое соответствие на продажу", char='↓', location=location.abovebar, color=red, transp=0, offset=0)

 



//plotchar(sacl and crossUpAll ? crossUpAll : na, title="Слабачок на продажу", char='↓', location=location.belowbar, color=lime, transp=0, offset=0)
//plotchar(sacl and crossDownAll ? crossDownAll : na, title="Слабачок на покупку", char='↑', location=location.abovebar, color=red, transp=0, offset=0)
///////////////////////////////////////////////////////////////////////






English
English (UK)
English (IN)
Deutsch
Français
Español
Italiano
Polski
Türkçe
Русский
Português
Bahasa Indonesia
Bahasa Melayu
ภาษาไทย
Tiếng Việt
日本語
한국어
简体
台灣
Home Stock Screener Forex Signal Finder Cryptocurrency Signal Finder Economic Calendar How It Works Chart Features House Rules Moderators Website & Broker Solutions Widgets Stock Charting Library Feature Request Blog & News FAQ Help & Wiki Twitter
Profile Profile Settings Account and Billing My Support Tickets Contact Support Ideas Published Followers Following Private Messages Chat Sign Out