Ecco come si costruisce l'indicatore BOBAO
INPUTS: @price(CLOSE), @BandPeriods(20), @BigDev(1.6), @SmalDev(0.83), @SLperiods(7), @matype(SIMPLE)
# Definiamo le variabili
SET BigTop = BollingerBandsTop(@price, @BandPeriods, @BigDev, @matype)
SET BigBottom = BollingerBandsBottom(@price, @BandPeriods, @BigDev, @matype)
SET SmallTop = BollingerBandsTop(@price, @BandPeriods, @SmalDev, @matype)
SET SmallBottom = BollingerBandsBottom(@price, @BandPeriods, @SmalDev, @matype)
SET SignalLine = LR(@price, @SLperiods)
# Settiamo i PLOT
SET PLOT1 = BigTop
SET PLOT2 = BigBottom
SET PLOT3 = SmallTop
SET PLOT4 = SmallBottom
SET PLOT5 = SignalLine
# Settiamo il cambiamento di colore della SignalLine in base alla pendenza
SET salita = PLOT5 > REF(PLOT5, 1)
SET PLOTCOLOR5 = IF(salita, COLOR_GREEN, COLOR_LIGHT_MAGENTA)