-- 作者:证通的曹琴
-- 发布时间:2013/6/14 12:20:24
-- 为什么我用模拟账号来后台交易,开平仓都能同时发出执行, 用实盘的账号登陆后就不能同时开平仓了?
为什么我用模拟账号来后台交易,开平仓都能同时发出执行, 用实盘的账号登陆后就不能同时开平仓了?
我是用了后台模板来执行的
Globalvariable:hold=drawnull; cc800988:=holding;//这句放在信号
。。。。。。
<< 我的策略>>
。。。。。。。
drawtextex(1,1,800,0,\'虚拟持仓为:\'+numtostr(cc800988,0));//在图表上输入虚拟持仓以便监控 if not(islastbar) or workmode<>1 then exit; xiadan800988:=cc800988-hold; t1:=floor(time/100); if islastbar and time <151400 and xiadan800988>0.5 and t1<>extgbdata(\'time\') then then begin cang:=min(xiadan800988,abs(hold)); if hold<0 and tholding<0 then begin tsellshort(1,cang,mkt,0,0),ALLOWREPEAT; //end
//cang:=xiadan800988+min(hold,0); //if cang>0 and tholding=0 then begin tbuy(1,cang,mkt,0,0),ALLOWREPEAT; end extgbdataset(\'time\',t1); end
if ISLASTBAR and time<151400 and xiadan800988<-0.5 and t1<>extgbdata(\'time\') then begin cang:=min(abs(xiadan800988),abs(hold)); if hold>0 and tholding>0 then begin tsell(1,cang,mkt,0,0),ALLOWREPEAT; //end
// cang:=abs(xiadan800988)-max(hold,0); //if cang>0 and tholding=0 then begin tbuyshort(1,cang,mkt,0,0),ALLOWREPEAT; end extgbdataset(\'time\',t1); end
hold:=cc800988; if time>151400 and tholding<>0 then begin tsellshort(1,0,mkt,0,0); tsell(1,0,mkt,0,0); end
|