dear all
can any one correct this afl pls
_SECTION_BEGIN("ooa");
GfxSetBkMode(1);
jmot=SS_jmot();
Graph0=jmot;
Graph0BarColor=IIf(jmot>0,5,4);
_SECTION_BEGIN("hmw");
GfxSelectFont("tohomabold", Status("pxheight")/16);
GfxSetTextAlign( 6 );
GfxSetTextColor( ColorHSB( 220, 290, 250) );
GfxSetBkMode(0);
GfxTextOut( Name(), Status("pxwidth")/1.8, Status("pxheight")/45 );
SS_hrd();
cx=Param("cxposn",1085,0,1200,1);
cy=Param("cyposn",16,0,1000,1);
GfxSetBkColor(ColorRGB(200,50,100));
GfxSelectFont( "Bodoni MT",25,98, False);
GfxSetTextColor( colorYellow);
GfxSetTextColor( ColorHSB( 100, 10, 400) );
GfxTextOut("LTP. "+C+" ", cx, cy );
SS_hrd();
_SECTION_END();
_SECTION_END();
_SECTION_BEGIN("Title");
DDayO = TimeFrameGetPrice("O", inDaily);
DHiDay = TimeFrameGetPrice("H", inDaily);
DLoDay = TimeFrameGetPrice("L", inDaily);
prvC = TimeFrameGetPrice("C", inDaily, -1);//close
DayH = TimeFrameGetPrice("H", 60*105, -1);// yesterdays high
DayL = TimeFrameGetPrice("L", 60*105, -1);//low
DayC = TimeFrameGetPrice("C", 60*105, -1);//close
DayO = TimeFrameGetPrice("O", 60*105);// current day open
HiDay = TimeFrameGetPrice("H", 60*105);
LoDay = TimeFrameGetPrice("L", 60*105);
Title = EncodeColor(ColorRGB(10,190,300))+" *
www.stockxray.in * "+EncodeColor(colorWhite) +" "+ Interval(2) + " " + Date() +
EncodeColor(colorBrightGreen) + " \n O " + EncodeColor(colorBrightGreen) + O +
" H : " + H +
" L : " + L+ EncodeColor(colorOrange) +
" ~ Prev D - Close : " + EncodeColor(colorPink) + prvC +EncodeColor(colorGold)+
"\n Day Open : " +DDayO + " High : " +DHiDay + " Low : " + DLoDay ;
_SECTION_END();
_SECTION_BEGIN("950");
SS_xlq();
kep=SS_C1();
gorn=SS_C2();
SS_hrd();
url = SS_A1();
klo = SS_B1();
pos = 4.9*ATR(5);
for( i = 0; i < BarCount; i++ ) {
if( kep
) PlotText( "Buy * S-xray @\n" +url, i, Low - pos, colorAqua, Offset=-10 );
if( gorn ) PlotText( "Sell * S-xray @\n" + klo, i, Low + pos, colorRose, Offset=-10 );
}
_SECTION_END();
_SECTION_BEGIN("750");
range = Param("ADX Periods", 7, 2, 200, 1 );
Col_adx = IIf(ADX(range) > Ref(ADX(range),-1) AND ADX(range) > 20,colorBlue, colorGrey40);
em = Param("EMA Of ADX",3,1,20,1);
p = EMA(PDI(range),em);
m = EMA(MDI(range),em);
SS_ntk();
//Plot( ADX(range), _DEFAULT_NAME(), Col_adx , ParamStyle("ADX style", styleThick ) );
btp = BBandTop( P, 5, 0.4 );
bbp = BBandBot( P, 5, 0.4 );
btm = BBandTop( m, 5, 0.4 );
bbm = BBandBot( m, 5, 0.4 );
//Plot(btp , "" , colorDarkGreen, styleDashed );
//Plot(bbp , "" , colorDarkGreen, styleDashed );
//Plot( btm, "" , colorDarkRed, styleDashed );
//Plot( bbm, "" , colorDarkRed, styleDashed );
Col_p = IIf(p > btp, colorBrightGreen,colorDarkGreen);
Col_m = IIf(m > btm,colorRed,colorDarkRed);
//Plot( p, "+DI", Col_p, styleDots );
//Plot( M, "-DI", Col_m, styleDots );
Buy = ADX(range) > MDI(range) AND PDI(range) > MDI(range);
Sell = ADX(range) > PDI(range) AND MDI(range) > PDI(range);
Buy_sell = IIf(Buy,colorGreen,IIf(Sell,colorRed,colorBlack));
trend = IIf(col_p==colorBrightGreen,colorBrightGreen,IIf(col_m==colorRed,colorRed,IIf(PDI(range) > MDI(range),colorDarkGreen,colorDarkRed)));
//Plot(6, "", op, styleOwnScale| styleArea|styleNoLabel,-0.5,100);
Buy_p = p > btp OR m < bbm;
Buy_p1 =p > btp AND m < bbm;
Sell_m = m > btm OR p < bbp;
Sell_m1 = m > btm AND p < bbp;
//SetChartBkGradientFill( ParamColor("BgTop", colorBrightGreen),ParamColor("BgBottom", colorSeaGreen));
//Plot(5, "", Buy_sell, styleOwnScale| styleArea|styleNoLabel,-0.5,100);
//Plot(Close,"close",bs,styleCandle|styleNoLabel,styleThick);
Loy = IIf(O>klo,colorBrightGreen,IIf(O<url,colorRed,IIf(Buy_p AND Sell_m,colorWhite,IIf(Buy_p,colorBlue,IIf(Sell_m,colorPink,colorBlack)))));
//Plot(5, "", Bop, styleOwnScale| styleArea|styleNoLabel,-0.5,100);
SS_hrd();
HaClose =EMA((O+H+L+L+C)/5,3);
HaOpen = AMA( Ref( HaClose, -1 ), 0.5 );
HaHigh = Max( H, Max( HaClose, HaOpen ) );
HaLow = Min( L, Min( HaClose, HaOpen ) );
PlotOHLC( HaOpen, HaHigh, HaLow, HaClose,"" , Loy, styleCandle| styleNoLabel );
//PlotOHLC( HaOpen, HaHigh, HaLow, HaClose,"" , Loy, styleBar| styleNoLabel );
//Plot(C,"",Loy,styleCandle+styleThick| styleNoLabel);
_SECTION_END();
SetChartBkColor(ColorHSB(140,190,135));
Col_cci = IIf(CCI(8) > 5, colorBrightGreen,IIf(CCI(8) <-5,colorRed,IIf(CCI(8) > Ref(CCI(8),-1),colorBlue,colorDarkRed)));
//Plot(Close,"Price",Col_cci, styleCandle+styleThick| styleNoLabel);
//Plot(Close,"Price",colorWhite, styleCandle| styleNoLabel);
_SECTION_END();
_SECTION_BEGIN("y450");
SS_hrd();
umkro = SS_E1();
jldop = SS_E2();
pot=(gorn+(umkro*0.0038));
sot=( kep-(umkro*0.0038));
yoi=(gorn+(umkro*0.0055));
iok=( kep-(umkro*0.0055));
SS_hrd();
kep=SS_C1();
gorn=SS_C2();
messageboard = ParamToggle("","",0);
exitlong = gorn;
exitshort = kep;
BT1 = SS_BT1();
BT2 = SS_BT2();
BT3 = SS_BT3();
BT4 = SS_BT4();
ST1 = SS_ST1();
ST2 = SS_ST2();
ST3 = SS_ST3();
ST4 = SS_ST4();
for(i=BarCount-1;i>1;i--)
{
if( kep == 1)
{
BT11 = BT1;
BT22 = BT2;
BT33 = BT3;
BT44 = BT4;
entry = url;
sig = "kep";
tar1 = BT11;
tar2 = BT22;
tar3 = BT33;
tar4 = BT44;
bars = i;
i = 0;
}
if(gorn == 1)
{
sig = "gorn";
ST11 = ST1;
ST22 = ST2;
ST33 = ST3;
ST44 = ST4;
entry = klo;
tar1 = ST11;
tar2 = ST22;
tar3 = ST33;
tar4 = ST44;
bars = i;
i = 0;
}
}
Offset = 20;
Clr = IIf(sig == "kep",colorDarkBlue,colorDarkRed);
Plot(LineArray(bars-Offset, tar1, BarCount, tar1,1), "", Clr, styleLine, Null, Null, Offset);
Plot(LineArray(bars-Offset, tar2, BarCount, tar2,1), "", Clr, styleLine, Null, Null, Offset);
Plot(LineArray(bars-Offset, tar3, BarCount, tar3,1), "", Clr, styleLine, Null, Null, Offset);
Plot(LineArray(bars-Offset, tar4, BarCount, tar4,1), "", Clr, styleLine, Null, Null, Offset);
for (i=bars; i <BarCount;i++)
{
//PlotText("REC"+" "+entry, BarCount+1,entry,Null,colorBlue);
PlotText("T 1 ",BarCount+4,tar1,Null,Clr);
PlotText("T 2 ",BarCount+4,tar2,Null,Clr);
PlotText("LT1 ",BarCount+4,tar3,Null,Clr);
PlotText("LT2 ",BarCount+4,tar4,Null,Clr);
}
printf("Last " + sig + " Signal came " + (BarCount-bars) + " bars ago");
printf("\n" + sig + " @ : " + entry + "\nStop Loss : " + " (" + WriteVal(IIf(sig == "gorn",entry-C,C-entry), 2.2) + ")"+ "\nTarget_1 : " + tar1 + "\nTarget_2 : " + tar2 + "\nTarget_3 : " + tar3);
printf("\nCurrent P/L : " + WriteVal(IIf(sig == " kep",(C-entry),(entry-C)),2.2));
_SECTION_BEGIN("380");
breakout = ParamToggle(" ","no|yes ",1);
SS_lot();
SS_lot1();
SS_blt();
SS_blt1();
Asd=IIf(breakout,SS_lot1(),SS_blt1());
Lkj=IIf(breakout,SS_lot(),SS_blt());
_SECTION_END();
_SECTION_BEGIN("550");
TimeFrameSet(60*in1Minute);
//SS_Z1
ul = SS_Z1();
TimeFrameRestore(); // restore time frame to original
jml=TimeFrameExpand(ul , 60*in1Minute);
//downtrendf=TimeFrameExpand( downtrend, 15*in1Minute);
Colorf=TimeFrameExpand (colorGold, 60*in1Minute);
Plot( 2, "zone",IIf(O>jml,colorBlue,colorRed),styleOwnScale|styleArea|styleNoLabel,1, 100,1);
//Plot( Volume, _DEFAULT_NAME(), ParamColor("Color", colorPaleBlue ), ParamStyle( "Style",styleArea | styleNoLabel , styleOwnScale ), 30);
_SECTION_BEGIN("oip");
TimeFrameSet( inDaily ); // switch now to dayily
Oo=SS_BB1();
so=SS_BB2();
Ok=SS_BB3();
TimeFrameRestore(); // restore time frame to original
OIp=(Oo+so+Ok)/3;
Plot( TimeFrameExpand( OIp, inDaily),"powerline", colorYellow,1+55+1| styleNoLabel);
_SECTION_BEGIN("Volume");
cx = Param("cxposn",1065,0,1600,1);
cy = Param("cyposn", 10,0,1600,10 );
GfxSelectFont( " Arial ", 10, 98, False );
GfxSetTextColor( colorBrightGreen );
GfxTextOut("Volume : " +Volume+ "", cx +20,cy +50);
Plot( SS_mo3(), "megic 1 ", colorWhite, styleStaircase |styleThick|styleNoLabel);
_SECTION_END( );
_SECTION_BEGIN("pdi");
kmir = SS_Z2();
kdir = SS_Z3();
yy=Cross(jldop,kmir);
tt=Cross(kdir,jldop);
shape = (yy * shapeHollowSmallSquare + tt * shapeHollowSmallSquare);
dist = 2.5*ATR(10);
for( i = 0; i < BarCount; i++ )
{
if( yy ) PlotText("J\n" , i, L[ i ]-dist, colorWhite,colorGreen );
if( tt ) PlotText( "J\n" , i, H[ i ]+dist, colorWhite, colorDarkRed );
}
Ol = SS_Z4();
Ol1 = SS_Z5();
bomr=Cross(jldop,Ol);
fymo=Cross(Ol1,jldop);
PlotShapes(shapeStar*bomr,colorWhite,0,O,-20);
PlotShapes(shapeStar*fymo,colorBlack,0,O,20);
ejo=Cross(jldop,tar2);
Osj=Cross(tar2,jldop);
PlotShapes(shapeHollowStar*ejo,colorDarkBlue,0,L,-20);
PlotShapes(shapeHollowStar*Osj,colorViolet,0,H,20);
dist = 2.3*ATR(20);
for( i = 0; i < BarCount; i++ )
{
if( ejo ) PlotText("p\n" , i, L[ i ]-dist,colorLightYellow, colorBlue );
if( Osj ) PlotText( "p\n" , i, H[ i ]+dist, colorLightYellow,colorViolet );
}
_SECTION_END();
_SECTION_BEGIN("15");
see=(O+H+L)/3;
nhop= SS_SW1();
Impulse_UP= Cross( see,nhop ) AND Cross( see,nhop ) ;
Impulse_Down=Cross( nhop , see ) AND Cross( nhop,see );
shapeUpArrow = Param("Buy Shape Typ",59,1,60,1);
shapeDownArrow = Param("Sell Shape Typ",60,1,60,1);
dist = 2.5*ATR(10);
for( i = 0; i < BarCount; i++ )
{
if( Impulse_UP ) PlotText( "SE\n" , i, L[ i ]-dist, colorWhite,colorDarkBlue );
if( Impulse_Down ) PlotText( "BE\n" , i, H[ i ]+dist, colorWhite, colorRed );
}
_SECTION_BEGIN("asrt");
Shadowcolor1 = ParamColor("Shadow1",ColorRGB(7,72,86));
PlotOHLC( 0, asd ,Lkj , Lkj , "", IIf(asd > Lkj ,Shadowcolor1,ColorRGB(7,72,86)), styleCloud | styleNoLabel);
_SECTION_END( );
_SECTION_BEGIN("aslo");
a15 = SS_a11();
a14 = SS_a2();
S14 = SS_a3();
S15 = SS_a4();
Shadowcolor = ParamColor("Shadow",ColorRGB(67,39,67));
Shadowcolor2 = ParamColor("Shadow2",ColorRGB(36,53,113));
style = styleDots | styleThick + styleNoRescale ;
rcolor = colorWhite;
scolor = colorGreen;
PlotOHLC(0 , a15 , a14 , a14 , "", IIf(a15 > a14 ,Shadowcolor,ColorRGB(67,39,67)),styleCloud| styleNoLabel);
PlotOHLC( 0, s15 , s14 , s14 , "", IIf(S15 > S14 ,Shadowcolor2,ColorRGB(36,53,113)), styleCloud | styleNoLabel);
_SECTION_END( );
_SECTION_BEGIN("lei");
if (messageboard == 0 )
{
GfxSelectFont( "Tahoma", 10, 100 );
//GfxSetBkMode( 0 );
GfxSetTextColor( colorWhite );
if ( sig ==" kep")
{
GfxSelectSolidBrush( colorBlue );
}
else
{
GfxSelectSolidBrush( colorRed );
}
pxHeight = Status( "pxchartheight" ) ;
xx = Status( "pxchartwidth");
Left = 1100;
width = 310;
x = 3;
x2 = 210;
y = pxHeight;
GfxSelectPen( colorWhite, 4);
GfxRoundRect( x, y - 88, x2, y -1, 25, 150 ) ;
GfxTextOut( ( "* STOCKXRAY MAGIC * "),101,y-85);
GfxSetTextColor(ColorHSB(125,180,300));
GfxTextOut( (" STOP LOSS : " + WriteVal(IIf(sig == " kep",(umkro-yoi),(umkro-iok)),2.1)), 95, y-20);;
GfxTextOut( (" SECURED SL # REVERSE TREND "), 105, y-35);
GfxSetTextColor( colorWhite );
//GfxTextOut( " "+Now(2), 250, y-35);
GfxSetTextColor( colorYellow );
GfxSetTextColor( colorBrightGreen );
GfxTextOut( ("CURRENT P/L : " + WriteVal(IIf(sig == " kep",(C-entry),(entry-C)),2.1)), 90, y-70);
GfxSelectFont("Tahomabold", 9.4, 100 );
GfxSetTextColor(ColorHSB(30,4,250));
GfxTextOut( ("BEST OPPORTUNITY * " + WriteVal(IIf(sig == " kep",(umkro-pot),(umkro-sot)),2.1)), 103, y-52);;
GfxSetTextColor(ColorRGB(10,250,250));
GfxTextOut( ( " Develop By "),1150,y-45);
GfxSetTextColor(ColorRGB(10,250,250));
GfxTextOut( ( "* STOCKXRAY SYSTEM * "),1150,y-25);
GfxSelectFont("Tahomabold",13,1,100 );
}
_SECTION_END( );
_SECTION_BEGIN("ikpr");
x=Param("xposn",434,0,2000,1);
y=Param("yposn",717,0,2000,1);
for(i=BarCount-1;i>1;i--)
{
if(Impulse_UP == 1)
{
result1 = "Impulse_UP";
bars = i;
i = 0;
}
if(Impulse_Down == 1)
{
result1 = "Impulse_Down";
bars = i;
i = 0;
}
}
GfxSelectFont( "Arial", 10, 100 );
GfxSetBkMode( 1 );
GfxSetTextColor( colorBlue );
GfxSelectPen( colorGold, 3 );
if ( result1 == "Impulse_UP" )
{
GfxSelectSolidBrush( ColorRGB(0,0,240) );
}
else{
GfxSelectSolidBrush( ColorRGB(255,0,0) );
}
GfxCircle( x-301,y-550,13 );
kmirr = SS_kmirr();
fdop=Cross(jldop,kmirr);
eopt=Cross(kmirr,jldop);
dist = 2.5*ATR(10);
for( i = 0; i < BarCount; i++ )
{
if( fdop ) PlotText("J\n" , i, L[ i ]-dist, colorWhite,colorGreen );
if( eopt ) PlotText( "J\n" , i, H[ i ]+dist, colorWhite, colorDarkRed );
}
for(i=BarCount-1;i>1;i--)
{
if(fdop == 1)
{
result6 = "fdop";
bars = i;
i = 0;
}
if(tt == 1)
{
result6 = "eopt";
bars = i;
i = 0;
}
}
GfxSelectFont( "Arial", 10, 100 );
GfxSetBkMode( 1 );
GfxSetTextColor( colorBlue );
GfxSelectPen( colorGold, 3 );
if ( result6 == "fdop" )
{
GfxSelectSolidBrush( ColorRGB(0,0,240) );
}
else{
GfxSelectSolidBrush( ColorRGB(255,0,0) );
}
GfxCircle( x-230,y-550,13 );
for(i=BarCount-1;i>1;i--)
{
if(yy == 1)
{
result6 = "yy";
bars = i;
i = 0;
}
if(tt == 1)
{
result6 = "tt";
bars = i;
i = 0;
}
}
GfxSelectFont( "Arial", 10, 100 );
GfxSetBkMode( 1 );
GfxSetTextColor( colorBlue );
GfxSelectPen( colorGold, 3 );
if ( result6 == "yy" )
{
GfxSelectSolidBrush( ColorRGB(0,0,240) );
}
else{
GfxSelectSolidBrush( ColorRGB(255,0,0) );
}
GfxCircle( x-265,y-550,13 );
gmod = Cross(O,jml);
nkjr = Cross(jml,O);
for(i=BarCount-1;i>1;i--)
{
if(gmod == 1)
{
result3 = "gmod ";
bars = i;
i = 0;
}
if(nkjr == 1)
{
result3 = "nkjr";
bars = i;
i = 0;
}
}
GfxSelectFont( "Arial", 10, 100 );
GfxSetBkMode( 1 );
GfxSetTextColor( colorBlue );
GfxSelectPen( colorGold, 3 );
if ( result3 == "gmod " )
{
GfxSelectSolidBrush( ColorRGB(0,0,240) );
}
else{
GfxSelectSolidBrush( ColorRGB(255,0,0) );
}
GfxCircle( x-410,y-550,13 );
uoed = jmot>0;
dotp = jmot<0;
for(i=BarCount-1;i>1;i--)
{
if(uoed == 1)
{
result = "uoed";
bars = i;
i = 0;
}
if(dotp == 1)
{
result = "dotp";
bars = i;
i = 0;
}
}
GfxSelectFont( "Arial", 10, 100 );
GfxSetBkMode( 1 );
GfxSetTextColor( colorBlue );
GfxSelectPen( colorGold, 3 );
if ( result == "uoed" )
{
GfxSelectSolidBrush( ColorRGB(0,0,240) );
}
else{
GfxSelectSolidBrush( ColorRGB(255,0,0) );
}
GfxCircle( x-338,y-550,13 );
for(i=BarCount-1;i>1;i--)
{
if(bomr == 1)
{
result4 = "bomr ";
bars = i;
i = 0;
}
if(fymo == 1)
{
result4 = "fymo";
bars = i;
i = 0;
}
}
GfxSelectFont( "Arial", 40, 100 );
GfxSetBkMode( 1 );
GfxSetTextColor( colorBlue );
GfxSelectPen( colorGold, 3 );
if ( result4 == "bomr " )
{
GfxSelectSolidBrush( ColorRGB(0,0,240) );
}
else{
GfxSelectSolidBrush( ColorRGB(255,0,0) );
}
GfxCircle(x-375,y-550,13 );
_SECTION_END();