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


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

   

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


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

主题:后台问题

帅哥哟,离线,有人找我吗?
系统使用者
  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

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


加好友 发短信
等级:管理员 帖子:26632 积分:0 威望:0 精华:7 注册:2015/4/9 14:59:07
  发帖心情 Post By:2017/6/1 12:39:28    Post IP:180.169.30.6[只看该作者]

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



编程无捷径,技巧靠积累。
 回到顶部
帅哥哟,离线,有人找我吗?
系统使用者
  5楼 | 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';//下单账户

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


加好友 发短信
等级:管理员 帖子:26632 积分:0 威望:0 精华:7 注册:2015/4/9 14:59:07
  发帖心情 Post By:2017/6/1 12:47:45    Post IP:180.169.30.6[只看该作者]

你的意思是想不用ac:='800988';但是也要相同效果?


编程无捷径,技巧靠积累。
 回到顶部
帅哥哟,离线,有人找我吗?
系统使用者
  7楼 | 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[只看该作者]

对,就是这样。


 回到顶部
帅哥哟,离线,有人找我吗?
系统使用者
  8楼 | 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[只看该作者]

??/

 回到顶部
美女呀,离线,留言给我吧!
pyd
  9楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:8439 积分:0 威望:0 精华:0 注册:2014/7/14 13:43:36
  发帖心情 Post By:2017/6/1 14:34:48    Post IP:180.169.30.6[只看该作者]

只有一个账号可以为空,表示所有账号,
[此贴子已经被作者于2017/6/1 14:35:23编辑过]

 回到顶部
帅哥哟,离线,有人找我吗?
系统使用者
  10楼 | 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[只看该作者]

如何改?

 回到顶部
总数 14 1 2 下一页