SEARCHING for PROMPT AFL for AMI BROKER

#1
I am using this following AFL in AMI BROKER. But, problem is when it shows BUY Signal, it's already increased a lot, and when it shows SALE signal it 's already decreased a lot, am looking for a prompt AFL which will show SIGNALS much more faster whether to BUY/SALE.

_SECTION_BEGIN("MABIUTS");
SetChartOptions(0,chartShowArrows|chartShowDates);
_N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) Vol " +WriteVal( V, 1.0 ) +" {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 )) ));

Buy=EMA(C,13)>EMA(EMA(C,13),9) AND Cross (C,Peak(C,5,1));
Sell=Cross (EMA(EMA(C,13),9),EMA(C,13));
MYcolor = IIf( EMA(C,13)>EMA(EMA(C,13),9) AND C>Peak(C,2,1), colorGreen, IIf(EMA(C,13)>EMA(EMA(C,13),9) AND C<Peak(C,2,1),colorBlue, colorOrange ));

PlotOHLC( Open, High, Low, Close, "", Mycolor, styleBar );

shape = Buy * shapeUpArrow + Sell * shapeDownArrow;
PlotShapes( shape, IIf( Buy, colorGreen, colorRed ),0, IIf( Buy, Low, High ) );

GraphXSpace = 5;
dist = 1.5*ATR(10);

for( i = 0; i < BarCount; i++ )
{
if( Buy ) PlotText( "Buy\n@" + C[ i ], i, L[ i ]-dist, colorGreen );
if( Sell ) PlotText( "Sell\n@" + C[ i ], i, H[ i ]+dist, colorRed);
}
 

johnnypareek

Well-Known Member
#4
I am using this following AFL in AMI BROKER. But, problem is when it shows BUY Signal, it's already increased a lot, and when it shows SALE signal it 's already decreased a lot, am looking for a prompt AFL which will show SIGNALS much more faster whether to BUY/SALE.

_SECTION_BEGIN("MABIUTS");
SetChartOptions(0,chartShowArrows|chartShowDates);
_N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) Vol " +WriteVal( V, 1.0 ) +" {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 )) ));

Buy=EMA(C,13)>EMA(EMA(C,13),9) AND Cross (C,Peak(C,5,1));
Sell=Cross (EMA(EMA(C,13),9),EMA(C,13));
MYcolor = IIf( EMA(C,13)>EMA(EMA(C,13),9) AND C>Peak(C,2,1), colorGreen, IIf(EMA(C,13)>EMA(EMA(C,13),9) AND C<Peak(C,2,1),colorBlue, colorOrange ));

PlotOHLC( Open, High, Low, Close, "", Mycolor, styleBar );

shape = Buy * shapeUpArrow + Sell * shapeDownArrow;
PlotShapes( shape, IIf( Buy, colorGreen, colorRed ),0, IIf( Buy, Low, High ) );

GraphXSpace = 5;
dist = 1.5*ATR(10);

for( i = 0; i < BarCount; i++ )
{
if( Buy ) PlotText( "Buy\n@" + C[ i ], i, L[ i ]-dist, colorGreen );
if( Sell ) PlotText( "Sell\n@" + C[ i ], i, H[ i ]+dist, colorRed);
}


Because it use Peak/through function in which % is taken so until price and it looks into future.
 

KelvinHand

Well-Known Member
#5
I am using this following AFL in AMI BROKER. But, problem is when it shows BUY Signal, it's already increased a lot, and when it shows SALE signal it 's already decreased a lot, am looking for a prompt AFL which will show SIGNALS much more faster whether to BUY/SALE.

_SECTION_BEGIN("MABIUTS");
SetChartOptions(0,chartShowArrows|chartShowDates);
_N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) Vol " +WriteVal( V, 1.0 ) +" {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 )) ));

Buy=EMA(C,13)>EMA(EMA(C,13),9) AND Cross (C,Peak(C,5,1));
Sell=Cross (EMA(EMA(C,13),9),EMA(C,13));
MYcolor = IIf( EMA(C,13)>EMA(EMA(C,13),9) AND C>Peak(C,2,1), colorGreen, IIf(EMA(C,13)>EMA(EMA(C,13),9) AND C<Peak(C,2,1),colorBlue, colorOrange ));

PlotOHLC( Open, High, Low, Close, "", Mycolor, styleBar );

shape = Buy * shapeUpArrow + Sell * shapeDownArrow;
PlotShapes( shape, IIf( Buy, colorGreen, colorRed ),0, IIf( Buy, Low, High ) );

GraphXSpace = 5;
dist = 1.5*ATR(10);

for( i = 0; i < BarCount; i++ )
{
if( Buy ) PlotText( "Buy\n@" + C[ i ], i, L[ i ]-dist, colorGreen );
if( Sell ) PlotText( "Sell\n@" + C[ i ], i, H[ i ]+dist, colorRed);
}



Above code resulted more SELLER then BUYER appear.
Below do a small modification to attract the hiding BUYER.

You are trading for Profitability$ NOT indicators (regardless lag or non-lag.)
Work with imperfect not desire.




PHP:
 SetChartOptions(0,chartShowArrows|chartShowDates);
_N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) Vol " +WriteVal( V, 1.0 ) +" {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 )) ));

ShowMAs = ParamToggle("Show MAs", "No|Yes", 1);

//-- Modified by KelvinHand V3.0 -----
MA1=EMA(C,13);
MA2=EMA(MA1,9);

//MA3=BBandTop(C,20,2);//Ref(MA(C,3), -3);
//MA4=BBandBot(C,20,2);//Ref(MA(C,3), -3);


MA5=MA((H+L+C)/3,5);
stk = StochK();
std = StochD();

if(ShowMAs)
{
Plot(MA1, "MA1", colorYellow);
Plot(MA2, "MA2", colorRed);
//Plot(MA3, "MA3", colorGrey40, styleDashed);
//Plot(MA4, "MA4", colorGrey40, styleDashed);
//Plot(MA5, "MA5", colorDarkYellow, styleDashed);

}



Buy = Cross (MA1,MA2);
Sell= Cross (MA2,MA1);

Short = MA1>MA2 AND BarsSince( Cross(stk, std)) AND std>80 AND Cross(ma5,C) AND C<O;
Cover =  MA1<MA2 AND BarsSince( Cross(std, stk)) AND std<20 AND Cross(C,ma5) AND C>O;


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


BullColor = ParamColor("Bull Color", colorGreen);
BearColor = ParamColor("Bear Color", colorRed);
NTColor = ParamColor("Bear Color", colorDarkYellow);


MYcolor = IIf( C>MA1, BullColor, 
				 IIf(C<MA1 , BearColor, NTColor));
PlotOHLC( Open, High, Low, Close, "", Mycolor, styleCandle );

shape = Buy * shapeUpArrow + Sell * shapeDownArrow;
PlotShapes( shape, IIf( Buy, colorGreen, colorRed ),0, IIf( Buy, Low, High ) );

shape = Short * shapeSmallDownTriangle;
PlotShapes( shape,ColorRGB(128,0,128),0, High);

shape = Cover * shapeSmallUpTriangle;
PlotShapes( shape,ColorRGB(128,128,0),0, Low);



GraphXSpace = 5;
dist = 1.123*ATR(10);


for( i = 0; i < BarCount; i++ )
{
if( Buy[i] ) PlotText( "Buy\n@" + C[ i ], i, L[ i ]-dist[i], colorGreen );
if( Sell[i] ) PlotText( "Sell\n@" + C[ i ], i, H[ i ]+dist[i], colorRed);
if( Short[i] ) PlotText( "@" + C[ i ], i, H[ i ]+dist[i], ColorRGB(128,0,128));
if( Cover[i] ) PlotText( "@" + C[ i ], i, L[ i ]-dist[i], ColorRGB(128,128,0));

}


 
Last edited:
#6
I have no knowledge of coding..could u plz tell me that u have modified a bit for hidden buyer code, so that I can apply that to AMI BROKER..
 

KelvinHand

Well-Known Member
#7
I have no knowledge of coding..could u plz tell me that u have modified a bit for hidden buyer code, so that I can apply that to AMI BROKER..
I tested the V1 on the daily timeframe on EOD, it seen ok. But try on 5min, the AFL was unstable.
It is my mistake.

Can you put up the 2 different AFLs on same stock and see the different.
You should see the modified version give more BUY then the original.
 
Last edited:

KelvinHand

Well-Known Member
#8
I tested the V1 on the daily timeframe on EOD, it seen ok. But try on 5min, the AFL was unstable.
It is my mistake.

Can you put up the 2 different AFLs on same stock and see the different.
You should see the modified version give more BUY then the original.


Can you test out the post#5 again.
I simplify again by remove the Peak function that limit your buy opportunities.
Doing just Cross only.

 
Last edited:

Similar threads