Algokid

AK MACD BB INDICATOR V 1.00

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
Remove from Favorite Scripts Add to Favorite Scripts
//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")

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

//needs improvments 



this is a really nice script. i enjoy using it. thank you.
+1 Reply
Thank you!
+1 Reply
I lost this one while joking around with charts, and I could´nt find it for a long time, but here it is once again.
Thank you very much for this! Awesome script.
Reply
Indicator is awesome!
Reply
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")

//buy
barcolor(bar_color and macd > Upper ? color_lime:na)
//short
barcolor(bar_color and macd < Lower ? color_orange:na)
+2 Reply
Algokid pereira.alex
Thank you for sharing this with the rest of the community. :)
Reply
gumbah 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?
Reply
@gumbah, How can I test this? Very new when it comes to changing scripts..
Reply
AK This is one of my fav indicators... any word on V 2 ? Thanks!!
+2 Reply
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?
Reply
EN English
EN English (UK)
EN English (IN)
DE Deutsch
FR Français
ES Español
IT Italiano
PL Polski
TR Türkçe
RU Русский
PT Português
ID Bahasa Indonesia
MS Bahasa Melayu
TH ภาษาไทย
VI Tiếng Việt
JA 日本語
KO 한국어
ZH 简体中文
ZH 繁體中文
AR العربية
Home Stock Screener Forex Signal Finder Cryptocurrency Signal Finder Economic Calendar How It Works Chart Features House Rules Moderators Website & Broker Solutions Widgets Stock Charting Library Feature Request Blog & News FAQ Help & Wiki Twitter
Profile Profile Settings Account and Billing My Support Tickets Contact Support Ideas Published Followers Following Private Messages Chat Sign Out