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

intraday buy for Amibroker (AFL)

Copy & Paste Friendly
SECTION_BEGIN("Nirvana_Revised_mrtq13");
///////////////////////////////////
SetChartOptions(0,chartShowArrows|chartShowDates); 
SetChartBkGradientFill( ParamColor("Inner panel upper",colorBlack),ParamColor("Inner panel lower",colorBlack));

Title =
EncodeColor(colorWhite)+ Title = Name () + " | " 
+EncodeColor(colorYellow) + Date() +" | " + Interval( 2 )+ " | " 
+EncodeColor(colorTurquoise)+ "Op : "+ EncodeColor(colorLightGrey)+ O + " | "
+EncodeColor(colorTurquoise)+ "Hi : "+ EncodeColor(colorLightGrey)+ H + " | "
+EncodeColor(colorTurquoise)+ "Lo : "+ EncodeColor(colorLightGrey)+ L + " | "
+EncodeColor(colorTurquoise)+ "Cls : "+ WriteIf(C> Ref(C, -1),EncodeColor(colorBrightGreen),EncodeColor(colorRed))+ C + " | "
+EncodeColor(colorTurquoise)+ "Change : ("+ WriteIf(C> Ref(C, -1),EncodeColor(colorBrightGreen),EncodeColor(colorRed)) + WriteVal(C-Ref(C,-1))+" Rs."
+EncodeColor(colorTurquoise)+ " /"+ WriteIf(C> Ref(C, -1),EncodeColor(colorBrightGreen),EncodeColor(colorRed))+ WriteVal( ROC( C, 1 ))+""+ " % "
+EncodeColor(colorTurquoise)+ ") | Volume : " + WriteIf(V> Ref(V, -1),EncodeColor(colorBrightGreen),EncodeColor(colorRed))+ WriteVal(V,1);

_SECTION_END(); 

_SECTION_BEGIN("Nirvana_Ribbon");
GraphXSpace=10;

a = Param("Average Pds", 5, 1, 10, 1 );
n = Param("Short Pds", 14, 5, 21, 1 );
m = Param("Long Pds", 60, 35, 90, 1 );

Var4 =(Low+High+2*Close)/4; 
OP = EMA(Var4,a);
res1 = HHV(OP,n);
res2 =HHV(OP,m); 
sup2 =LLV(OP,m); 
sup1 =LLV(OP,n);

Linecolor = IIf(op>sup1 AND Ref(Op,-1)==Ref(sup1,-1), colorBrightGreen, IIf(op<res1 AND Ref(Op,-1)==Ref(res1,-1), colorRed, 3));
Plot(5, "",Linecolor, styleOwnScale|styleArea|styleNoLabel,-0.5, 350 );
Linecolor = IIf(Op==sup1,11,IIf(Op==res1,10,7));
//Plot(OP, "OP", linecolor, 1+4); 
//Plot(res1, "Resistance1", 11, 1); 
//Plot(sup1, "Support1", 10, 1);
//Plot(res2, "Resistance2", 4, 1);
//Plot(sup2, "Support2", 5, 1);

_SECTION_END();


_SECTION_BEGIN("colorMeBad"); // added new lines of code

flowerClose =EMA((O+H+L+C)/4,3); // Woodie 
m = 17;
a=MA(flowerClose,m)+abs(MA(flowerClose,m)-Ref(MA(flowerClose,m),-1));
b=MA(flowerClose,m)+MA(flowerClose,m)-Ref(MA(flowerClose,m),-1);
balance=IIf(MA(flowerClose,m)<b,b,MA(flowerClose,m ));
pma=balance;
sig = MA(2*balance-EMA(flowerClose,3),1);
//Plot(sig,"Signal", 40, 1); //40 instead of 7
s=(pma>sig);
pm=MA(flowerClose,5);
pmcolor=IIf(pm>Ref(pm,-1),43,13); //42 ins colorLightYellow,13 insrd colorRed
Plot(pm,"CMB", pmcolor,4);
_SECTION_END();


/*
_SECTION_BEGIN("Haiken");

Show_color = ParamToggle("Display CandleColor", "No|Yes", 1);
r1 =5; //Param( "ColorFast avg", 5, 2, 200, 1 ); 
r2 =10; //Param( "ColorSlow avg", 10, 2, 200, 1 ); 
r3 =5; //Param( "ColorSignal avg", 5, 2, 200, 1 ); 

Prd1=4; //Param("ATR Period",4,1,20,1);
Prd2=7; //Param("Look Back",7,1,20,1);
green = HHV(LLV(L,Prd1)+ATR(Prd1),Prd2);
red = LLV(HHV(H,Prd1)-ATR(Prd1),Prd2);

HaClose =EMA((O+H+L+C)/4,3); // Woodie 
//HaClose =(O+H+L+C)/4; 
HaOpen = AMA( Ref( HaClose, -1 ), 0.5 ); 
HaHigh = Max( H, Max( HaClose, HaOpen ) ); 
HaLow = Min( L, Min( HaClose, HaOpen ) ); 
//HaClose = ( HaClose + HaOpen + HaHigh + HaLow )/4; // // Velvoort is using not original, but modified Heikin-Ashi close
Temp = Max(High, HaOpen);
Temp = Min(Low,HaOpen);

/*m1=MACD(r1,r2);
s1=Signal(r1,r2,r3);
mycolor=IIf(m1<0 AND m1>s1, ColorRGB(230,230,0),IIf(m1>0 AND m1>s1,colorBrightGreen,IIf(m1>0 AND m1<s1,colorOrange,colorDarkRed)));

if(Show_color)

{
ColorHighliter = myColor;
SetBarFillColor( ColorHighliter );
}*/

//////////
/*
m1=MACD(r1,r2);
s1=Signal(r1,r2,r3);
mycolor=IIf(m1<0 AND m1>s1, ColorRGB(230,230,0),IIf(m1>0 AND m1>s1,colorWhite,IIf(m1>0 AND m1<s1,colorOrange,colorDarkRed)));
if(Show_color)

{
ColorHighliter = mycolor;
SetBarFillColor( ColorHighliter );
}

barColor=IIf(C>Green ,colorWhite,IIf(C < RED,colorRed,colorYellow));
barColor2=IIf(Close > Open, colorWhite, colorRed);

if( ParamToggle("Plot Normal Candle", "No,Yes", 1 ) )
PlotOHLC( HaOpen, HaHigh, HaLow, HaClose, " " , barcolor, styleCandle | styleThick );
else
PlotOHLC( Open, High, Low, Close, " " , barcolor2, styleCandle | styleThick );

_SECTION_END();
*/


_SECTION_BEGIN("Flower_HA_Normal Candle");

Show_color = ParamToggle("Display CandleColor", "No|Yes", 1);
r1 =5; //Param( "ColorFast avg", 5, 2, 200, 1 ); 
r2 =10; //Param( "ColorSlow avg", 10, 2, 200, 1 ); 
r3 =5; //Param( "ColorSignal avg", 5, 2, 200, 1 ); 

Prd1=4; //Param("ATR Period",4,1,20,1);
Prd2=7; //Param("Look Back",7,1,20,1);
green = HHV(LLV(L,Prd1)+ATR(Prd1),Prd2);
red = LLV(HHV(H,Prd1)-ATR(Prd1),Prd2);

HaClose =EMA((O+H+L+C)/4,3); // Woodie 
//HaClose =(O+H+L+C)/4; 
HaOpen = AMA( Ref( HaClose, -1 ), 0.5 ); 
HaHigh = Max( H, Max( HaClose, HaOpen ) ); 
HaLow = Min( L, Min( HaClose, HaOpen ) ); 
//HaClose = ( HaClose + HaOpen + HaHigh + HaLow )/4; 
Temp = Max(High, HaOpen);
Temp = Min(Low,HaOpen);

//////////
m1=MACD(r1,r2);
s1=Signal(r1,r2,r3);
mycolor=IIf(m1<0 AND m1>s1, ColorRGB(230,230,0),IIf(m1>0 AND m1>s1,colorWhite,IIf(m1>0 AND m1<s1,colorOrange,colorDarkRed)));
if(Show_color)

{
ColorHighliter = mycolor;
SetBarFillColor( ColorHighliter );
}

barColor=IIf(C>Green ,colorWhite,IIf(C < RED,colorRed,colorYellow));
barColor2=IIf(Close > Open, colorWhite, colorRed);

if( ParamToggle("Plot Normal Candle", "No,Yes", 1 ) )
PlotOHLC( HaOpen, HaHigh, HaLow, HaClose, " " , barcolor, styleCandle | styleThick );
else
PlotOHLC( Open, High, Low, Close, " " , barcolor2, styleCandle | styleThick );

_SECTION_END();




_SECTION_BEGIN("Breakout Setting");
Buyperiods=Param("Breakout periods best is usually 18",5,1,100,1,1);
Sellperiods=Param("Exit Breakout",5,1,100,1,1);
Buy= C>Ref(HHV(High,Buyperiods),-1);
Sell= C<Ref(LLV(Low,Sellperiods),-1);

/* exrem is one method to remove surplus trade signals. It removes excessive signals of arrow */
Buy = ExRem(Buy, Sell);
Sell = ExRem(Sell, Buy);

PlotShapes( IIf( Buy, shapeSmallCircle, shapeNone ), colorWhite, layer = 0,yposition = HaLow, offset = -15);
//PlotShapes( IIf( Buy, shapeSmallCircle, shapeNone ), colorWhite, layer = 0,yposition = HaLow, offset = -8);

PlotShapes( IIf( Sell, shapeSmallCircle, shapeNone ), colorRed, layer = 0, yposition = HaHigh, offset = 15);
//PlotShapes( IIf( Sell, shapeSmallCircle, shapeNone ), colorRed, layer = 0, yposition = HaHigh, offset = 8);

_SECTION_END();

_SECTION_BEGIN("Pivot Box");
Hi=Param("High_Period",7,1,50,1);
Lo=Param("Low_Period",7,1,50,1);
A1=ExRemSpan(Ref(High,-2)==HHV(High,Hi),3);
A2=ExRemSpan(Ref(Low,-2)==LLV(Low,Lo),3);
A3=Cross(A1,0.9);
A4=Cross(A2,0.9);
TOP=Ref(HaHigh,-BarsSince(A3));


breakoutLine=Param("BrOutLineLength",10,2,30,0.1);
upDaysback1 = breakoutLine; 
upFirstBar1 = BarCount - upDaysBack1; 
upst2=TOP;

upYYY2=IIf(BarIndex() >= upFirstbar1,EndValue(upSt2),Null);

Plot(upYYY2,"",ParamColor("BreakoutColor", colorOrange) ,ParamStyle("BreakoutLine",styleLine|styleThick|styleStaircase,maskAll));
//Plot(top,"",11,styleDots+styleLine+styleThick);


bot=Ref(HaLow,-BarsSince(A4));
breakDownLine=Param("BrDownLineLength",10,2,30,0.1 );
dnDaysback1 = breakDownLine; 
dnFirstBar1 = BarCount - dnDaysBack1; 
dnst2=BOT;

dnYYY2=IIf(BarIndex() >= dnFirstbar1,EndValue(dnSt2),Null);


Plot(dnYYY2,"",ParamColor("BreakDownColor", colorBrightGreen) ,ParamStyle("BreakdownLine",styleLine|styleThick|styleStaircase,maskAll));
//Plot(bot,"",6,styleDots+styleLine);
_SECTION_END();
function T3(price,periods)


{
s = 0.84;
e1=EMA(price,periods);
e2=EMA(e1,Periods);
e3=EMA(e2,Periods);
e4=EMA(e3,Periods);
e5=EMA(e4,Periods);
e6=EMA(e5,Periods);
c1=-s*s*s;
c2=3*s*s+3*s*s*s;
c3=-6*s*s-3*s-3*s*s*s;
c4=1+3*s+s*s*s+3*s*s;
Ti3=c1*e6+c2*e5+c3*e4+c4*e3;
return ti3;
}

//************************************************** ********************************
// Plot price horizontal line *
//************************************************** ********************************/

_SECTION_BEGIN("Price Line");

PriceLineColor=ParamColor("PriceLineColor",ColorRGB(82,82,82));
PriceLevel = ParamField("PriceField", field = 3 ); 

Daysback = Param("Bars Back",500,10,900,1); 
FirstBar = BarCount - DaysBack; 
YY = IIf(BarIndex() >= Firstbar,EndValue(PriceLevel),Null); 

Plot(YY,"Current Price",PriceLineColor,ParamStyle("LineStyle",styleLine|styleDashed|styleNoTitle|styleNoLabel|styleThick,maskAll)); 

side = Param("side",1,0,1000,1);

dist = 0; 

for( i = 0; i < BarCount; i++ ) 
{ 
if(i+side== BarCount) PlotText( "\n " + PriceLevel[ i ], i, YY[ i ]-dist[i], colorAqua ); 
} 

_SECTION_END();



/*_SECTION_BEGIN("Average 0");
//Average_switch = ParamToggle("Candle On/off", "Off|On");
P = HaClose;
Type = ParamList("Type", "Weighted,Lagless-21,Hull-26,Linear
Regression-45,Exponential,Double Exponential,Tripple
Exponential,Wilders,Simple");
Periods = Param("Periods", 20, 2, 200 );
Displacement = Param("Displacement", 1, -50, 50 );
m = 0;

if( Type == "Weighted" ) m= WMA( P, Periods );
if( Type == "Lagless-21" ) m= 2*EMA(P, Periods)-EMA(EMA(P, Periods), Periods); 
if( Type == "Hull-26" ) m= WMA(2*(WMA(P, Periods/2))-WMA(P, Periods) ,4 );
if( Type == "Linear Regression-45" ) m= LinearReg( P, Periods );
if( Type == "Exponential" ) m = EMA( P, Periods );
if( Type == "Double Exponential" ) m = DEMA( P, Periods );
if( Type == "Tripple Exponential" ) m = TEMA( P, Periods );
if( Type == "Wilders" ) m = Wilders( P, Periods );
if( Type == "Simple" ) m = MA( P, Periods );

Plot( m, _DEFAULT_NAME(), ParamColor("Color", colorDarkYellow),ParamStyle("Style",styleLine |styleThick|styleDots|styleNoTitle ,maskAll),Displacement );

_SECTION_END();*/


_SECTION_BEGIN("Bands_Short");
BandDays= Param("DaysBack",40,10,900,1); 
HighestHigh = HHV( H, BandDays ) ; 
LowestLow = LLV( L, BandDays) ; 

KS = ( HHV( H, BandDays ) + LLV( L, BandDays) )/2; 

//Plot(HighestHigh ,"HighestHigh ",colorBlue,styleLine | styleStaircase|styleNoRescale| styleNoLabel|styleNoTitle ); // unchecked
//Plot(LowestLow ,"LowestLow ",colorRed,styleLine | styleStaircase ); // unchecked
Plot(KS,"KS",50,styleLine |styleThick | styleStaircase ); //50 instaed of colorBrightGreen

//Plot((KS+HighestHigh )/2,"",colorYellow, styleLine | styleThick | styleStaircase );
//Plot((KS+LowestLow )/2,"",colorYellow, styleLine | styleThick | styleStaircase );

CloudUpColor1=ParamColor("ShortupColor1",ColorRGB( 0,55,55));
CloudUpColor2=ParamColor("ShortupColor2",ColorRGB( 60,15,0));
CloudDownColor1=ParamColor("ShortDnColor1",ColorRGB(0,0,83));
CloudDownColor2= ParamColor("ShortDnColor2",ColorRGB(43,43,89));

CU1=HighestHigh;
CU2=(KS+HighestHigh )/2;

CD1=LowestLow = LLV( L, 22) ; 
CD2=(KS+LowestLow )/2;



//PlotOHLC( CU1, CU1,CU2,CU2, "", CloudUpColor1, styleCloud || styleStaircase|styleNoRescale| styleNoLabel|styleNoTitle );
//PlotOHLC( CU2, CU2,KS,KS, "", CloudUpColor2, styleCloud || styleStaircase|styleNoRescale| styleNoLabel|styleNoTitle );

//PlotOHLC( KS, KS,CD2,CD2, "", CloudDownColor1, styleCloud || styleStaircase|styleNoRescale| styleNoLabel|styleNoTitle );
//PlotOHLC( CD2, CD2,CD1,CD1, "", CloudDownColor2, styleCloud || styleStaircase|styleNoRescale| styleNoLabel|styleNoTitle );

_SECTION_END();



_SECTION_BEGIN("Pivot"); 
nBars = Param("Number of bars", 25, 5, 40); 
LP=Param("LookBack Period",250,1,500,1);
bShowTCZ = Param("Show TCZ", 0, 0, 1); 
nExploreBarIdx = 0;
nExploreDate = 0;
nCurDateNum = 0;
DN = DateNum();
DT = DateTime();
bTCZLong = False;
bTCZShort = False;
nAnchorPivIdx = 0;
ADX8 = ADX(8);
if(Status("action")==1) {
bDraw = True;
bUseLastVis = 1;
} else {
bDraw = False;
Back