Anantji please helpfor afl

VJAY

Well-Known Member
#1
Dear anantji,
Your PM not accepting any messages so opened this thread.....Please help me for a afl which scan both hammers(with long wick..double of body)...in ami..hope to get it from you...earlear I got lot help from you...
Thanks a lot..........
 

VJAY

Well-Known Member
#2

asnavale

Well-Known Member
#3
Dear anantji,
I find this afl for above ...but unable to use it.....can you please modify it for my need(for scan hammer/hanging man/inversed hammer) ...
http://www.amibroker.com/library/detail.php?id=424
Thanks...
Hi Vijay,

The AFL given in the link you have quoted is a function. Copy the whole code into AFL editor. To the code add the following lines to get the hammer and inverted hammer patterns:

PatternCode = IIF(CandlePattern(14), 14, IIF(CandlePattern(15), 15, 0));
Filter = PatternCode > 0;
//Other required code lines for exploration as per your need to be added here.
//Then add the following to get the patterns

AddColumn(IIF(PatternCode == 14, 72, IIf(PatternCode == 15, 73, 32), "Pattern", formatChar);


This will give you a "H" for Hammer and "I" for inverted hammer in the Pattern column when you explore. If the two patterns are not present you get a blank in the pattern column.

-Anant
 

VJAY

Well-Known Member
#4
Dear Anantji,
Thanks for your timely help...you given help to me every time when I asked...appreciate your selfless helping mentalilty.....
 
Last edited:

VJAY

Well-Known Member
#5
Dear Anantji,
Need your help on thin afl....I want deferent clours for ema lines...please help me...
Thanks.....
_SECTION_BEGIN("Price");
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 )) ));
Plot( C, "Close", ParamColor("Color", colorBlack ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() );
if( ParamToggle("Tooltip shows", "All Values|Only Prices" ) )
{
ToolTip=StrFormat("Open: %g\nHigh: %g\nLow: %g\nClose: %g (%.1f%%)\nVolume: "+NumToStr( V, 1 ), O, H, L, C, SelectedValue( ROC( C, 1 )));
}

Plot(a=EMA(H,5),"H5",1,1);
Plot(b=EMA(L,5),"L5",1,1);

Buytrigger = C>a AND Ref(C,-1) > Ref(a, -1);
selltrigger = C<b AND Ref(C,-1) < Ref(b, -1);

shape=Buytrigger*shapeUpArrow + selltrigger*shapeDownArrow;
PlotShapes(shape,IIf(Buytrigger,colorBlack,colorBl ack));
 

asnavale

Well-Known Member
#6
Dear Anantji,
Need your help on thin afl....I want deferent clours for ema lines...please help me...
Thanks.....
_SECTION_BEGIN("Price");
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 )) ));
Plot( C, "Close", ParamColor("Color", colorBlack ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() );
if( ParamToggle("Tooltip shows", "All Values|Only Prices" ) )
{
ToolTip=StrFormat("Open: %g\nHigh: %g\nLow: %g\nClose: %g (%.1f%%)\nVolume: "+NumToStr( V, 1 ), O, H, L, C, SelectedValue( ROC( C, 1 )));
}

Plot(a=EMA(H,5),"H5",1,1);
Plot(b=EMA(L,5),"L5",1,1);

Buytrigger = C>a AND Ref(C,-1) > Ref(a, -1);
selltrigger = C<b AND Ref(C,-1) < Ref(b, -1);

shape=Buytrigger*shapeUpArrow + selltrigger*shapeDownArrow;
PlotShapes(shape,IIf(Buytrigger,colorBlack,colorBl ack));

Hi Vijay,

The following lines need change to get different colors for EMA:

Plot(a=EMA(H,5),"H5",1,1);
Plot(b=EMA(L,5),"L5",1,1);


Suppose you want Green color for a=EMA(H,5) and Red color or b=EMA(L,5) then change as follows:


Plot(a=EMA(H,5),"H5",colorGreen,1);
Plot(b=EMA(L,5),"L5",colorRed,1);


-Anant
 

VJAY

Well-Known Member
#7
Hi Vijay,

The following lines need change to get different colors for EMA:

Plot(a=EMA(H,5),"H5",1,1);
Plot(b=EMA(L,5),"L5",1,1);


Suppose you want Green color for a=EMA(H,5) and Red color or b=EMA(L,5) then change as follows:


Plot(a=EMA(H,5),"H5",colorGreen,1);
Plot(b=EMA(L,5),"L5",colorRed,1);


-Anant
Thanks anantji....very quick response....you are helped me a lot in afl's...realy am thankfull to you....
 

kaly422000

Well-Known Member
#8
Hi Vijay,

The AFL given in the link you have quoted is a function. Copy the whole code into AFL editor. To the code add the following lines to get the hammer and inverted hammer patterns:

PatternCode = IIF(CandlePattern(14), 14, IIF(CandlePattern(15), 15, 0));
Filter = PatternCode > 0;
//Other required code lines for exploration as per your need to be added here.
//Then add the following to get the patterns

AddColumn(IIF(PatternCode == 14, 72, IIf(PatternCode == 15, 73, 32), "Pattern", formatChar);


This will give you a "H" for Hammer and "I" for inverted hammer in the Pattern column when you explore. If the two patterns are not present you get a blank in the pattern column.

-Anant
if i want hammer with wick atleast 2 times of body only
 

VJAY

Well-Known Member
#9
Dear Anantji,
Is it possible to modify buy trigger as bar cross emaH with +1 point and sell trigger emaL with -1 point..means I want to filter of +/- 1point on ema's...

_SECTION_BEGIN("Price");
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 )) ));
Plot( C, "Close", ParamColor("Color", colorBlack ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() );
if( ParamToggle("Tooltip shows", "All Values|Only Prices" ) )
{
ToolTip=StrFormat("Open: %g\nHigh: %g\nLow: %g\nClose: %g (%.1f%%)\nVolume: "+NumToStr( V, 1 ), O, H, L, C, SelectedValue( ROC( C, 1 )));
}

Plot(a=EMA(H,5),"H5",1,1);
Plot(b=EMA(L,5),"L5",1,1);

Buytrigger = C>a AND Ref(C,-1) > Ref(a, -1);
selltrigger = C<b AND Ref(C,-1) < Ref(b, -1);

shape=Buytrigger*shapeUpArrow + selltrigger*shapeDownArrow;
PlotShapes(shape,IIf(Buytrigger,colorBlack,colorBl ack));
 

asnavale

Well-Known Member
#10
Dear Anantji,
Is it possible to modify buy trigger as bar cross emaH with +1 point and sell trigger emaL with -1 point..means I want to filter of +/- 1point on ema's...

_SECTION_BEGIN("Price");
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 )) ));
Plot( C, "Close", ParamColor("Color", colorBlack ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() );
if( ParamToggle("Tooltip shows", "All Values|Only Prices" ) )
{
ToolTip=StrFormat("Open: %g\nHigh: %g\nLow: %g\nClose: %g (%.1f%%)\nVolume: "+NumToStr( V, 1 ), O, H, L, C, SelectedValue( ROC( C, 1 )));
}

Plot(a=EMA(H,5),"H5",1,1);
Plot(b=EMA(L,5),"L5",1,1);

Buytrigger = C>a AND Ref(C,-1) > Ref(a, -1);
selltrigger = C<b AND Ref(C,-1) < Ref(b, -1);

shape=Buytrigger*shapeUpArrow + selltrigger*shapeDownArrow;
PlotShapes(shape,IIf(Buytrigger,colorBlack,colorBl ack));
What is 1 point equal to?

-Anant
 

Similar threads