//
https://www.traderji.com/community/threads/convert-metastock-to-afl-need-help.109394/
_SECTION_BEGIN("DBOX");
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 ) ) ));
Cn= Sum((H-L)<=1.62*Ref(MA(H-L,20),-1),10)==10 OR Sum(H>L,10)<8;
BoxH=ValueWhen(Cn,HHV(H,20),1);
BoxL=ValueWhen(Cn,LLV(L,20),1);
Plot(BoxH,"",colorAqua,styleLine);
Plot(BoxL,"",colorRed,styleLine);
Plot(Close,"",IIf(O>C,colorRed,colorLime),styleCandle);
_SECTION_END();