0% found this document useful (0 votes)
24 views2 pages

Super Bollinger Bands Different Colour

Uploaded by

Flo Mar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
24 views2 pages

Super Bollinger Bands Different Colour

Uploaded by

Flo Mar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

//@version=5

indicator(shorttitle='Super Bollinger Bands', title='Super Bollinger Bands',


overlay=true, timeframe='')

// SETTINGS
src = input(close, title='Source')
length = input.int(34, minval=1, title='Bollinger Bands Length')
len = input.int(9, minval=1, title='Trend Line Period')
Periods = input(title='ATR Period', defval=1)
Multiplier = input.float(title='ATR Multiplier', step=0.1, defval=0.9)
mult = input.float(1.750, minval=0.001, maxval=50, title='Dev')
offset = input.int(0, 'Offset', minval=-500, maxval=500)
changeATR = input(title='Change ATR Calculation Method ?', defval=true)
showsignals = input(title='Show Buy/Sell Signals ?', defval=true)
highlighting = input(title='Highlighter On/Off ?', defval=true)

// BOLLINGER BANDS
basis = ta.sma(src, length)
dev = mult * ta.stdev(src, length)
upper = basis + dev
lower = basis - dev
p1 = plot(upper, 'OverBought', color=color.new(#f70606, 0), offset=offset)
p2 = plot(lower, 'OverSold', color=color.new(color.lime, 0), offset=offset)
fill(p1, p2, title='RangeColor', color=color.new(color.purple, 90))

// SMA
smma = 0.0
smma := na(smma[1]) ? ta.ema(src, len) : (smma[1] * (len - 1) + src) / len
plot(smma, 'TrendLine', color=color.new(#ff9800, 0))

// Average True Range


atr2 = ta.sma(ta.tr, Periods)
atr = changeATR ? ta.atr(Periods) : atr2
up = src - Multiplier * atr
up1 = nz(up[1], up)
up := close[1] > up1 ? math.max(up, up1) : up
dn = src + Multiplier * atr
dn1 = nz(dn[1], dn)
dn := close[1] < dn1 ? math.min(dn, dn1) : dn
trend = 1
trend := nz(trend[1], trend)
trend := trend == -1 and close > dn1 ? 1 : trend == 1 and close < up1 ? -1 : trend

// Señales con vela previa de color diferente


previous_is_green = close[1] > open[1]
previous_is_red = close[1] < open[1]

buySignal = showsignals and previous_is_red and trend == 1 and trend[1] == -1


plotshape(buySignal ? up : na, title='Buy', text='Buy', location=location.belowbar,
style=shape.triangleup, size=size.tiny, color=color.new(color.green, 20),
textcolor=color.new(color.white, 20))

sellSignal = showsignals and previous_is_green and trend == -1 and trend[1] == 1


plotshape(sellSignal ? dn : na, title='Sell', text='Sell',
location=location.abovebar, style=shape.triangledown, size=size.tiny,
color=color.new(color.red, 20), textcolor=color.new(color.white, 20))

mPlot = plot(ohlc4, title='', style=plot.style_linebr, linewidth=0, transp=100)


upPlot = plot(trend == 1 ? up : na, style=plot.style_linebr, linewidth=0,
color=color.new(color.green, 100))
dnPlot = plot(trend == 1 ? na : dn, style=plot.style_linebr, linewidth=0,
color=color.new(color.red, 100))

longFillColor = highlighting ? trend == 1 ? color.green : color.green : color.green


shortFillColor = highlighting ? trend == -1 ? color.red : color.red : color.red
fill(mPlot, upPlot, title='Buying Trend Highligter', color=longFillColor,
transp=70)
fill(mPlot, dnPlot, title='Selling Trend Highligter', color=shortFillColor,
transp=70)

// Buy & Sell Alert Settings


alertcondition(buySignal, title='Buy', message='BUY - {{ticker}}, {{interval}},
Entry={{open}}, SL={{low}}, TP={{high}}, Secure=20Pips, Make Profit=50Pips, Trade
Goal=100Pips')
alertcondition(sellSignal, title='Sell', message='SELL - {{ticker}}, {{interval}},
Entry={{open}}, SL={{high}}, TP={{low}}, Secure=20Pips, Make Profit=50Pips, Trade
Goal=100Pips')
changeCond = trend != trend[1]

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy