Channel at closing prices of two consecutive candles system.

yasu222

Active Member
#1
HI!!!... Need help in writing Amibroker AFL for the below Logic..

**I need two parallel lines at Closing prices of two consecutive colour (bull and bear) or( bear and bull ) candles.

(If the above pattern in chart, then draw parallel line at closing prices of 2 candles.)

** Then generate buy/sell signals if the coming candles close above/below lines.

** Any similar above pattern occur in future, then previous channel will be disappear and fresh channel will be formed at as per 2 nd point..

Please help.....

Thanks In advance
 

johnnypareek

Well-Known Member
#2
HI!!!... Need help in writing Amibroker AFL for the below Logic..

**I need two parallel lines at Closing prices of two consecutive colour (bull and bear) or( bear and bull ) candles.

(If the above pattern in chart, then draw parallel line at closing prices of 2 candles.)

** Then generate buy/sell signals if the coming candles close above/below lines.

** Any similar above pattern occur in future, then previous channel will be disappear and fresh channel will be formed at as per 2 nd point..

Please help.....

Thanks In advance
Now How I will come to know which candle is bull or bear??
 

johnnypareek

Well-Known Member
#5
Hmm

Guess his bull is c>o and bear is c<o. But image confusing, The second candle of image.is it to be inside day for sure or its not necessary ???
 

johnnypareek

Well-Known Member
#8
HTML:
GraphXSpace=5;
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() ); 
_SECTION_END();

bull=Ref(C,-1)>Ref(O,-1) AND C<O;
bear=Ref(C,-1)<Ref(O,-1) AND C>O;

bh=ValueWhen(bull,HHV(H,2),1);
bl=ValueWhen(bear,HHV(L,2),1);

Plot(bl,"Low",5,1);

Plot(bh,"High",5,1);
 

yasu222

Active Member
#10
HTML:
GraphXSpace=5;
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() ); 
_SECTION_END();

bull=Ref(C,-1)>Ref(O,-1) AND C<O;
bear=Ref(C,-1)<Ref(O,-1) AND C>O;

bh=ValueWhen(bull,HHV(H,2),1);
bl=ValueWhen(bear,HHV(L,2),1);

Plot(bl,"Low",5,1);

Plot(bh,"High",5,1);
It is not as per my request sir..