Skip to content

Instantly share code, notes, and snippets.

@marianolatorre
Created October 23, 2024 07:50
Show Gist options
  • Save marianolatorre/8c8b9097e3ec93e885d0c2e5f2c94204 to your computer and use it in GitHub Desktop.
Save marianolatorre/8c8b9097e3ec93e885d0c2e5f2c94204 to your computer and use it in GitHub Desktop.
Pine script source code of the bull market support band
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © TheTradingParrot
//@version=5
indicator("TTP Bull Market Support band", overlay = true)
sma = request.security(syminfo.tickerid, "1W", ta.sma(close, 20))
ema = request.security(syminfo.tickerid, "1W", ta.ema(close, 21))
s = plot(sma, "sma",color= color.red,linewidth=2 )
e = plot(ema, "ema",color= color.green, linewidth=2)
c = ema < sma ? color.new(color.red, 50) : color.new(color.green, 50)
fill(s,e, c)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment