TR1 : MAX(MAX((HIGH-LOW),ABS(REF(CLOSE,1)-HIGH)),ABS(REF(CLOSE,1)-LOW));
ATR : MA(TR1,14);
a:=10;
if close>a*atr then
begin
sellshort(1,holding,marketr);
buy(1,1,marketr);
end
if close>a*atr then
begin
sell(1,holding,marketr);
buyshort(1,1,marketr);
end