Stock Portfolio Organizer

The ultimate porfolio management solution.

Shares, Margin, CFD's, Futures and Forex
EOD and Realtime
Dividends and Trust Distributions
And Much More ....
For Portfolio Manager Click Here

WiseTrader Toolbox

#1 Selling Amibroker Plugin featuring:

Advanced Adaptive Indicators
Advanced Pattern Exploration
Neural Networks
And Much More ....
Find Out More Here

BB-MACD for Amibroker (AFL)

Rating:
4 / 5 (Votes 6)
Tags:
oscillator, amibroker

I created this BB-MACD longtime ago from T3 NextGen.
Finally someone create the charting in http://www.wisestocktrader.com/indicators/3156-protrader-v1-0
make it easy to learn the trading system.

Attached the view of the trading system

Screenshots

Similar Indicators / Formulas

Febo RSI ..real indicator
Submitted by abhinavsingh about 13 years ago
Trading Volume Statistic
Submitted by tuanstock1 over 10 years ago
Ergodic Oscillator
Submitted by dljtrader about 14 years ago
3 Days Track
Submitted by janet0211 over 14 years ago
Chande Momentum Oscillator
Submitted by klimpek almost 14 years ago

Indicator / Formula

Copy & Paste Friendly
_SECTION_BEGIN("BB-MACD");
//--Created by KelvinHand


iMACD=Null; iMidBB=Null;

SetChartBkGradientFill( ParamColor("BgTop", colorBlack),ParamColor("BgBottom", colorBlack), colorLightGrey);
 
MACDMethod = ParamList("MACD.Mode", "SMA|EMA", 1);

r1 = Param("Macd.FastPeriod", 12);
r2 = Param("Macd.SlowPeriod", 26);

BBMethod = ParamList("BB.Mode", "SMA|EMA");

r3 = Param("BB.Period",  10);
r4 = Param("BB.StdDev", 1.0, 1,10, 0.1);

ShowMACDLine = ParamToggle("Show MACD Line?", "No|Yes");
ShowMidBB= ParamToggle("Show Mid BB?", "No|Yes", 1);
ShowOuterBB = ParamToggle("Show Upr/Lwr BB ?", "No|Yes", 1);
sShapeBtwBB = ParamList("Shape Inside BB", "Small|Big", 1);
 
 
cMacdLine=ParamColor("MACD Line", colorOrange);
cUprBB = ParamColor("BB.Upper", colorBlueGrey);
cLwrBB = ParamColor("BB.Lower", colorBlueGrey);
 
cMacdGeUprBB = ParamColor("Macd>=UprBB", colorBrightGreen);
cMacdLeLwrBB = ParamColor("Macd<=LwrBB", ColorRGB(255,0,255));
 
cMacdLtUprBB = ParamColor("Macd<=UprBB", colorRed);
cMacdGtLwrBB = ParamColor("Macd>=LwrBB", colorDarkGreen);
 
cZLUp = ParamColor("Macd>0-Line", ColorRGB(0,0,140));
cZLDn = ParamColor("Macd<0-Line", ColorRGB(130,0,0));
 
if (MACDMethod=="EMA")
  iMACD= EMA(C,r1)-EMA(C,r2);
else
  iMACD= MA(C,r1)- MA(C,r2);

 
m1 = Ref(iMACD, -1);
 
if (BBMethod=="EMA")
  iMidBB = EMA(iMACD,r3);
else
  iMidBB = MA(iMACD,r3);
 

SD = StDev( iMACD, r3);
 
BBtop= iMidBB + r4*sD;
BBbot= iMidBB - r4*sD;


if (ShowMACDLine) Plot(iMACD,"",cMacdLine);
 
 

 ThisColor = IIf(iMACD>=BBtop AND iMACD>=m1, cMacdGeUprBB,
        IIf(iMACD<=BBbot AND iMACD<=m1, cMacdLeLwrBB,
        IIf(iMACD>iMidBB, cMacdLtUprBB, cMacdGtLwrBB)));
 
 Plot(iMACD,"MACD", ThisColor,styleDots|styleNoLine);
 
 if (sShapeBtwBB=="Big")
 {
   ThisShape = IIf(iMACD>BBtop, shapeNone,
            IIf(iMACD<BBbot, shapeNone,
            shapeSmallCircle));
 
   PlotShapes( ThisShape, ThisColor,0,Null, 0  );
 }
 
 

 
if (ShowMidBB)
  Plot(iMidBB,"MidBB", colorDarkGrey, styleDashed|styleNoLabel);
 
if (ShowOuterBB)
{
  Plot(BBtop,"UprBB",cUprBB, styleNoLabel);
  Plot(BBbot,"LwrBB",cLwrBB, styleNoLabel);
}
 
  
 
Plot(0,"", IIf(iMACD>=0, cZLUp, cZLDn), styleNoLabel);
 
 
RequestTimedRefresh( 0 ); 

_SECTION_END();

9 comments

1. anandnst

Thanx you kelvin for BB-MACD.

2. sd_stocks

Hi Kelvin, Thanks for the indicator. It will help if you add Buy /Sell Scan to the code

-Sd

3. Anonymous

Hi Kelvin,

That’s great. Just the perfect one for the system I’ve posted ;-)
Is there a way to to produce all “shapes” to shapeSmallCircle?
Also the ones outside BB-bands?
Thanks in advanced!

4. krab

HI kelvin,

please post MACD with different moving averages like SMA, EMA,WMA
5. kelvinhand

Hi krab,

Changes:

Line 9: MACDMethod = ParamList("MACD.Mode", "SMA|EMA|WMA", 1);

Line 38:
if (MACDMethod=="EMA")
  iMACD= EMA(C,r1)-EMA(C,r2);
else if (MACDMethod=="WMA")
  iMACD= WMA(C,r1)-WMA(C,r2);
else
  iMACD= MA(C,r1)- MA(C,r2);
6. kelvinhand

Hi Ceurami,

Toggle “Shape Inside BB” to Small will give you shapeSmallCircle.
The Big Shape Dots is for weakening back in to the band not for strong momentum outside the BB.

7. Muralikrishna

@kelvinhand,
hi sir, my effort is ur tma band afl mixing my Exellent Trend Catcing indicator Afl, it results make one of the best new afl made sir, but some problems here, signals not coming before, trend is running ofter it comes, and change positions, but it is very good afl my side, so pls any idea give me sir, pls tell me ur mail id sir, i will send u that afl code,

thank u

Muralikrishna,

krishna_vaastu@yahoo.com

8. Anonymous

Hi Kelvin,

Yes I know.
But is there a way, to get also “big” shapeSmallCircle for the ones Outside BB?
Thanks in advanced,

Ceurami

9. gwenvp

@ Kelvinhand

Dear,
Great job, But i’m using tradestation with easy language.
Can you transform your code for easy language pls ?
Or you can help me to creating the code for Easy Language ?

Sincerely
Sandybelgium@hotmail.com

Leave Comment

Please login here to leave a comment.

Back