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

multi indicator alignment rank for Amibroker (AFL)

Rating:
3 / 5 (Votes 4)
Tags:
amibroker, ribbon, rank

Group all major indicators crossover in single window

Screenshots

Similar Indicators / Formulas

H-L Ribbon
Submitted by halfman over 13 years ago
11 Ribbons
Submitted by morgen over 12 years ago
7 ribbons 3
Submitted by k.raaja over 14 years ago
VAR MA Ribbon
Submitted by alliswell about 12 years ago
Candle Ribbon
Submitted by brevco over 14 years ago
ADX PDI MDI + ADX Ribbon
Submitted by rattanasak about 11 years ago

Indicator / Formula

Copy & Paste Friendly
_SECTION_BEGIN("MultipleRibbon");
// You plot a Ribbon by calling the function as follows: MultiRibbon("Color", "Ribbon Number", "Name To Display");
// The "Ribbon Number" is simply the order of the ribbon, starting with 1 as the bottom Ribbon. You can add as many 
// ribbons as you want, until you run out of chart space. Just keep track of the 'Serial Number' (Ribbon Number). :-)


RibbonThickness	= Param("Ribbon Thickness", 8, 1, 15, 0.1);
Font				= ParamList("Font:","Arial|Calibri|Futura|Tahoma|Times New Roman");
"";
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	= colorLightGrey;
 Position	= RibbonThickness * Position;
 x2 = Status("pxchartright");
 y2 = Status("pxchartbottom");

 RibbonColor = IIf(GfxConvertBarToPixelX(BarIndex()-Status("firstvisiblebarindex")) > y2/1.5 * (RibbonThickness/100) * 18 ,
               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(colorBlack); 
 GfxSelectFont(Font, y2/1.5 * (RibbonThickness/100), 400); 
 GfxDrawText(Label, 8, y2 * 1.001 -(y2 * Position/100) , y2/1.5 * (RibbonThickness/100) * 17, y2, 2 + 32 + 256);
 
}

//=================================================================================================================





//============================================ ElderIndex ======================================
bull=High - EMA(Close,9);
bear=Low - EMA(Close,9);
bb=bull+bear;

r1Up= Cross(bb,EMA(bb,9)) OR Cross(EMA(bb,9),0) ;
r1Down=Cross(EMA(bb,9),bb)  OR Cross(0,EMA(bb,9)) ;
//r1Up=Sum(r1Up,3)>0;
//r1Down=Sum(r1Down,3)>0;

r1= IIf( r1Up ,colorGreen,IIf(r1Down,colorRed,colorGrey40));

//////////////////FI////////////////
FI = (Close - Ref(Close, -1)) * V;

r7Up= Cross(fi,EMA(fi,9)) OR Cross(EMA(fi,9),0) ;
r7Down=Cross(EMA(fi,9),fi)  OR Cross(0,EMA(fi,9)) ;
//r7Up=Sum(r7Up,3)>0;
//r7Down=Sum(r7Down,3)>0;

r7=IIf( r7Up ,colorGreen,IIf(r7Down,colorRed,colorGrey40));
///////////////////////////////////


//============================================ Guppy  ======================================

Trigger = Param("Trigger",21,1,55,1);

Short1 = EMA (C,3)+ EMA((C-EMA(Close,3)),3)+
EMA (C,5)+ EMA((C-EMA(Close,5)),5)+
EMA (C,8)+ EMA((C-EMA(Close,8)),8)+
EMA (C,10)+ EMA((C-EMA(Close,10)),10)+
EMA (C,12)+ EMA((C-EMA(Close,12)),12)+
EMA (C,15)+ EMA((C-EMA(Close,15)),15);

LONG2 = EMA (C,30)+ EMA((C-EMA(Close,30)),30)+
EMA (C,35)+ EMA((C-EMA(Close,35)),35)+
EMA (C,40)+ EMA((C-EMA(Close,40)),40)+
EMA (C,45)+ EMA((C-EMA(Close,45)),45)+
EMA (C,50)+ EMA((C-EMA(Close,50)),50)+
EMA (C,55)+ EMA((C-EMA(Close,55)),55)+
EMA (C,60)+ EMA((C-EMA(Close,60)),60);

GuppyMMAOscillator = ((Short1-Long2)/Long2)*100;

GMMACD=(((short1-Long2)/long2)*100)-EMA(((short1-long2)/long2)*100,9);



r2Up=Cross(GuppyMMAOscillator,EMA(GuppyMMAOscillator, Trigger))				;
r2Down=Cross(EMA(GuppyMMAOscillator, Trigger),GuppyMMAOscillator)	;
//r2Down= Cross(EMA(GuppyMMAOscillator, Trigger),GuppyMMAOscillator)		;
//r2Down=Sum(r2Down,3)>0;

r2= IIf( r2Up ,colorGreen,IIf(r2Down,colorRed,colorGrey40));

//============================================ MACD =======================
MACDcrossup= Cross(MACD(),Signal())  ;
MACDcrossdown=Cross(Signal(),MACD());

r3Up= MACDcrossup;
r3Down=MACDcrossdown;

r3= IIf( r3Up,colorGreen,IIf(r3Down,colorRed,colorGrey40));


//---------------------------------------------------------------------------

//============================================ MFI =======================
periods = Param( "Periods", 14, 2, 200, 1 );
MFCrossUp=Cross(MFI(periods),MA(MFI(periods),9));
MFCrossDown=Cross(MA(MFI(periods),9),MFI(periods));

r4Up=MFCrossUp ;
r4Down=MFCrossDown ;

r4= IIf( r4Up,colorGreen,IIf(r4Down,colorRed,colorGrey40));


//--------------------------------------------CCI-------------------------------
periods = Param( "Periods", 14, 2, 200, 1 );
CCICrossUp=Cross(CCI(periods),MA(CCI(periods),9));
CCICrossDown=Cross(MA(CCI(periods),9),CCI(periods));

r8Up=CCICrossUp;
r8Down=CCICrossDown;

r8= IIf( r8Up,colorGreen,IIf(r8Down,colorRed,colorGrey40));


/////////////////////////////////////////////

//========================================== ADX ===========================

//============================================ ADX ======================================
bull=High - EMA(Close,13);
bear=Low - EMA(Close,13);
bb=bull+bear;

ADXCond=PDI()>27 OR MDI()>27 OR ADX() >27;

r5= IIf( ADXCond,colorBlue,colorGrey40);

////////////////////////////////////KAMA//////////////

LBPeriods = Param( "LB Periods", 10, 1, 200, 1 );

FSCPeriods = Param( "FSC Periods", 2, 1, 200, 1 );

SSCPeriods = Param( "SSC Periods", 30, 1, 200, 1 );

FastSmoothConst = 2 / ( FSCPeriods + 1 );

SlowSmoothConst = 2 / ( SSCPeriods + 1 );

Direction = abs( Close - Ref( Close, -LBPeriods ) );

Volatility = Sum( abs( Close - Ref( Close, -1 ) ), LBPeriods );

EfficiencyRatio = Direction / Volatility;

SC = ( EfficiencyRatio * ( FastSmoothConst - SlowSmoothConst ) + 
SlowSmoothConst ) ^ 2;

KAMA = AMA( Close, SC );



up=Cross(Close,KAMA);
down=Cross(KAMA,Close);



r6= IIf( Up,colorGreen,IIf(Down,colorRed,colorGrey40));

//////////////////////////////////////////////////////////

MultiRibbon(r8, 1, "CCI");
MultiRibbon(r6, 2, "kama"); 
MultiRibbon(r5, 3, "adx"); 
MultiRibbon(r4, 4, "mfi"); 
MultiRibbon(r7, 5, "fi");
MultiRibbon(r1, 6, "elder");
MultiRibbon(r3, 7, "macd");
MultiRibbon(r2, 8, "guppy");


//ToolTip="r5: "+r5+" r2: "+r2;  //32 red 27 green  29 blue

function frsum(){
rsum1=0;
rsum1=IIf(r1==32,-1,IIf(r1==27,1,0));
rsum1+=IIf(r2==32,-1,IIf(r2==27,1,0));
rsum1+=IIf(r3==32,-1,IIf(r3==27,1,0));
rsum1+=IIf(r4==32,-1,IIf(r4==27,1,0));
rsum1+=IIf(r6==32,-1,IIf(r6==27,1,0));
//rsum1+=IIf(r5!=29,-1,IIf(r5==29,1,0));
rsum1+=IIf(r7==32,-1,IIf(r7==27,1,0));
rsum1+=IIf(r8==32,-1,IIf(r8==27,1,0));

return rsum1;
}

ToolTip="r1:"+r1+"r2:"+r2+"r3:"+r3+"r4:"+r4
			+"r5:"+r5+"r6:"+r6+"r7:"+r7+"r8:"+r8+"srsum: "+frsum();

Plot(Sum(frsum(),2),"sum:",colorGreen,styleNoDraw|styleNoLine);
BuyCond =Sum(frsum(),3)>3 OR frsum()>3;
ShortCond=Sum(frsum(),3)<-3 OR  frsum()<-3;


TimeFrameSet(in15Minute);
BuyCond2=Sum(frsum(),3)>3 OR frsum()>3;
ShortCond2=Sum(frsum(),3)<-3 OR  frsum()<-3;
TimeFrameRestore();

/*
Plot(BuyCond,"buy",colorGreen);
Plot(ShortCond ,"sell",colorRed);
*/

z = Zig(Close, 2);

Buy=(BuyCond  AND TimeFrameExpand(BuyCond2,in15Minute)) ;//AND (TimeNum() >= FirstTradeTime AND TimeNum() <= LastTradeTime );
Sell =  IIf(z < Ref(z, -1), 1, 0);// OR TimeNum() > ExitAllPositionsTime;
Short=(ShortCond AND TimeFrameExpand(ShortCond2,in15Minute));// AND (TimeNum() >= FirstTradeTime AND TimeNum() <= LastTradeTime );
Cover = IIf(z > Ref(z, -1), 1, 0) ;//OR TimeNum() > ExitAllPositionsTime;

Buy=ExRem(Buy,Sell);
Sell=ExRem(Sell,Buy);
Short=ExRem(Short,Cover);
Cover=ExRem(Cover,Short); 

Filter=BuyCond OR ShortCond ;


Color = IIf(BuyCond , colorGreen,IIf(ShortCond ,colorRed,colorDefault));// ---------CNB-------
AddColumn(Close,"BUY / SELL ", 1.2 , 1, Color , 80);
AddColumn(Sum(frsum(),3),"sum",1,Color ,80);
AddColumn(frsum(),"fsum()",1,Color ,80);

2 comments

1. Aviator1123

can u please detail how to use this ?

2. mauro24

Hello,
Does any of you know where to find AFL code or perhaps can write code for indicator :
Percent away from 200 day moving average?

Thanks in advance,

M24

Leave Comment

Please login here to leave a comment.

Back