Author Topic: Bollinger bands and candles  (Read 2170 times)

vekian

  • Newbie
  • *
  • Posts: 9
    • View Profile
Bollinger bands and candles
« on: November 24, 2016, 08:57:04 pm »
I was wondering if anyone can convert this code to AFL.
It is called Bollinger Band Breakout Candles. I have attached a picture of how the indicator looks.
It is written in something called 'pinescript'.

Thanks,  vekian.

 
study(title="[RS]Bollinger Bands Breakout Candles V0", shorttitle="[RS]BBBc.V0", overlay=true)
length = input(8)
src = input(hl2)
deviations = input(2)
ma = sma(src, length)
oma = ma > ma[1] ? valuewhen(ma < ma[1], ma[1], 0) : ma < ma[1] ? valuewhen(ma > ma[1], ma[1], 0) : nz(oma[1])
upper = oma + stdev(src, length) * deviations
lower = oma - stdev(src, length) * deviations

plotcandle(oma, upper, lower, ma, color=ma>=upper?#9ce0b2:ma<=lower?#e0b29c:ma>=ma[1]?green:maroon)

eadmn

  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: Bollinger bands and candles
« Reply #1 on: February 26, 2017, 12:29:13 am »
hi can u help me to make this