MultiTimeFrame Stochastic
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © biswasdebasish9475

//@version=5
indicator("MultiTimeFrame Stochastic", shorttitle ="MTF_Stoch")

higher_timeframe = input.timeframe(title="Higher_Timeframe",  defval="D")
fast_stoch = input(15, title = "Stochastic Period", group = "HTF_STOCHASTIC")
medium_stoch = input(30, title = "Stochastic Period", group = "HTF_STOCHASTIC")
slow_stoch = input(70, title = "Stochastic Period", group = "HTF_STOCHASTIC")
too_slow_stoch = input(116, title = "Stochastic Period", group = "HTF_STOCHASTIC")

fast_current = input(15, title = "Stochastic Period", group = "current_STOCHASTIC")
medium_current = input(30, title = "Stochastic Period", group = "current_STOCHASTIC")
slow_current = input(70, title = "Stochastic Period", group = "current_STOCHASTIC")
too_slow_current = input(116, title = "Stochastic Period", group = "current_STOCHASTIC")
overBrought = input(90, "OB",group = "OVERBOUGHT BAND", inline = "xx", tooltip ="RedBand")
overBrought2 = input(99, "OB2",group = "OVERBOUGHT BAND", inline = "xx",tooltip ="RedBand")
overSold = input(10, "OS",group = "OVERSOLD BAND", inline = "x")
overSold2 = input(1, "OS2",group = "OVERSOLD BAND", inline = "x",tooltip ="GreenBand")
//-----------------------------------------------------------------------------------------------
//-----------------------------------------------------------------------------------------------
faststoch = request.security(syminfo.tickerid, higher_timeframe, ta.stoch(close, high,low, fast_stoch),gaps = barmerge.gaps_on)
mediumstoch = request.security(syminfo.tickerid, higher_timeframe, ta.stoch(close, high,low, medium_stoch),gaps = barmerge.gaps_on)
slowstoch = request.security(syminfo.tickerid, higher_timeframe, ta.stoch(close, high,low, slow_stoch),gaps = barmerge.gaps_on)
tooslowstoch = request.security(syminfo.tickerid, higher_timeframe, ta.stoch(close, high,low, too_slow_stoch),gaps = barmerge.gaps_on)

fastcurrent = ta.stoch(close, high, low, fast_current)
mediumcurrent = ta.stoch(close, high, low, medium_current)
slowcurrent = ta.stoch(close, high, low, slow_current)
tooslowcurrent = ta.stoch(close, high, low, too_slow_current)
plot (faststoch, title= "Fast Stoch HTF", color = color.new(color.red,0), linewidth =2)
plot (mediumstoch, title= "Medium Stoch HTF", color = color.new(color.green,0), linewidth =2)
plot (slowstoch, title= "Slow Stoch HTF", color = color.new(color.blue,0), linewidth =2)
plot (tooslowstoch, title= "Too Slow Stoch HTF", color = color.new(color.gray,0), linewidth =2)

plot (fastcurrent, title= "Fast Current", color = color.new(color.red,0))
plot (mediumcurrent, title= "Medium Current", color = color.new(color.green,0))
plot (slowcurrent, title= "Slow Current", color = color.new(color.blue,0))
plot (tooslowcurrent, title= "Too Slow Current", color = color.new(color.gray,0))
lineOB = plot (overBrought, title= "overBought", color = color.new(color.red,100))
lineOB2 = plot (overBrought2, title= "overBought2", color = color.new(color.red,100))
fill(lineOB, lineOB2, color= color.new(color.red,70))
lineOS = plot (overSold, title= "overSold", color = color.new(color.green,100))
lineOS2 = plot (overSold2, title= "overSold2", color = color.new(color.green,100))
fill(lineOS, lineOS2, color = color.new(color.green,70))
