[PEL] 复制代码
pd:=macd<ref(macd,1) and diff<ref(diff,1);
pk:=macd>ref(macd,1) and diff>ref(diff,1);
多持仓均价:TAVGENTERPRICEEX2('','',0);
空持仓均价:TAVGENTERPRICEEX2('','',1);
多可用持仓:TBUYHOLDINGEX('','',1);
空可用持仓:TSELLHOLDINGEX('','',1);
if kd1 and kd2 and 多可用持仓=0 and kc and duo=1 then tbuy(1,ss,mkt);
if kk1 and kk2 and 空可用持仓=0 and kc and kong=1 then tbuyshort(1,ss,mkt);
if c-多持仓均价>ying*mindiff and tenterbars>0 and 多可用持仓>0 and duo=1 then 多赢:tsell(1,0,lmt,DYNAINFO( 28));
if 空持仓均价-c>ying*mindiff and tenterbars>0 and 空可用持仓>0 and kong=1 then 空赢:tsellshort(1,0,lmt,DYNAINFO( 34));
if 多持仓均价-c>kui*mindiff and 多可用持仓>0 and duo=1 then 多损:tsell(1,0,lmt,DYNAINFO( 28));
if c-空持仓均价>kui*mindiff and 空可用持仓>0 and kong=1 then 空损:tsellshort(1,0,lmt,DYNAINFO( 34));