欢迎使用金字塔普通技术服务论坛,您可以在相关区域发表技术支持贴。
我司技术服务人员将优先处理 VIP客服论坛 服务贴,普通区问题处理速度慢,请耐心等待。谢谢您对我们的支持与理解。


金字塔客服中心 - 专业程序化交易软件提供商金字塔软件公式模型编写问题提交 → 后台问题

   

欢迎使用金字塔普通技术服务论坛,您可以在相关区域发表技术支持贴。
我司技术服务人员将优先处理 VIP客服论坛 服务贴,普通区问题处理速度慢,请耐心等待。谢谢您对我们的支持与理解。    


  共有4197人关注过本帖树形打印复制链接

主题:后台问题

帅哥哟,离线,有人找我吗?
系统使用者
  1楼 | QQ | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:黑侠 帖子:808 积分:667 威望:0 精华:0 注册:2011/4/9 16:17:57
后台问题  发帖心情 Post By:2017/6/1 12:27:43    Post IP:110.184.34.173[显示全部帖子]

//固定轮询 后台持仓同步系统
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编辑过]

 回到顶部
帅哥哟,离线,有人找我吗?
系统使用者
  2楼 | QQ | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:黑侠 帖子:808 积分:667 威望:0 精华:0 注册:2011/4/9 16:17:57
  发帖心情 Post By:2017/6/1 12:31:02    Post IP:110.184.34.173[显示全部帖子]

wt:=tremainqty(0,ac,stklabel);
buyhold:=tbuyholdingex(ac,stklabel,1);
sellhold:=tsellholdingex(ac,stklabel,1);
改为任意账户,品种。通不过

 回到顶部
帅哥哟,离线,有人找我吗?
系统使用者
  3楼 | QQ | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:黑侠 帖子:808 积分:667 威望:0 精华:0 注册:2011/4/9 16:17:57
  发帖心情 Post By:2017/6/1 12:32:25    Post IP:110.184.34.173[显示全部帖子]

//固定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

 回到顶部
帅哥哟,离线,有人找我吗?
系统使用者
  4楼 | QQ | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:黑侠 帖子:808 积分:667 威望:0 精华:0 注册:2011/4/9 16:17:57
  发帖心情 Post By:2017/6/1 12:45:16    Post IP:110.184.34.173[显示全部帖子]

想不需要填写账户,这样麻烦。ac:='800988';//下单账户

 回到顶部
帅哥哟,离线,有人找我吗?
系统使用者
  5楼 | QQ | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:黑侠 帖子:808 积分:667 威望:0 精华:0 注册:2011/4/9 16:17:57
  发帖心情 Post By:2017/6/1 12:55:37    Post IP:110.184.34.173[显示全部帖子]

对,就是这样。


 回到顶部
帅哥哟,离线,有人找我吗?
系统使用者
  6楼 | QQ | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:黑侠 帖子:808 积分:667 威望:0 精华:0 注册:2011/4/9 16:17:57
  发帖心情 Post By:2017/6/1 14:26:54    Post IP:110.184.34.173[显示全部帖子]

??/

 回到顶部
帅哥哟,离线,有人找我吗?
系统使用者
  7楼 | QQ | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:黑侠 帖子:808 积分:667 威望:0 精华:0 注册:2011/4/9 16:17:57
  发帖心情 Post By:2017/6/1 14:45:24    Post IP:110.184.34.173[显示全部帖子]

如何改?

 回到顶部
帅哥哟,离线,有人找我吗?
系统使用者
  8楼 | QQ | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:黑侠 帖子:808 积分:667 威望:0 精华:0 注册:2011/4/9 16:17:57
后台问题  发帖心情 Post By:2017/6/5 15:17:40    Post IP:110.184.38.12[显示全部帖子]

出现问题
图片点击可在新窗口打开查看此主题相关图片如下:qq图片20170605151618.png
图片点击可在新窗口打开查看

图片点击可在新窗口打开查看此主题相关图片如下:qq图片20170605151612.png
图片点击可在新窗口打开查看
了,开多没有平多,开空就一直开空。

 回到顶部
帅哥哟,离线,有人找我吗?
系统使用者
  9楼 | QQ | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:黑侠 帖子:808 积分:667 威望:0 精华:0 注册:2011/4/9 16:17:57
  发帖心情 Post By:2017/6/5 15:18:45    Post IP:110.184.38.12[显示全部帖子]

//后台持仓同步系统
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,'',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,abs(kc1),mkt,0,0,''),allowrepeat;
 if kc2<-0.5 then tsellshort(1,abs(kc2),mkt,0,0,''),allowrepeat;
 if sellhold<0.5 and kc1>0.5 then tbuy(1,kc1,mkt,0,0,''),allowrepeat;
 if buyhold<0.5  and kc2>0.5 then tbuyshort(1,kc2,mkt,0,0,''),allowrepeat;
end

 回到顶部