//后台持仓同步系统
cc:=holding;
if holding>0 and kkcond then sell(1,ss,market);
if holding<0 and kdcond then sellshort(1,ss,market);
if holding=0 and buycond then buy(1,ss,market);
if holding=0 and sellcond then buyshort(1,ss,market);
tm:=20;//撤单时间
wt:=tremainqty(0,'',stklabel);
buyhold:=tbuyholdingex('',stklabel,1);
sellhold:=tsellholdingex('',stklabel,1);
if wt>0.5 and tsubmit(0)>tm then tcancelex(1,0,'',stklabel);
if wt<0.5 then begin
kc1:=max(cc,0)-buyhold;
kc2:=abs(min(cc,0))-sellhold;
if kc1<-0.5 then tsell(1,SS,mkt,0,0,'');
if kc2<-0.5 then tsellshort(1,SS,mkt,0,0,'');
if sellhold<0.5 and kc1>0.5 then tbuy(1,SS,mkt,0,0,'');
if buyhold<0.5 and kc2>0.5 then tbuyshort(1,SS,mkt,0,0,'');
end
走完K线模式。
//后台持仓同步系统
cc:=holding;
if holding>0 and kkcond then sell(1,ss,marketr);
if holding<0 and kdcond then sellshort(1,ss,marketr);
if holding=0 and buycond then buy(1,ss,marketr);
if holding=0 and sellcond then buyshort(1,ss,marketr);
走完k根据你后台运行模式选择走完k就可以了
另外类似这种别人发出的算法模板要做改动等等,有时候工作人员也会有心无力的。
PS:用户最好能详细说明下,否者光拿别人的一段代码然后说如何不对,问题太过分散了
[此贴子已经被作者于2017/6/9 8:57:59编辑过]