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

pgs mittal for Amibroker (AFL)

Copy & Paste Friendly
_SECTION_BEGIN("MACD Exploration"); 
r1 = Param( "Fast avg", 12, 2, 200, 1 ); 
r2 = Param( "Slow avg", 26, 2, 200, 1 ); 
r3 = Param( "Signal avg", 9, 2, 200, 1 ); 
Z=Param("zig",1,0,10,0.1); 
  
  
Cond1 = Cross(MACD(r1,r2),Signal(r1,r2,r3)); 
  
Cond3 = Zig(C,z)>Ref(Zig(C,z),-4); 
Buy = Cond1 AND Cond3; 
  
Cond4 = Cross(Signal(r1,r2,r3),MACD(r1,r2)); 
  
Cond6 = Zig(C,z)<Ref(Zig(C,z),-4); 
Sell = Cond4 AND Cond6; 
Trigger = WriteIf(Buy, "Buy", "") + WriteIf(Sell, "Sell", ""); 
  
_N(Title = StrFormat("{{NAME}} {{DATE}} {{INTERVAL}}: O=%1.2f, H=%1.2f, L=%1.2f, C=%1.2f, V=%1.0f\n{{VALUES}}", O, H, L, C, V)); 
  
BG = IIf(Buy, colorPaleGreen, IIf(Sell, colorRose, colorDefault)); 
FG = IIf(Buy, colorDarkGreen, IIf(Sell, colorDarkRed, colorDefault)); 
  
if(Status("action") == actionIndicator) 
{ 
 
PlotShapes(IIf(Buy, shapeSquare, shapeNone),colorAqua, 0, L, Offset=-15); 
PlotShapes(IIf(Buy, shapeSquare, shapeNone),colorPaleGreen, 0,L, Offset=-25); 
PlotShapes(IIf(Buy, shapeUpArrow, shapeNone),colorDarkGreen, 0,L, Offset=-20); 
PlotShapes(IIf(Sell, shapeSquare, shapeNone),colorRose, 0, H, Offset=15); 
PlotShapes(IIf(Sell, shapeSquare, shapeNone),colorPink, 0,H, Offset=25); 
PlotShapes(IIf(Sell, shapeDownArrow, shapeNone),colorRed, 0,H, Offset=-20); 
  
} 
  
if(Status("action") == actionExplore) 
  
Filter = Buy OR Sell; 
SetOption("NoDefaultColumns", True); 
  
AddTextColumn(Name(), "Symbol", 77, FG, BG, 120); 
AddColumn(DateTime(), "Date", formatDateTime, FG, BG, 100); 
AddColumn(TimeNum() ,"Time",1); 
AddColumn( C, "Close", 1.3 ); 
AddColumn( H, "High", 1.3 ); 
AddColumn(V, "Volume"); 
AddColumn(Ref(V,-1),"P-Vol"); 
AddColumn(V/Ref(V,-1)*100,"Increase in Vol"); 
AddColumn( Buy, "Buy", 1 ); 
AddColumn( Sell, "Sell", 1 ); 
  
shape = Buy * shapeHollowUpTriangle + Sell * shapeHollowDownTriangle; 
  

  
PlotShapes( shape, IIf( Buy, colorBlue, colorBlue ), 0, IIf( Buy, Low, High ) ); 
  
GraphXSpace = 7; 
  
shape = Buy * shapeUpTriangle + Sell * shapeHollowDownTriangle; 
  

  
PlotShapes( shape, IIf( Buy, colorBlue, colorBlue ), 0, IIf( Buy, Low, High ) ); 
  
GraphXSpace = 7; 
_SECTION_END(); ;_SECTION_BEGIN("Kpl System");
/* my entry is very simple(daily data for trading)

kpl system for entry only & exit as follow:

1 st exit at x % from entry price only 1/3 quantity.(ie 1st profit target)
2 nd exit when exit Signal comes from kpl sys remaining 1/3 quantity.
3. scale-in to initial quantity if new kpl Buy Signal comes.
re-do above scaling-out & scaling-in till filal exit.
4. final exit all quantity when Close below 21 Day EMA.

kpl system code bellow :
*/
//AFL by Kamalesh Langote. Email:kpl@...
no=Param( "Swing", 20, 1,55 );
tsl_col=ParamColor( "Color", colorRed );

res=HHV(H,no);
sup=LLV(L,no);
avd=IIf(C>Ref(res,-1),1,IIf(C<Ref(sup,-1),-1,0));
avn=ValueWhen(avd!=0,avd,1);
tsl=IIf(avn==1,sup,res);
Buy=Cover=Cross(C,tsl) ;
Sell=Short=Cross(tsl,C) ;

Plot(tsl, _DEFAULT_NAME(), tsl_col, styleStaircase);

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

PlotShapes(IIf(Buy, shapeUpArrow, shapeNone),colorWhite, 0,Low,-15);  
PlotShapes(IIf(Sell, shapeDownArrow, shapeNone),colorYellow, 0,High,-15);  
PlotShapes(IIf(Cover, shapeHollowCircle, shapeNone),colorWhite, 0,Close,0);  
PlotShapes(IIf(Short, shapeHollowCircle, shapeNone),colorYellow, 0,Close,0); 



SetPositionSize(300,spsShares);
ApplyStop(0,1,10,1);
//-----------end--------------
Long=Flip(Buy,Sell); 
Shrt=Flip(Sell,Buy); 

BuyPrice=ValueWhen(Buy,C);
SellPrice=ValueWhen(Sell,C);


Edc=(
WriteIf (Buy AND Ref(shrt,-1), " BUY@ "+C+"  ","")+ 
WriteIf (Sell AND Ref(Long,-1), " SEll@ "+C+"  ","")+
WriteIf(Sell , "Last Trade Profit Rs."+(C-BuyPrice)+"","")+
WriteIf(Buy  , "Last Trade Profit Rs."+(SellPrice-C)+"",""));
dist = 3*ATR(15);
dist1 = 3*ATR(15);
for( i = 0; i < BarCount; i++ ) 
{ 
 if( Buy[i] ) 
 {
  PlotText( "\nBuy:" + C[ i ] + "\nT= " + ((C[i]-tsl[i])+C[i]) + "\nSL= " + tsl[i], i, C[ i ]-dist[i], colorBlue, colorGreen );
 }
 if( Sell[i] )
 {
  PlotText( "Sell:" + C[ i ] + "\nT= " + (C[i]-(tsl[i]-C[i])) + "\nSL= " + tsl[i], i, C[ i ]+dist1[i], colorRed, colorGreen ); 
 }
}
_SECTION_END();
_SECTION_BEGIN("NSA");
function trail_func(jj,trBull,trBear)
{
	trailArray[ 0 ] = jj[ 0 ]; // initialize
	for( i = 1; i < BarCount; i++ )
	{
		prev = trailArray[ i - 1 ];
 
		if (jj[ i ] > prev AND jj[ i - 1 ] > prev)
		{
			trailArray[ i ] = Max(prev,jj[ i ] - trBull[ i ]);
		}
		else if (jj[ i ] < prev AND jj[ i - 1 ] < prev)
		{
			trailArray[ i ] = Min(prev,jj[ i ] + trBear[ i ]);
		}
		else if (jj[ i ] > prev)
		{
			trailArray[ i ] = jj[ i ] - trBull[ i ];
		}
		else
		{
			trailArray[ i ] = jj[ i ] + trBear[ i ];	
		}
	}
	return trailArray;
}

// code by E.M.Pottasch
// adjusted from M.Kartnik 
// following: http://wisestocktrader.com/indicators/1710-nma-v-3-6-a-optimiser

k_bull = Param("mult bull",1.25,1,4,0.05); 
k_bear = Param("mult bear",1.25,1,4,0.05); 
Per= Param("period",10,5,50,1); 
 
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));

ms=ParamList("ST0P/REV",List="Reg|Smoothed",0);
if(ms=="Reg")
{
	nm =(H-L);
	j=(O+H+L+C)/4;
}
else
{
	nm=(HaHigh-HaLow);
	j=(HaOpen+HaHigh+HaLow+HaClose)/4;
}
 
rfsctor = WMA(nm,PER); 
revers_bull=k_bull*rfsctor; 
revers_bear=k_bear*rfsctor;

nw = trail_func(j,revers_bull,revers_bear);

GraphXSpace = 5;
SetChartOptions(0, chartShowDates);

Plot(IIf(NW > j,NW,Null),"\ntrailShort",ParamColor("ColorTrailShort",ColorRGB(255,0,0)),styleStaircase);
Plot(IIf(NW < j,NW,Null),"\ntrailLong",ParamColor("ColorTrailLong",ColorRGB(0,255,0)),styleStaircase);
_SECTION_END();

prev=AMA2(C,1,0);
d=IIf(C>Ref(Max(Max(H,Ref(H,-20)),Max(Ref(H,-10),Ref(H,-15))),-1),Min(Min(L,Ref(L,-20)),Min(Ref(L,-10),Ref(L,-15))),
  IIf(C<Ref(Min(Min(L,Ref(L,-20)),Min(Ref(L,-10),Ref(L,-15))),-1),Max(Max(H,Ref(H,-20)),Max(Ref(H,-10),Ref(H,-15))),PREV));
a=Cross(Close,d);
b=Cross(d,Close);
state=IIf(BarsSince(a)<BarsSince(b),1,0);
s=state>Ref(state,-1);
ss=state<Ref(state,-1);
sss=state==Ref(state,-1);
col=IIf(state == 1 ,51,IIf(state ==0,4,1));
Plot(C,"",Col,128);
PlotShapes( shapeUpArrow * s ,6,0,L); 
PlotShapes( shapeDownArrow *ss ,4,0,H);

Filter =  s OR sss OR sss  ;
AddColumn(C,"close",1.2);
AddColumn( IIf( s, 66,1 ), "buy", formatChar, 1, bkcolor =IIf (s,colorYellow, colorPink ));
AddColumn( IIf( Ss, 83,1 ), "sell", formatChar, 1, bkcolor =IIf (Ss,colorPink, colorYellow ));
AddColumn( IIf( sss, 87,1 ), "wait", formatChar, 1, bkcolor =IIf (sss,colorYellow, colorRed ));
                            
_SECTION_BEGIN("");
_N(Title = "{{NAME}} - {{INTERVAL}} {{DATE}}: "+_DEFAULT_NAME()+" : {{OHLCX}} {{VALUES}}" 
+"\n"+EncodeColor(colorYellow)+
WriteIf(s,"EXIT all Short positions\nif trading long positions, enter long Now-\nOR at the market price on tomorrow's Open with stop="+EncodeColor(4)+WriteVal(L+.75*ATR(5),1.4)+",","")+
WriteIf(ss,"exit all long positions today with a Market On Close (MOC) order\nOR at the market price on tomorrow's Open with stop="+EncodeColor(4)+WriteVal(Ref(H+.75*ATR(5), -1),1.4)+",","")+ 
WriteIf( sss ,"No trading signals today.","") );

_SECTION_BEGIN("FDS SWING");
no=15;
res=HHV(H,no);
sup=LLV(L,no);
avd=IIf(C>Ref(res,-1),1,IIf(C<Ref(sup,-1),-1,0));
avn=ValueWhen(avd!=0,avd,1);
supres=IIf(avn==1,sup,res);

Plot(supres,"Swing SL",colorOrange,styleStaircase);
_SECTION_END();
Back