以文本方式查看主题

-  金字塔客服中心 - 专业程序化交易软件提供商  (http://weistock.com/bbs/index.asp)
--  公式模型编写问题提交  (http://weistock.com/bbs/list.asp?boardid=4)
----  后台问题  (http://weistock.com/bbs/dispbbs.asp?boardid=4&id=154517)

--  作者:系统使用者
--  发布时间:2017/6/1 12:27:43
--  后台问题
//固定轮询 后台持仓同步系统
cc:=holding;
if tholding>0 and kkcond then sell(1,ss,market);
if tholding<0 and kdcond then sellshort(1,ss,market);
if tholding=0 and buycond then buy(1,ss,market);
if tholding=0 and sellcond then buyshort(1,ss,market);
tm:=20;//撤单时间
wt:=tremainqty(0);
buyhold:=tbuyholdingex(1);
sellhold:=tsellholdingex(1);
if wt>0.5 and tsubmit(0)>tm then tcancelex(1,0);
if wt<0.5 then begin
 kc1:=max(cc,0)-buyhold;
 kc2:=abs(min(cc,0))-sellhold;
 if kc1<-0.5 then tsell(1,abs(kc1),mkt),allowrepeat;
 if kc2<-0.5 then tsellshort(1,abs(kc2),mkt),allowrepeat;
 if sellhold<0.5 and kc1>0.5 then tbuy(1,kc1,mkt),allowrepeat;
 if buyhold<0.5  and kc2>0.5 then tbuyshort(1,kc2,mkt),allowrepeat;
end

阿火同步功能。
[此贴子已经被作者于2017/6/1 12:28:33编辑过]

--  作者:系统使用者
--  发布时间:2017/6/1 12:31:02
--  
wt:=tremainqty(0,ac,stklabel);
buyhold:=tbuyholdingex(ac,stklabel,1);
sellhold:=tsellholdingex(ac,stklabel,1);
改为任意账户,品种。通不过

--  作者:系统使用者
--  发布时间:2017/6/1 12:32:25
--  
//固定1秒轮询
cc:=holding;
if holding>0 and c<ref(c,1) then sell(1,1,market);
if holding<0 and c>ref(c,1) then sellshort(1,1,market);
if holding=0 and c>ref(c,1) then buy(1,1,market);
if holding=0 and c<ref(c,1) then buyshort(1,1,market);
if not(islastbar) or workmode<>1 then exit;
tm:=30;//撤单时间
ac:=\'800988\';//下单账户
wt:=tremainqty(0,ac,stklabel);
buyhold:=tbuyholdingex(ac,stklabel,1);
sellhold:=tsellholdingex(ac,stklabel,1);
if wt>0.5 and tsubmit(0)>tm then tcancelex(1,0,ac,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,abs(kc1),mkt,0,0,ac),allowrepeat;
 if kc2<-0.5 then tsellshort(1,abs(kc2),mkt,0,0,ac),allowrepeat;
 if sellhold<0.5 and kc1>0.5 then tbuy(1,kc1,mkt,0,0,ac),allowrepeat;
 if buyhold<0.5  and kc2>0.5 then tbuyshort(1,kc2,mkt,0,0,ac),allowrepeat;
end

--  作者:wenarm
--  发布时间:2017/6/1 12:39:28
--  

请问具体是什么问题?编译正常的,(通不过值得的是什么)。


--  作者:系统使用者
--  发布时间:2017/6/1 12:45:16
--  
想不需要填写账户,这样麻烦。ac:=\'800988\';//下单账户
--  作者:wenarm
--  发布时间:2017/6/1 12:47:45
--  
你的意思是想不用ac:=\'800988\';但是也要相同效果?
--  作者:系统使用者
--  发布时间:2017/6/1 12:55:37
--  
对,就是这样。


--  作者:系统使用者
--  发布时间:2017/6/1 14:26:54
--  
??/
--  作者:pyd
--  发布时间:2017/6/1 14:34:48
--  
只有一个账号可以为空,表示所有账号,
[此贴子已经被作者于2017/6/1 14:35:23编辑过]

--  作者:系统使用者
--  发布时间:2017/6/1 14:45:24
--  
如何改?