Bollinger Band and Moving Average v0.1 by JustUncleL

This is another Bollinger Band strategy+indicator in my series of Bollinger based setups. This one is seems to work best with 5min charts and 20 to 30min expiry. The strategy follows variation of a Bollinger band + Moving Averages
reversal strategy, it uses the 2 moving averages mainly to determine market direction.
Удалить из избранных скриптов Добавить в избранные скрипты
// Title: "Bollinger Band and Moving Average Retrace Alert v0.1 by JustUncleL".
// Author: JustUncleL
// Date:   24-Jul-2016
// Version: 0.1
// * Description *
//   Brief: This strategy follows variation of a Bollinger band + Moving Average
//          reversal strategy. Includes warning alert conditions.
//          Can be used 5min and higher charts.
//   Full:  Bollinger is standard calculated from SMA (20,2).
//          The strategy is we wait for a candle that breaks and closes outside
//          the Bollinger Bands and then filter Moving average market direction:
//          if market direction  indicated by (180ema) and (365ema) is in the opposite
//          direction  to breaking candle. We place the binary trade on the 
//          following candle in opposite direction of breaking candle.
//          The next must be a candle in oposite direction and this candle must be
//          bigger the the Bollinger break candle, if this child candle not big
//          enough then test 2nd child candle.
//          All candles must be below or above the moving averages, depending on
//          direction.
//          Breakout identified by shapes:
//          The purple diamonds indicate Bollinger breakout conditions satisfied
//          and indicate a possible trade position approaching.
//          The red or green hightlighted triangle indicate child conditions are
//          satisfied and a PUT/CALL trade can be started after the child candle has
//          closed.  Place a binary trade in direction of market for 15min to 45min, 
//          optimal timeframe will depend on market conditions, needs to practised
//          to become experience, if your unsure just use 30min or closest.
//          Note:
//          - Because the strategy relies on Bollinger bounces off the opposite
//          direction band and strict conditions it does not generate many possible 
//          trade positions, but they should be good. Extra good positions
//          will be generated by disabling the option for candle size rule.
//          - The indicators will repaint until candles have completed, so
//          don't trade until after child candle indicator is complete.
//          - If you use the alrm condition, I recommend set your alarm alert
//          to wait for candle closed.
// * Version Changes *
//   0.1 : Original Version.
// * Reference *
//   This code use Bollinger calc by JayRogers in "[JR] Multi Bollinger Heat Bands - EMA/Break options"
//   This strategy is presented in some of the "BinaryOptionsArmy" youtube trading videos and can
//   be found other places as well.
study("Bollinger Band and Moving Average Retrace Alert v0.1 by JustUncleL", shorttitle="BBEMA v0.1 by JustUncleL", overlay=true, scale=scale.right)
// Collect all the settings, can be changed
bb_length = input(20, minval=1, title="Bollinger Length")
bb_mult = input(2, title="Bollinger Multiplier", minval=0.5, maxval=10)
sFilter   = input(true,title="Use Candle size Filter")
SlowMALen = input(365, minval=2, title="Slow Moving Average Length")
FastMALen = input(180, minval=1, title="Fast Moving Average Length")
dCandles  = input(3, minval=2, title="Candles to test Market Direction")

// Calculate moving averages
FastMA = ema(close, FastMALen)
SlowMA = ema(close, SlowMALen)
// Work out market direction from moving averages and pre-filter candles for rule testing.
// Extra check for rising/falling fastMA to catch change of direction earlier.
direction = FastMA>SlowMA and rising(FastMA,dCandles) and close>FastMA? +1 : FastMA<SlowMA and falling(FastMA,dCandles) and open<FastMA? -1 : 0

// Draw the moving average lines
plot(SlowMA, title="SlowEMA", style=line, linewidth=2, color=red)
plot(FastMA, title="FastEMA", style=line, linewidth=2, color=olive)

// Calculate Bollinger Bands Deviation
bb_basis = sma(close, bb_length)
dev = stdev(close, bb_length)
bb_dev = bb_mult * dev
// Upper band
bb_high = bb_basis + bb_dev
// Lower Band
bb_low = bb_basis - bb_dev
// draw the Bollinger Bands
bb1=plot(bb_high, title="BB High", color=blue, transp=50, linewidth=2) 
bb2=plot(bb_low, title="BB Low", color=blue, transp=50, linewidth=2)
//plot(bb_basis, title="BB Basis", color=teal, transp=50, linewidth=1)
fill(bb1,bb2, title="BB Fill", color=gray, transp=80)

// Check for Mother candle break Bolliger upwards
breakBBup  = close>bb_high and close>open and direction<0 ? na(breakBBup[1]) ? 1 : breakBBup[1]+1 : 0
breakBBdn  = close<bb_low  and close<open and direction>0 ? na(breakBBdn[1]) ? 1 : breakBBdn[1]+1 : 0

// Check for First Child candle
child1BBup = breakBBup==0 and breakBBup[1]>0 ? close<open and direction<0 and (not sFilter or ((open-close)>(close[1]-open[1]))) ? 1 : 0 : 0
child1BBdn = breakBBdn==0 and breakBBdn[1]>0 ? close>open and direction>0 and (not sFilter or ((close-open)>(open[1]-close[1]))) ? 1 : 0 : 0
child2BBup = breakBBup==0 and breakBBup[2]>0 and breakBBup[1]==0 ? close<open and direction<0 and (not sFilter or ((open-close)>(close[2]-open[2]))) ? 1 : 0 : 0
child2BBdn = breakBBdn==0 and breakBBdn[2]>0 and breakBBdn[1]==0 ? close>open and direction>0 and (not sFilter or ((close-open)>(open[2]-close[2]))) ? 1 : 0 : 0

// plot and highlight any breakouts
plotshape(breakBBup, title="BBEMA down Alert", style=shape.diamond,location=location.abovebar, color=fuchsia, transp=0, size=size.tiny)
plotshape(breakBBdn,  title="BBEMA up Alert", style=shape.diamond,location=location.belowbar, color=fuchsia, transp=0, size=size.tiny)
plotshape((child1BBup+child2BBup)>0, title="BBEMA down Arrow", style=shape.triangledown,text="PUT",location=location.abovebar, color=red, transp=0, size=size.tiny)
plotshape((child1BBdn+child2BBdn)>0,  title="BBEMA up Arrow", style=shape.triangleup,text="CALL",location=location.belowbar, color=green, transp=0, size=size.tiny)

// draw background bar to highlight actual trade positions can first or second child.
breakColor = (child1BBdn+child2BBdn)>0  ?  green : (child1BBup+child2BBup)>0 ? red : na 
bgcolor(breakColor, transp=75)

// Generate pre-warning alert condition when Bollinger Band break condition is satisfied or
// when any children forms. I recommend set your alarm alert to wait for candle closed.
// You can be watch and analyse entry decision manually.
alertcondition( breakBBup or breakBBdn or (child1BBup+child2BBup+child1BBdn+child2BBdn)>0, title="BBEMA Alert", message="BBEMA Alert")
// EOF
excellent.. thank you so much! made money today! it works great with penny stocks!
You are welcome. I'm happy you are having some success.
Домой Скринер акций Скринер форекс Скринер криптовалют Экономический календарь О проекте Особенности Цены Правила поведения Модераторы Решения для сайтов и брокеров Виджеты Графики TradingView для сайтов Справочный центр Отзывы и предложения Блог и новости ЧаВо Wiki Твиттер
Профиль Настройка профиля Счёт и оплата TradingView Coins Мои запросы в поддержку Справочный центр Опубликовано идей Подписчики Подписан Личные сообщения Чат Выйти