我是正版软件用户,帮帮忙,谢谢!
空头开平仓条件:5周期均线和20周期均线同时向下且k线收盘价收在5周期均线之下,开空,K线收盘价收在5周期均线之上且5周期均线拐头向上,平仓;
多头开平仓条件:5周期均线和20周期均线同时向上且k线收盘价收在5周期均线之上,开多,K线收盘价收在5周期均线之下且5周期均线拐头向下,平仓;
ma5:ma(c,5);
ma20:ma(c,20);
if ma5<ref(ma5,1) and ma20<ref(ma20,1) and c<ma5 then buyshort(holding=0,1,marketr);
if c>ma5 and ma5>ref(ma5,1) and ref(ma5<ref(ma5,1),1) and holding<0 then sellshort(1,0,marketr);
if ma5>ref(ma5,1) and ma20>ref(ma20,1) and c>ma5 then buy(HOLDING=0,1,marketr);
if c<ma5 and ma5<ref(ma5,1) and ref(ma5>ref(ma5,1),1) and holding>0 then sell(1,0,marketr);