Can any one correct this afl

#1
dear all can any one correct this afl specially for Hirshi ji


_SECTION_BEGIN(" ");
SetChartOptions(0,chartShowArrows|chartShowDates);
_N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 ) ) ));
Plot( C, "Close", ParamColor("Color", colorBlue ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() );
_SECTION_END();

_SECTION_BEGIN("");
SetBarsRequired(200,0);
GraphXSpace = 3;

SetChartOptions(0,chartShowArrows|chartShowDates);

HaOpen = AMA( Ref( BH4(), -1 ), 0.5 );
HaHigh = Max( H, Max( BH4(), HaOpen ) );
HaLow = Min( L, Min( BH4(), HaOpen ) );
PlotOHLC( HaOpen, HaHigh, HaLow,BH4(), "" + Name(), colorRed, styleCandle | styleNoLabel );


//=======================================================================================================================
//=========================Indicator==============================================================================================

f=BH14();
T=1;
zz=(BH3((BH2(BH16()))*BH17()));
//===============SYSTEM================

Plot(zz, "", IIf(T == 1, 27, 4), 4);

Buy=Cross(BH4(),zz);
Sell=Cross(zz,BH4());
shape = Buy * shapeUpArrow + Sell * shapeDownArrow;
PlotShapes( shape, IIf( Buy, colorWhite, colorWhite ), 0, IIf( Buy, Low-f, High+f));
GraphXSpace = 0;
dist = 1*f;
for( i = 0; i < BarCount; i++ )
{
if( Buy ) PlotText( "Buy@"+zz[i-1],i,zz[i-1]-dist[i-1], colorWhite, colorBlue);
if( Sell ) PlotText( "Sell@"+zz[i-1 ],i,zz[i-1]+dist[i-1], colorBlack, colorWhite );
AlertIf(Sell,"SOUND C:\\Windows\\Media\\ding.wav","zz > close" );
AlertIf(Buy,"SOUND C:\\Windows\\Media\\ding.wav","zz < close" );
}

_SECTION_END();
_SECTION_BEGIN("");

pd =BH20();
pds = 2*pd-1;// (Adjustment for Wilders MA)
aa = Close-Ref(Close,-1);
uu = EMA(Max(0,aa),pds);
dd= EMA((Max(0,0-aa)),pds);

rf = IIf(C>2,1000,10000);

c1 = BH21();

qq1 =100/(100-c1)-1;
ff1 = qq1*dd-uu;
ff2 = ff1/qq1;
f1 = Max(ff1,ff2);
UL = Close + f1*(pds-1)/2;
UL = IIf(UL>C,floor(UL*rf),ceil(UL*rf))/rf;

c2 = BH22();

qq2 =100/(100-c2)-1;// [=1]
ff = dd-uu;
MM = Close + ff*(pds-1)/2;
MM = IIf(MM>C,floor(MM*rf),ceil(MM*rf))/rf;

c3 =BH23();

qq3 =100/(100-c3)-1;
ff1 = qq3*dd-uu;
ff2 = ff1/qq3;
f3 = Min(ff1,ff2);
LL = Close + f3*(pds-1)/2;
LL = IIf(LL>C,floor(LL*rf),ceil(LL*rf))/rf;

band =BH24();

mmu = MM+band;
mmd = MM-band;

X=Cross(LL,C);
Y=Cross(C,UL);


Buy1= X ;
Sell1= Y ;

PlotShapes(shapeCircle*Buy1,colorWhite,1,L,1);
PlotShapes(shapeCircle*Sell1,colorBlue,1,H,1);
Filter=Buy1 OR Sell1 ;
AddTextColumn(FullName(),"Name");
AddColumn(Buy1,"Buy");
AddColumn(Sell1,"sell");


dist = 0*ATR(0);

for( i = 0; i < BarCount; i++ )
{

//if( Buy ) PlotText( "B" , i, L[ i ]-dist, colorBlack,colorGreen );
//if( Sell ) PlotText( "S" , i, H[ i ]+dist, colorBlack, colorRed );
if( Sell1 ) PlotText( "S" , i, H[ i ]+dist, colorGreen, colorWhite );
if( Buy1 ) PlotText( "B", i, L[ i ]-dist, colorRed, colorWhite );


}

//PlotShapes( Buy * shapeUpArrow + Sell * shapeDownArrow, IIf( Buy, colorYellow, colorYellow ) );
//PlotShapes( Buy * shapeSmallUpTriangle + Sell * shapeSmallDownTriangle, IIf( Buy, colorGreen, colorRed ) );


_SECTION_END();

//=================TITLE================================================================================================

_SECTION_BEGIN("");

if( Status("action") == actionIndicator )
(
Title = EncodeColor(colorPink)+ " ravi}" + " - " + Name() + " - " + EncodeColor(colorRed)+ Interval(2) + EncodeColor(colorPink) +
" - " + Date() +" - " +EncodeColor(colorPink)+
WriteIf (Buy, " GO LONG / Reverse Signal at "+L+" "," ")+EncodeColor(colorRed)+
WriteIf (Sell, " EXIT LONG / Reverse Signal at "+H+" "," ")+EncodeColor(colorBlue));
_SECTION_END();
_SECTION_BEGIN("");
// Background color
SetChartBkColor(ParamColor("Panel color ",colorBlack));

TicDiv= 1;
Titledisplay= ParamToggle("Display pivot stats","No|Yes",1);


//---- pivot points


BH30(zz);


_SECTION_BEGIN("");
SetChartOptions(0,chartShowArrows|chartShowDates);
C11=ParamColor("up panel",colorBlack );
C12=ParamColor("dn panel",colorBlack );
C13=BH25();
C14=BH26();
C15=BH27();
Miny = Status("axisminy");
Maxy = Status("axismaxy");
lvb = Status("lastvisiblebar");
fvb = Status("firstvisiblebar");
pxwidth = Status("pxwidth");
pxheight = Status("pxheight");
GfxSetBkMode( 0 );
GfxSetOverlayMode(1);
GfxGradientRect(0,0,pxwidth, pxheight, C11, C12 );
GfxSelectFont("Tahoma", Status("pxheight")/C13 );
GfxSetTextAlign( 6 );
GfxTextOut( Name(), Status("pxwidth")/C14, Status("pxheight")/C15 );
GfxSelectFont("Tahoma", Status("pxheight")/C13*0.5 );
BH28();
GfxSelectFont("Tahoma", Status("pxheight")/C13*0.5 );
BH29();
 
#2
www.artradingsystem.com
Is this the same AFL you have posted ?????

I dont know if this below code is correct or not, you take advice with other experts also.
:thumb::thumb:


PHP:
_SECTION_BEGIN(" ");
SetChartOptions(0,chartShowArrows|chartShowDates);
_N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 ) ) ));
Plot( C, "Close", ParamColor("Color", colorBlue ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() );
_SECTION_END();

_SECTION_BEGIN("");
SetBarsRequired(200,0);
GraphXSpace = 10;

SetChartOptions(0,chartShowArrows|chartShowDates);
HaClose = (O+H+L+C)/4;
BH4 = HaClose;
HaOpen = AMA( Ref( BH4, -1 ), 0.5 );
HaHigh = Max( H, Max( BH4, HaOpen ) );
HaLow = Min( L, Min( BH4, HaOpen ) );
//PlotOHLC( HaOpen, HaHigh, HaLow,BH4, "" + Name(), colorRed, styleCandle | styleNoLabel );


//================================================== ================================================== ===================
//=========================Indicator================ ================================================== ============================

f=1;
T=1;
zz= O;//(BH3((BH2(BH16()))*BH17()));
//===============SYSTEM================

Plot(zz, "", IIf(T == 1, 27, 4), 4);

Buy=Cross(BH4,zz);
Sell=Cross(zz,BH4);
shape = Buy * shapeUpArrow + Sell * shapeDownArrow;
PlotShapes( shape, IIf( Buy, colorLime, colorRed ), 0, IIf( Buy, Low-f, High+f));
GraphXSpace = 10;
dist = 2*f;
for( i = 0; i < BarCount; i++ )
{
if( Buy[i] ) PlotText( "Buy@"+zz[i-1],i,zz[i-1]-dist[i-1], colorLime);
if( Sell[i] ) PlotText( "Sell@"+zz[i-1 ],i,zz[i-1]+dist[i-1],  colorRed );
AlertIf(Sell,"SOUND C:\\Windows\\Media\\ding.wav","zz > close" );
AlertIf(Buy,"SOUND C:\\Windows\\Media\\ding.wav","zz < close" );
}

_SECTION_END();
 

Similar threads