ma5:ma(close,5);
ma15:ma(close,15);
//5日均线上穿15日均线,平空开多
long:=CROSS(ma5,ma15);
if long then
begin
sellshort(holding<0,0,limitr,c);
buy(holding=0,1,limitr,c);
end
//5日均线下破15日均线,平多开空
short:=CROSS(ma15,ma5);
if short then
begin
sell(holding>0,0,limitr,c);
buyshort(holding=0,1,limitr,c);
end