MAC:=STKINDI(\'\',\'MAB\',0,5,-1);
MAE:=STKINDI(\'\',\'MAD\',0,5,-1);
MAD:=STKINDI(\'\',\'MAB\',0,5,-2);
MAF:=STKINDI(\'\',\'MAD\',0,5,-2);
if DATATYPE<>2 then exit;
if holding=0 and MAD<MAF and MAC>MAE then
begin
MyLongPriceA:=open;
buy(1,1,LIMITR,MyLongPriceA);
end;
if holding>0 and MAD>MAF and MAC<MAE then
begin
MyLongExitPriceA:=open;
sell(1,1,LIMITR,MyLongExitPriceA);
end;