Can you give me a code of donchain channel?

donchain channel is available in spider software … so i wann to code of donchain channel … pls help me for built my study …

///////////////////////////Neotrade Analytics////////////////////////
////////////////////////www.neotradeanalytics.com/////////////////////
///////////////////Amibroker AFL for Donchian Channel////////////////

_SECTION_BEGIN("Donchian Channel");
pds= Param("pds", 20, 1, 240, 1);
DonchianUpper =HHV(Ref(H,-1),pds);
DonchianLower = LLV(Ref(L,-1),pds);
DonchianMiddle = (DonchianUpper+DonchianLower)/2;

Plot(DonchianUpper,"DU",colorBlue,styleLine);
Plot(DonchianMiddle,"DM",colorGreen,styleLine);
Plot(DonchianLower,"DL",colorRed,styleLine);
_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", colorDefault ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() ); 
_SECTION_END();

Regards

Vivith

(Authorized Vendor of NSE supporting realtime data feeds to Amibroker, Metastock and Ninjatrader)

Check out the Amibroker AFL code with detailed backtest report in the below link: