Skip to main content

Donchian Channel's for Amibroker (AFL)

jeanmuller over 13 years ago Amibroker (AFL)

  • Rating:
    3 / 5 (Votes 2)
  • Tags:
    amibroker

This formula Plot Donchian Channel.

Modify the number’s 42 and 14 for more results.

Indicator / Formula

Copy & Paste Friendly
DonchianX = Ref(HHV(H,42),-1);
DonchianY = Ref(LLV(L,14),-1);
Plot(DonchianX,"DU",colorBlue,styleLine);
Plot(DonchianY,"DL",colorBlue,styleLine);

1 comments

1. navin
over 13 years ago

modified afl

_SECTION_BEGIN("downtainchannel");
SetPositionSize( 2000, spsShares );
DonchianX = Ref(HHV(H,42),-1);
DonchianY = Ref(LLV(L,14),-1);
Plot(DonchianX,"DU",colorGreen,styleLine);
Plot(DonchianY,"DL",colorRed,styleLine);

Buy=Cover=Cross (C, DonchianX );
Sell=Short= Cross (DonchianY ,C);
Buy=ExRem(Buy,Sell);
Sell=ExRem(Sell,Buy);

// plot arrows

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



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", colorBlack ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() );








_SECTION_END();

_SECTION_BEGIN("Price");
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", colorBlack ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() );





 
_SECTION_END();



navin....

Leave Comment

Please login here to leave a comment.