How It Works Chart Features House Rules Moderators For the WEB Widgets Stock Charting Library Feature Request FAQ Help & Wiki Twitter

AK MACD BB INDICATOR V 1.00

4310 12
Here's my version of the MACD _BB . This is a great indicator to capture short term trends.

yellow candles = long
aqua candles = short

This indicator can be much better. I will work on it and publish an improved version (hopefully) soon. In the mean time , go ahead and play around with the code, and please share your findings :)

Cheers

Algo
//AK MACD BB
//created by Algokid , February 24,2015

study("AK MACD BB v 1.00")

length = input(10, minval=1, title="BB Periods")
dev = input(1, minval=0.0001, title="Deviations")

//MACD
fastLength = input(12, minval=1)
slowLength=input(26,minval=1)
signalLength=input(9,minval=1)
fastMA = ema(close, fastLength)
slowMA = ema(close, slowLength)
macd = fastMA - slowMA

//BollingerBands

Std = stdev(macd, length)
Upper = (Std * dev + (sma(macd, length)))
Lower = ((sma(macd, length)) - (Std * dev))

Band1 = plot(Upper, color=gray, style=line, linewidth=2,title="Upper Band")
Band2 = plot(Lower, color=gray, style=line, linewidth=2,title="lower Band")
fill(Band1, Band2, color=blue, transp=75,title="Fill")

mc = macd >= Upper ? lime:red

// Indicator

plot(macd, color=mc, style =circles,linewidth = 3)
zeroline = 0
plot(zeroline,color= orange,linewidth= 2,title="Zeroline")

barcolor(macd >Upper ? yellow:na)
//short
barcolor(macd <Lower ? aqua:na)

//needs improvments


I like this indicator. The Bands are a neat idea to catch the stronger trends while keeping you out of (some, not all of course) unprofitable sideways situations.

For trading I think an additional trend-filter (like a wide 0.01 step PSAR or a 3 dev Supertrend) would help improve the winning ratio by only taking trades in direction of the larger underlying trend (ie don't take short trades when the longterm trend is still up, and vice versa), so it doesn't take every little trade all the time but only the higher probability (= profitability) big ones.
Nice work...inform when you have it in its final version
same here, nice work, i am going to try to integrate it my strategy.
What about changing parameters to 9 - 0.618 (Fibonacci)- 38-52-9 in view of better highlighting more extended cycles ? . Try and see. Cheers
Mistake: actual figures 5 - 0 .618 - 38 - 52 -9
Great indicator in this market
Looking forward to V2 ...I use 5 35 5 setting and scalp aggressively
I like this indicator but I wish it would leave the candles the correct color. Would you make a version that leaves the candle colors alone please?
AK This is one of my fav indicators... any word on V 2 ? Thanks!!
Hi, modded this indicator a little : added barcolor input ( enable/disable). Thanks !
Source code below:

//AK MACD BB
//created by Algokid , February 24,2015
//modded by Alexandre Pereira, July 6, 2016
color_red_light = #e57373
color_red = #f44336
color_red_dark = #d32f2f

color_blue_light = #64b5f6
color_blue = #2196f3
color_blue_dark = #1976d2

color_green_light = #81c784
color_green = #4caf50
color_green_dark = #388e3c

color_orange_light = #ffb74d
color_orange = #ff9800
color_orange_dark = #f57c00

color_lime_light = #dce775
color_lime = #cddc39
color_lime_dark = #afb42b

study("AK MACD BB v 1.00")

length = input(10, minval=1, title="BB Periods")
dev = input(1, minval=0.0001, title="Deviations")
bar_color = input(false, "Bar colors")
//MACD
fastLength = input(12, minval=1)
slowLength=input(26,minval=1)
signalLength=input(9,minval=1)
fastMA = ema(close, fastLength)
slowMA = ema(close, slowLength)
macd = fastMA - slowMA

//BollingerBands

Std = stdev(macd, length)
Upper = (Std * dev + (sma(macd, length)))
Lower = ((sma(macd, length)) - (Std * dev))

Band1 = plot(Upper, color=color_red_light, style=line, linewidth=2,title="Upper Band")
Band2 = plot(Lower, color=color_green_light, style=line, linewidth=2,title="lower Band")
fill(Band1, Band2, color=color_blue_light, transp=75,title="Fill")

mc = macd >= Upper ? color_green: macd <= Lower ? color_red : color_blue

// Indicator

plot(macd, color=mc, style =circles,linewidth = 3)
zeroline = 0
plot(zeroline,color= orange,linewidth= 2,title="Zeroline")

barcolor(bar_color and macd > Upper ? color_lime:na)
//short
barcolor(bar_color and macd < Lower ? color_orange:na)
pereira.alex
Thank you for sharing this with the rest of the community. :)
Algokid
Thanks for the indicator Algo!
Q: did you ever manage to find time for a new/improved version of this? And in what way would you improve it?
Indicator is awesome!
United States
United Kingdom
India
España
France
Italia
Polska
Brasil
Россия
Türkiye
Indonesia

한국
Home Stock Screener Forex Signal Finder Economic Calendar How It Works Chart Features House Rules Moderators For the WEB Widgets Stock Charting Library Priority Support Feature Request Blog & News FAQ Help & Wiki Twitter