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 ....
WiseTrader Toolbox
#1 Selling Amibroker Plugin featuring:
Advanced Adaptive Indicators
Advanced Pattern Exploration
Neural Networks
And Much More ....
bharathy simple for Amibroker (AFL)
Copy & Paste Friendly
Back
(Title = StrFormat( EncodeColor( colorRed ) + " {{DATE}} Open - %g, High - %g, Low - %g, Close - %g (%.1f%%) {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 ) ) ) + EncodeColor( colorRed ) + "\n www.Easylivetrade.com +ALERT");
_SECTION_BEGIN("Sound-script");
Length=Param("Length",25, 2);
Deviation=Param("Deviation",2);
MoneyRisk=Param("Money Risk", 1);
LineStyle=ParamToggle("Display line mode", "No|Yes", 0);
cUpTrendLine = ParamColor("UpTrendLine", colorGold);
cDnTrendLine = ParamColor("DownTrendLine", colorGold);
TurnedUp=Nz(StaticVarGet("TurnedUp"));
TurnedDown=Nz(StaticVarGet("TurnedDown"));
SoundON = ParamToggle("Sound","Off|On",1);
procedure CalcTrend_proc(bbtop,bbbot,Length,MoneyRisk,SoundON,TurnedUp,TurnedDown)
{
global UpTrendLine;
global DownTrendLine;
global smax;
global smin;
UpTrendLine=Null;
DownTrendLine=Null;
smax=Null;
smin=Null;
trend=0;
for (i=Length+1; i<BarCount; i++)
{
smax[i]=bbtop[i];
smin[i]=bbbot[i];
if (C[i]>smax[i-1]) trend=1;
if (C[i]<smin[i-1]) trend=-1;
if(trend>0 && smin[i]<smin[i-1]) smin[i]=smin[i-1];
if(trend<0 && smax[i]>smax[i-1]) smax[i]=smax[i-1];
bsmax[i]=smax[i]+0.5*(MoneyRisk-1)*(smax[i]-smin[i]);
bsmin[i]=smin[i]-0.5*(MoneyRisk-1)*(smax[i]-smin[i]);
if(trend>0 && bsmin[i]<bsmin[i-1]) bsmin[i]=bsmin[i-1];
if(trend<0 && bsmax[i]>bsmax[i-1]) bsmax[i]=bsmax[i-1];
if (trend>0)
{
UpTrendLine[i]=bsmin[i];
if (SoundON==True && !TurnedUp && i==BarCount-1 && IsEmpty(UpTrendLine[i-1]))
{
Say("Attention please, Market Going, UP");
PopupWindow(Date()+ "\n > " + Name() + "\n > Buy : " + L[ i ] + "\n > Target : " +(L[i]*1.005) +"\n > Stop Loss : " + (L[i]*0.9975),"Alert", 100, 640*mtRandom(), 480*mtRandom()); TurnedUp=StaticVarSet("TurnedUp",1);
TurnedDown=StaticVarSet("TurnedDown",0);
}
}
if (trend<0)
{
DownTrendLine[i]=bsmax[i];
if (SoundON==True && !TurnedDown && i==BarCount-1 && IsEmpty(DownTrendLine[i-1]))
{
Say("Attention please, Market Going, DOWN");
PopupWindow( Date()+ "\n > " + Name() + "\n > Sell : " + H[i] + "\n > Target : " + (H[i]*0.995)+"\n > Stop Loss : " +(H[i]*1.0025),"Alert", 100, 640*mtRandom(), 480*mtRandom());
TurnedUp=StaticVarSet("TurnedUp",0);
TurnedDown=StaticVarSet("TurnedDown",1);
}
}
}
}
bbtop=BBandTop(C,Length,Deviation);
bbbot=BBandBot(C,Length,Deviation);
CalcTrend_proc(bbtop,bbbot,Length,MoneyRisk,SoundON,TurnedUp,TurnedDown);
UpTrendSigNal=UpTrendLine AND IsEmpty(Ref(UpTrendLine,-1));
DownTrendSigNal=DownTrendLine AND IsEmpty(Ref(DownTrendLine,-1));
dist = 0.8*ATR(10);
dist1 = 2*ATR(10);
for( i = 0; i < BarCount; i++ )
{
if( UpTrendSignal[i] )
{
PlotText( "\nBuy:" + L[ i ] + "\nT= " + (L[i]*1.005) + "\nSL= " + (L[i]*0.9975), i, L[ i ]-dist[i], colorGreen, colorWhite );
}
if( DownTrendSignal[i] )
{
PlotText( "Sell:" + H[ i ] + "\nT= " + (H[i]*0.995) + "\nSL= " + (H[i]*1.0025), i, H[ i ]+dist1[i], colorRed, colorWhite );
}
}
DisplayStyle = styleNoLabel|styleLine|styleNoTitle;
if(LineStyle == 0) DisplayStyle |= styleLine;
Plot(UpTrendLine,"Buy Stop Loss",cUpTrendLine,DisplayStyle);
Plot(DownTrendLine,"Sell Stop Loss",cDnTrendLine,DisplayStyle) ;
PlotShapes(IIf(UpTrendSignal,shapeSquare,shapeNone),colorLime,0,bbbot,Offset=-1);
PlotShapes(IIf(UpTrendSignal,shapeUpArrow,shapeNone),colorWhite,0,bbbot,Offset=-1);
PlotShapes(IIf(DownTrendSignal,shapeSquare,shapeNone),colorOrange,0,bbtop,Offset=-1);
PlotShapes(IIf(DownTrendSignal,shapeDownArrow,shapeNone),colorWhite,0,bbtop,Offset=-1);
_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,64);
Buy = s;
Sell = ss;
shape = Buy * shapeUpArrow + Sell * shapeDownArrow;
//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.","") ;
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, colorWhite ));
AddColumn( IIf( sss, 87,1 ), "wait", formatChar, 1, bkcolor =IIf (sss,colorYellow, colorRed ));
_SECTION_BEGIN("trend");
uptrend=PDI(20)>MDI(10)AND Signal(29)<MACD(13);
downtrend=MDI(10)>PDI(20)AND Signal(29)>MACD(13);
Plot( 2, /* defines the height of the ribbon in percent of pane width */"ribbon",
IIf( uptrend, colorGreen, IIf( downtrend, colorRed, 0 )), /* choose color */
styleOwnScale|styleArea|styleNoLabel, -0.5, 100 );
_SECTION_END();
// set background gradient colours
SetChartBkGradientFill( ParamColor("BgTop", ColorRGB( 0,0,0 )),ParamColor("BgBottom", ColorRGB( 0,0,0 )),ParamColor("titleblock",ColorRGB( 255,255,255 )));
GraphXSpace = 5;