GBS
GBS
0
at https://mozilla.org/MPL/2.0/
// Join us https://t.me/simpleforextools
//@version=5
indicator(shorttitle='GBS', title='Gain Buy Sell', overlay=true)
// --- settings
ATRperiod = input.int(defval=5, title='ATR Period', minval=1)
BBperiod = input.int(defval=21, title='Bollinger Bands Period', minval=1)
BBdeviation = input.float(defval=1.00, title='Bollinger Bands Deviation',
minval=0.1, step=0.1)
UseATRfilter = input(defval=true, title='ATR Filter On/Off')
showsignals = input(title='Show Signals ', defval=true)
// --- end of settings
// ATR calculation
atrValue = ta.atr(ATRperiod)
// Signal initialization
var float EliteSignal = na
var int BBSignal = 0
// Determine BB signal
if (close > BBUpper)
BBSignal := 1
else if (close < BBLower)
BBSignal := -1
// Alerts
alertcondition(sell == 1, title="Sell", message="Gain Buy Sell Sell")
alertcondition(buy == 1, title="Buy", message="Gain Buy Sell Buy")
alertcondition(buy == 1 or sell == 1, title="Signal", message="Gain Buy Sell
Signal")
// Plot the three trend lines with same width and reduced gap
plot(EliteSignal, color=lineColor, linewidth=3, title="Gain Buy Sell Main")
plot(EliteSignalUpper, color=lineColor, linewidth=3, title="Gain Buy Sell Upper")
plot(EliteSignalLower, color=lineColor, linewidth=3, title="Gain Buy Sell Lower")
plotshape(buy == 1 and showsignals ? EliteSignal - atrValue : na, text='BUY',
style=shape.labelup, location=location.absolute, color=#ebfc02, textcolor=#050202,
offset=0, transp=0, size=size.normal)
plotshape(sell == 1 and showsignals ? EliteSignal + atrValue : na, text='SELL',
style=shape.labeldown, location=location.absolute, color=#f70000,
textcolor=#050202, offset=0, transp=0, size=size.normal)
//
===================================================================================
=======