Algokid

AK MACD BB INDICATOR V 1.00

2933 11 515
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 



www.passivestor.com
Ailes
2 years ago
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.
+1 Reply
JRG PRO
2 years ago
Nice work...inform when you have it in its final version
+1 Reply
jackvmk
2 years ago
same here, nice work, i am going to try to integrate it my strategy.
+1 Reply
What about changing parameters to 9 - 0.618 (Fibonacci)- 38-52-9 in view of better highlighting more extended cycles ? . Try and see. Cheers
Reply
Mistake: actual figures 5 - 0 .618 - 38 - 52 -9
Reply
TASAVANT
a year ago
Great indicator in this market
snapshot
Looking forward to V2 ...I use 5 35 5 setting and scalp aggressively
+2 Reply
fabfoot
a year ago
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
BizkitBR PRO
7 months ago
AK This is one of my fav indicators... any word on V 2 ? Thanks!!
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)
+1 Reply
Algokid PRO pereira.alex
5 months ago
Thank you for sharing this with the rest of the community. :)
Reply
gumbah Algokid
3 months ago
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
Ideas Scripts Chart
United States
United Kingdom
India
España
Italia
Brasil
Россия
Türkiye
日本
한국
Home Stock Screener 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
Private Messages Chat Ideas Published Followers Following Priority Support Public Profile Profile Settings Billing Sign Out