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

MTF MACD for Amibroker (AFL)

Copy & Paste Friendly
_SECTION_BEGIN("MTF MACD");

PlotOHLC(O,H,L,C,"",31,64);

Fast=Param("MA1",12); 
    Slow=Param("MA2",26);
       sig=Param("MA3",9); 

TimeFrameSet( in5Minute);
m5= MACD(Fast,Slow);
ms5=Signal(Fast,Slow,sig); 
TimeFrameRestore();
cm5=TimeFrameExpand(m5,in5Minute,expandFirst);
cms5=TimeFrameExpand(ms5,in5Minute,expandFirst); 
Co5=IIf(Cm5>Cms5,colorLime,colorOrange);



TimeFrameSet( in15Minute);
m15= MACD(Fast,Slow);
ms15=Signal(Fast,Slow,sig); 
TimeFrameRestore();
cm15=TimeFrameExpand(m15,in15Minute,expandFirst);
cms15=TimeFrameExpand(ms15,in15Minute,expandFirst);
Co15=IIf(Cm15>Cms15,colorGreen,colorRed);

TimeFrameSet( in15Minute*2);
m30= MACD(Fast,Slow);
ms30=Signal(Fast,Slow,sig); 
TimeFrameRestore();
cm30=TimeFrameExpand(m30,in15Minute*2,expandFirst);
cms30=TimeFrameExpand(ms30,in15Minute*2,expandFirst);
Co30=IIf(Cm30>Cms30,colorSkyblue,colorGrey40);

TimeFrameSet(inHourly);
m60= MACD(Fast,Slow);
ms60=Signal(Fast,Slow,sig); 
TimeFrameRestore();
cm60=TimeFrameExpand(m60,inHourly,expandFirst);
cms60=TimeFrameExpand(ms60,inHourly,expandFirst);
Co60=IIf(Cm60>Cms60,colorAqua,colorCustom12);
ups=(Cm5>Cms5 OR Cm15>Cms15 OR Cm30>Cms30 OR Cm60>Cms60);
tot=(Cm5>Cms5 AND Cm15>Cms15 AND Cm30>Cms30 AND Cm60>Cms60);
dns= NOT ups ;
Filter=ups OR dns OR tot;
AddColumn(ups,"Macd up:",1);
AddColumn(dns,"Macd dn:",1);
AddColumn(tot,"Macd up in all TF:",1);
Comm2=
EncodeColor(colorLightYellow)+(""+in5Minute/60+"m:")+
WriteIf(Cm5>Cms5,EncodeColor(colorLime)+" UP",WriteIf(Cm5<Cms5,EncodeColor(colorRed)+" DN",EncodeColor(colorGrey50)+" ~~"))+
EncodeColor(colorLightYellow)+("   "+in15Minute/60+"m:")+
WriteIf(Cm15>Cms15,EncodeColor(colorLime)+"  UP",WriteIf(Cm15<Cms15,EncodeColor(colorRed)+"  DN",EncodeColor(colorGrey50)+"  ~~"))+
EncodeColor(colorLightYellow)+("   "+2*in15Minute/60+"m:")+
WriteIf(Cm30>Cms30,EncodeColor(colorLime)+"  UP",WriteIf(Cm30<Cms30,EncodeColor(colorRed)+"   DN",EncodeColor(colorGrey50)+"   ~~"))+
EncodeColor(colorLightYellow)+("   "+4*in15Minute/60+"m:")+
WriteIf(Cm60>Cms60,EncodeColor(colorLime)+"   UP",WriteIf(Cm60<Cms60,EncodeColor(colorRed)+"    DN",EncodeColor(colorGrey50)+"    ~~"));

Title = EncodeColor(colorWhite)+ "MTF MACD" + " - " +  Name() + " - " + EncodeColor(colorAqua)+ Interval(2) + EncodeColor(colorWhite) + 
"  , "+ Date()+ "\n" +EncodeColor(colorYellow) +"Op-"+O+"  "+"Hi-"+H+"  "+"Lo-"+L+"  "+ 
"Cl-"+C+"  "+ "Vol= "+ WriteVal(V)+ "\n" +Comm2;


RibbonThickness	= Param("Ribbon Thickness", 3, 1, 7, 0.5);
Font				= ParamList("Font:","Arial|Calibri|Futura|Tahoma|Times New Roman",2);

function GfxConvertBarToPixelX(Bar) 
{ 
 lvb = Status("lastvisiblebar"); fvb = Status("firstvisiblebar"); 
 pxchartleft = Status("pxchartleft"); pxchartwidth = Status("pxchartwidth"); 
 return pxchartleft + Bar  * pxchartwidth / (Lvb - fvb + 1); 
} 

procedure MultiRibbon(RibbonColor, Position, Label)
{
 LineColor	= colorBlack;
 Position	= RibbonThickness * Position;
 x2 = Status("pxchartright");
 y2 = Status("pxchartbottom"); 

 RibbonColor =IIf(GfxConvertBarToPixelX(BarIndex()-Status("firstvisiblebarindex")) > y2/1.5 *
(RibbonThickness/100) * 10 , RibbonColor, colorYellow);

 Plot(0, "", LineColor, styleOwnScale | styleNoLabel, 0, 100);
 Plot(Position, "", LineColor, styleOwnScale | styleNoLabel, 0, 100);
 Plot(Position, "", RibbonColor, styleArea | styleOwnScale | styleNoLabel, 0,100);

 GfxSetTextColor(colorWhite); 
 GfxSelectFont(Font, y2/1 * (RibbonThickness/180), 200); 
 GfxDrawText(Label, 8, y2 * 1.006 -(y2 * Position/100) , y2/1.6*
(RibbonThickness/100) * 10 , y2, 2 + 32 + 256);
 
}

MultiRibbon(co5,1, " MACD ("+in5Minute/60 +"-Min)  ");
MultiRibbon(co15, 2, "MACD ("+in15Minute/60+"-Min)"); 
MultiRibbon(co30, 3, "MACD ("+in15Minute*2/60+"-Min)");
MultiRibbon(co60, 4, "MACD ("+in15Minute*4/60+"-Min)"); 
_SECTION_END();
Back