dochian for Amibroker (AFL)
Copy & Paste Friendly
// Plots a 20 period Donchian channel
pds=5;
DonchianUpper =HHV(Ref(H,-1),pds);
DonchianLower = LLV(Ref(L,-1),pds);
DonchianMiddle = (DonchianUpper+DonchianLower)/2;
Plot(DonchianUpper,"DU",colorWhite,styleLine);
Plot(DonchianMiddle,"DM",colorGreen,styleLine);
Plot(DonchianLower,"DL",colorWhite,styleLine);