Need AFL for My Strategy

#11
correct the error

A1= Open;
B1= High;
C1 =Close;

D1 = B1-A1;
E1 = A1-C1;

f1=A1+(B1-A1)+10;
g1=A1-(B1-A1)-10;
h1=F1-12;
i1=F1+21;
j1=G1+12;
k1=G1-21;
//if D is LESS than E : then Plot lines as follows

for(i=0;i<BarCount;i++)
{
if (D1<E1)
{
Plot (f1,"1",colorWhite); // ( ie., " F " )
Plot (g1,"2",colorGreen); // ( ie ., " G " )
Plot (h1,"",colorRed); // ( ie ., " H " )
Plot (i1,"",colorOrange); // ( ie ., " I " )
Plot (j1,"",colorBlue); // (ie ., " J " )
Plot (k1,"",colorLightGrey); // (ie., "K" )
}
else
{
//if D is GREATER OR EQUAL to E : then Plot lines as follows

Plot (L1=I1-( I1*0.45/100 ),"",colorWhite); // ( ie., " L " )
Plot (m1=K1+( k1*0.25/100 ),"",colorGreen); // ( ie ., "M" )
Plot (L1-12,"",colorRed);
Plot (M1+20,"",colorOrange);
Plot (M1+12,"",colorBlue);
Plot (M1-20,"",colorLightGrey);
}
}
 
#12
correct the error

A1= Open;
B1= High;
C1 =Close;

D1 = B1-A1;
E1 = A1-C1;

f1=A1+(B1-A1)+10;
g1=A1-(B1-A1)-10;
h1=F1-12;
i1=F1+21;
j1=G1+12;
k1=G1-21;
//if D is LESS than E : then Plot lines as follows

for(i=0;i<BarCount;i++)
{
if (D1<E1)
{
Plot (f1,"1",colorWhite); // ( ie., " F " )
Plot (g1,"2",colorGreen); // ( ie ., " G " )
Plot (h1,"",colorRed); // ( ie ., " H " )
Plot (i1,"",colorOrange); // ( ie ., " I " )
Plot (j1,"",colorBlue); // (ie ., " J " )
Plot (k1,"",colorLightGrey); // (ie., "K" )
}
else
{
//if D is GREATER OR EQUAL to E : then Plot lines as follows

Plot (L1=I1-( I1*0.45/100 ),"",colorWhite); // ( ie., " L " )
Plot (m1=K1+( k1*0.25/100 ),"",colorGreen); // ( ie ., "M" )
Plot (L1-12,"",colorRed);
Plot (M1+20,"",colorOrange);
Plot (M1+12,"",colorBlue);
Plot (M1-20,"",colorLightGrey);
}
}


Dear Tipss_Bse_Nse ...

Thanks for ur effort to help me in code ... :thumb::thumb:

But sir i cannot locate the error ... plz get me error free code if possible ...

and expecting our seniors will look forward to this ,,,,
 
#13
Dear Friends and experts create AFL for my strategy given below :

-------------------------------


* Take any time frame 1'st candle's open,high,close .,

OPEN = A
HIGH = B
CLOSE = C

D = B-A.,
E = A-C.,

IF D is LESS than E : then plot lines as follows

plot line for A+(B-A)+10 ( ie., " F " )
Plot line for A-(B-A)-10 ( ie ., " G " )
plot line for F-12 ( ie ., " H " )
plot line for F+21 ( ie ., " I " )
plot line for G+12 ( ie ., " J " )
plot line for G-21 (ie., "K" )

or


IF D is GREATER OR EQUAL to E : then plot lines as follows

plot line for I-( I*0.45% ) ( ie., " L " )
plot line for K+( k*0.25% ) ( ie ., "M" )
plot line for L-12
plot line for M+20
plot line for M+12
plot line for M-20



Thanks in advance ...

:thumb:
Help me guys ... im waiting for code ... :confused::confused::confused:
 

extremist

Well-Known Member
#16
Finally your wish come true....

Code:
FB   = Day() != Ref(Day(), -1);

A  =  ValueWhen(FB,O);
B  =  ValueWhen(FB,H);
Cc  =  ValueWhen(FB,C);

D=B-A;
E=A-cc;

F=A+(B-A)+10;
G=A-(B-A)-10;
Hh=F-12;
I=F+21;
J=G+12;
K=G-21;
Ll=I-( I*0.0045 );
M=K+( k*0.0025 );

c1=WriteIf(D<E ,"one","two");
Plot( C, "Price", ParamColor( "Color", colorDefault ), ParamStyle( "Style", styleCandle, maskPrice ) );

if(c1=="one")
{ 
 plot (F,"",colorLightGrey,styledashed );
 plot (G,"",colorLightGrey,styledashed );
 plot (Hh,"",colorLightGrey,styledashed );
 plot (I,"",colorLightGrey,styledashed );
 plot (J,"",colorLightGrey,styledashed );
 plot (K,"",colorLightGrey,styledashed );
 }
 
if(c1=="two")
{ 
 plot (LL,"",colorLightGrey,styledashed );
 plot (M,"",colorLightGrey,styledashed );
 plot ((LL-12),"",colorLightGrey,styledashed );
 plot ((M+20),"",colorLightGrey,styledashed );
 plot ((M+12),"",colorLightGrey,styledashed );
 plot ((M-20),"",colorLightGrey,styledashed );
 }
 

amitrandive

Well-Known Member
#17
Finally your wish come true....

Code:
FB   = Day() != Ref(Day(), -1);

A  =  ValueWhen(FB,O);
B  =  ValueWhen(FB,H);
Cc  =  ValueWhen(FB,C);

D=B-A;
E=A-cc;

F=A+(B-A)+10;
G=A-(B-A)-10;
Hh=F-12;
I=F+21;
J=G+12;
K=G-21;
Ll=I-( I*0.0045 );
M=K+( k*0.0025 );

c1=WriteIf(D<E ,"one","two");
Plot( C, "Price", ParamColor( "Color", colorDefault ), ParamStyle( "Style", styleCandle, maskPrice ) );

if(c1=="one")
{ 
 plot (F,"",colorLightGrey,styledashed );
 plot (G,"",colorLightGrey,styledashed );
 plot (Hh,"",colorLightGrey,styledashed );
 plot (I,"",colorLightGrey,styledashed );
 plot (J,"",colorLightGrey,styledashed );
 plot (K,"",colorLightGrey,styledashed );
 }
 
if(c1=="two")
{ 
 plot (LL,"",colorLightGrey,styledashed );
 plot (M,"",colorLightGrey,styledashed );
 plot ((LL-12),"",colorLightGrey,styledashed );
 plot ((M+20),"",colorLightGrey,styledashed );
 plot ((M+12),"",colorLightGrey,styledashed );
 plot ((M-20),"",colorLightGrey,styledashed );
 }
Thanks !!!

@Bluesquare

Can you please explain how to use this AFL?
 
#18
Finally your wish come true....

Code:
FB   = Day() != Ref(Day(), -1);

A  =  ValueWhen(FB,O);
B  =  ValueWhen(FB,H);
Cc  =  ValueWhen(FB,C);

D=B-A;
E=A-cc;

F=A+(B-A)+10;
G=A-(B-A)-10;
Hh=F-12;
I=F+21;
J=G+12;
K=G-21;
Ll=I-( I*0.0045 );
M=K+( k*0.0025 );

c1=WriteIf(D<E ,"one","two");
Plot( C, "Price", ParamColor( "Color", colorDefault ), ParamStyle( "Style", styleCandle, maskPrice ) );

if(c1=="one")
{ 
 plot (F,"",colorLightGrey,styledashed );
 plot (G,"",colorLightGrey,styledashed );
 plot (Hh,"",colorLightGrey,styledashed );
 plot (I,"",colorLightGrey,styledashed );
 plot (J,"",colorLightGrey,styledashed );
 plot (K,"",colorLightGrey,styledashed );
 }
 
if(c1=="two")
{ 
 plot (LL,"",colorLightGrey,styledashed );
 plot (M,"",colorLightGrey,styledashed );
 plot ((LL-12),"",colorLightGrey,styledashed );
 plot ((M+20),"",colorLightGrey,styledashed );
 plot ((M+12),"",colorLightGrey,styledashed );
 plot ((M-20),"",colorLightGrey,styledashed );
 }

Dear extremist .....,,

Thank u very much for fulfilling my wish .. Thanks for considering me here ...

i have sent pm for some dout ... if possible clear those douts sir ...

:clapping::clapping::clapping::clapping:
 
#19
Thanks !!!

@Bluesquare

Can you please explain how to use this AFL?
Hello sir ... How are you .....


Sure will explain you abt following this AFL sir .. before that i have some issues in that code and asked help for the same ... as soon as its cleared ll explain you for sure sir ... :thumb::thumb::thumb::thumb:
 
#20
Finally your wish come true....

Code:
FB   = Day() != Ref(Day(), -1);

A  =  ValueWhen(FB,O);
B  =  ValueWhen(FB,H);
Cc  =  ValueWhen(FB,C);

D=B-A;
E=A-cc;

F=A+(B-A)+10;
G=A-(B-A)-10;
Hh=F-12;
I=F+21;
J=G+12;
K=G-21;
Ll=I-( I*0.0045 );
M=K+( k*0.0025 );

c1=WriteIf(D<E ,"one","two");
Plot( C, "Price", ParamColor( "Color", colorDefault ), ParamStyle( "Style", styleCandle, maskPrice ) );

if(c1=="one")
{ 
 plot (F,"",colorLightGrey,styledashed );
 plot (G,"",colorLightGrey,styledashed );
 plot (Hh,"",colorLightGrey,styledashed );
 plot (I,"",colorLightGrey,styledashed );
 plot (J,"",colorLightGrey,styledashed );
 plot (K,"",colorLightGrey,styledashed );
 }
 
if(c1=="two")
{ 
 plot (LL,"",colorLightGrey,styledashed );
 plot (M,"",colorLightGrey,styledashed );
 plot ((LL-12),"",colorLightGrey,styledashed );
 plot ((M+20),"",colorLightGrey,styledashed );
 plot ((M+12),"",colorLightGrey,styledashed );
 plot ((M-20),"",colorLightGrey,styledashed );
 }

Dear extremist .... While checking the afl code in amibroker ... the code is not selecting formula 1st rule ... only ploting Lines for 2nd rule for all cases ... plz check it ....

Thanks
 

Similar threads