ma500:ma(c,500);
buycond:cross(ma500,c) and O<ma500 and o>c;//开仓条件
sellcond:c>ma500 and cross(o,ma500) and holding>0;//平仓条件
//上面是被引用的指标,指标名:ma500d
3stkbuy:STKINDI('','ma500d.buycond',0,17,0);
5stkbuy:STKINDI('','ma500d.buycond',0,2,0);
10stkbuy:STKINDI('','ma500d.buycond',0,3,0);
3stksell:STKINDI('','ma500d.sellcond',0,17,0);
5stksell:STKINDI('','ma500d.sellcond',0,2,0);
10stksell:STKINDI('','ma500d.sellcond',0,3,0);
if 3stkbuy or 5stkbuy or 10stkbuy then buyshort(holding=0,3,market);
ct:=0;//统计平仓数量
if 3stksell then ct:=ct+3;
if 5stksell then ct:=ct+4;
if 10stkbuy then ct:=ct+5;
if 3stksell or 5stksell or 10stkbuy then sellshort(holding<0,ct,MARKET);