//10MA_KC_Ichimoku_BB_custom_s
//@version=5
indicator(title=”10MA_KC_Ichimoku_BB_custom_s”, shorttitle=”10MA_KC_Ichimoku_BB_custom_s”, overlay=true)
//10MAlines
MAMethod = input.string(title=”MA‚ÌŽí—Þ”, defval=”EMA”, options=[“EMA”,”SMA”], group=”10MAlines”)
ma_plt1 = input.int(title=”EMA20″, defval=20, minval=1, maxval=1000, group=”10MAlines”)
ma_plt2 = input.int(title=”EMA40″, defval=40, minval=1, maxval=1000, group=”10MAlines”)
ma_plt3 = input.int(title=”EMA50″, defval=50, minval=1, maxval=1000, group=”10MAlines”)
ma_plt4 = input.int(title=”EMA75″, defval=75, minval=1, maxval=1000, group=”10MAlines”)
ma_plt5 = input.int(title=”EMA200″, defval=200, minval=1, maxval=1000, group=”10MAlines”)
ma_plt6 = input.int(title=”EMA320″, defval=320, minval=1, maxval=1000, group=”10MAlines”)
ma_plt7 = input.int(title=”EMA800″, defval=800, minval=1, maxval=1000, group=”10MAlines”)
ma_plt8 = input.int(title=”EMA3200″, defval=3200, minval=1, maxval=5000, group=”10MAlines”)
ma_plt9 = input.int(title=”SMA50″, defval=50, minval=1, maxval=1000, group=”10MAlines”)
ma_plt10 = input.int(title=”SMA200″, defval=200, minval=1, maxval=1000, group=”10MAlines”)
ma1 = MAMethod == “EMA” ? ta.ema(close, ma_plt1) : ta.sma(close, ma_plt1)
ma2 = MAMethod == “EMA” ? ta.ema(close, ma_plt2) : ta.sma(close, ma_plt2)
ma3 = MAMethod == “EMA” ? ta.ema(close, ma_plt3) : ta.sma(close, ma_plt3)
ma4 = MAMethod == “EMA” ? ta.ema(close, ma_plt4) : ta.sma(close, ma_plt4)
ma5 = MAMethod == “EMA” ? ta.ema(close, ma_plt5) : ta.sma(close, ma_plt5)
ma6 = MAMethod == “EMA” ? ta.ema(close, ma_plt6) : ta.sma(close, ma_plt6)
ma7 = MAMethod == “EMA” ? ta.ema(close, ma_plt7) : ta.sma(close, ma_plt7)
ma8 = MAMethod == “EMA” ? ta.ema(close, ma_plt8) : ta.sma(close, ma_plt8)
ma9 = MAMethod == “SMA” ? ta.ema(close, ma_plt9) : ta.sma(close, ma_plt9)
ma10 = MAMethod == “SMA” ? ta.ema(close, ma_plt10) : ta.sma(close, ma_plt10)
plt1 = plot(ma1, color=color.new(#ffff00, 30), linewidth=1 ,style=plot.style_line, title=”10MA EMA20″)
plt2 = plot(ma2, color=color.new(#800000, 30), linewidth=1 ,style=plot.style_line, title=”10MA EMA40″)
plt3 = plot(ma3, color=color.new(#ff0000, 0), linewidth=2 ,style=plot.style_line, title=”10MA EMA50″)
plt4 = plot(ma4, color=color.new(#000080, 30), linewidth=1 ,style=plot.style_line, title=”10MA EMA75″)
plt5 = plot(ma5, color=color.new(#0000ff, 0), linewidth=2 ,style=plot.style_line, title=”10MA EMA200″)
plt6 = plot(ma6, color=color.new(#008000, 30), linewidth=1 ,style=plot.style_line, title=”10MA EMA320″)
plt7 = plot(ma7, color=color.new(#800080, 0), linewidth=2 ,style=plot.style_line, title=”10MA EMA800″)
plt8 = plot(ma8, color=color.new(#ffa500, 0), linewidth=2 ,style=plot.style_line, title=”10MA EMA3200″)
plt9 = plot(ma9, color=color.new(#ff0000, 0), linewidth=1 ,style=plot.style_circles, title=”10MA SMA50″)
plt10 = plot(ma10, color=color.new(#0000ff, 0), linewidth=1 ,style=plot.style_circles, title=”10MA SMA200″)
//KeltnerChannelsBands_custom_s
inputs_title = input(true, “Outer bands”, group=”KeltnerChannelsBands”)
length = input.int(13, minval=1, group=”KeltnerChannelsBands”)
mult = input(2.0, “Multiplier”, group=”KeltnerChannelsBands”)
src = input(close, title=”Source”, group=”KeltnerChannelsBands”)
atrlength = input(10, “ATR Length”, group=”KeltnerChannelsBands”)
inner_inputs_title = input(true, “Inner bands”, group=”KeltnerChannelsBands”)
inner_length = input.int(13, minval=1, group=”KeltnerChannelsBands”)
inner_mult = input(1.3, “Multiplier”, group=”KeltnerChannelsBands”)
inner_src = input(close, title=”Source”, group=”KeltnerChannelsBands”)
inner_atrlength = input(10, “ATR Length”, group=”KeltnerChannelsBands”)
ma = ta.ema(src, length)
plot(ma, color=color.new(#0000ff, 0), title=”KC EMA_length13″)
rangema = ta.rma(high – low, length)
upper = ma + rangema * mult
lower = ma – rangema * mult
u = plot(upper, color=color.new(#0000ff, 0), style=plot.style_line, title=”KC Upper_extreme”)
l = plot(lower, color=color.new(#0000ff, 0), style=plot.style_line, title=”KC Lower_extreme”)
inner_rangema = ta.rma(high – low, inner_length)
inner_upper = ma + inner_rangema * inner_mult
inner_lower = ma – inner_rangema * inner_mult
inner_u = plot(inner_upper, color=color.new(#6a5acd, 0), style=plot.style_circles, title=”KC Upper_band_1″)
inner_l = plot(inner_lower, color=color.new(#6a5acd, 0), style=plot.style_circles, title=”KC Lower_band_1″)
//Ichimoku Cloud
conversionPeriods = input.int(9, minval=1, title=”Conversion Line Periods”, group=”Ichimoku Cloud”)
basePeriods = input.int(26, minval=1, title=”Base Line Periods”, group=”Ichimoku Cloud”)
laggingSpan2Periods = input.int(52, minval=1, title=”Lagging Span 2 Periods”, group=”Ichimoku Cloud”)
displacement = input.int(26, minval=1, title=”Displacement”, group=”Ichimoku Cloud”)
donchian(len) =>
math.avg(ta.lowest(len), ta.highest(len))
conversionLine = donchian(conversionPeriods)
baseLine = donchian(basePeriods)
leadLine1 = math.avg(conversionLine, baseLine)
leadLine2 = donchian(laggingSpan2Periods)
plot(conversionLine, color=color.new(#0496ff, 0), title=”Conversion Line”)
plot(baseLine, color=color.new(#991515, 0), title=”Base Line”)
plot(close, offset=-displacement, color=color.new(#459915, 0), title=”Lagging Span”)
p1 = plot(leadLine1, offset=displacement, color=color.new(#008000, 0), title=”Lead 1″)
p2 = plot(leadLine2, offset=displacement, color=color.new(#ff0000, 0), title=”Lead 2″)
fill(p1, p2, color=leadLine1 > leadLine2 ? color.new(#008000, 90) : color.new(#ff0000, 90))
//Bollinger Bands
lengthBB = input.int(20, title=”BB Length”, minval=1, group=”Bollinger Bands”)
maTypeBB = input.string(“SMA”, “BB Basis MA Type”, options=[“SMA”, “EMA”, “SMMA (RMA)”, “WMA”, “VWMA”], group=”Bollinger Bands”)
srcBB = input(close, title=”BB Source”, group=”Bollinger Bands”)
multBB = input.float(2.0, title=”BB StdDev”, minval=0.001, maxval=50, group=”Bollinger Bands”)
offsetBB = input.int(0, “BB Offset”, minval = -500, maxval = 500, group=”Bollinger Bands”)
maBB(source, length, _type) => _type == “SMA” ? ta.sma(source, length) : _type == “EMA” ? ta.ema(source, length) : _type == “SMMA (RMA)” ? ta.rma(source, length) : _type == “WMA” ? ta.wma(source, length) : ta.vwma(source, length)
basisBB = maBB(srcBB, lengthBB, maTypeBB)
devBB = multBB * ta.stdev(srcBB, lengthBB)
upperBB = basisBB + devBB
lowerBB = basisBB – devBB
plot(basisBB, “BB Basis”, color=#FF6D00, offset = offsetBB)
p1BB = plot(upperBB, “BB Upper”, color=#2962FF, offset = offsetBB)
p2BB = plot(lowerBB, “BB Lower”, color=#2962FF, offset = offsetBB)
fill(p1BB, p2BB, title = “BB Background”, color=color.rgb(33, 150, 243, 95))