策略用在那个周期上?
建一个公式起名:rr
//公式内容ma5均线,被另一个公式调用用
ma5:ma(c,5);
再建一个公式,内容是:
ma10:ma(c,10);
ma5:stkindi(STKLABEL,'rr.ma5',0,6,0);//日线ma5当前值
m5:stkindi(STKLABEL,'rr.ma5',0,6,-1);//日线ma5昨天值
kd:ma5>m5 and ref(c,1)>ma10;
pd: ref(c,1)<ma10;
kk:ma5<m5 and ref(c,1)<ma10;
pk:ref(c,1)>ma10;
sellshort(holding<0 and pk,holding,market);
buy(kd and holding=0,1,market);
sell(holding>0 and pd,holding,market);
buyshort(holding=0 and kk,1,market);