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


金字塔客服中心 - 专业程序化交易软件提供商金字塔软件公式模型编写问题提交 → 后台交易时实盘开平的顺序不对

   

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


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

主题:后台交易时实盘开平的顺序不对

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


加好友 发短信
等级:黑侠 帖子:808 积分:667 威望:0 精华:0 注册:2011/4/9 16:17:57
后台交易时实盘开平的顺序不对  发帖心情 Post By:2017/6/7 14:54:25    Post IP:180.169.30.6[只看该作者]

//后台持仓同步系统
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线模式。
 实盘开平的顺序不对
是走完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);

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


加好友 发短信
等级:超级版主 帖子:21598 积分:0 威望:0 精华:1 注册:2010/7/31 16:35:30
  发帖心情 Post By:2017/6/7 15:40:28    Post IP:180.173.41.177[只看该作者]

请问您具体问题是??

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


加好友 发短信
等级:黑侠 帖子:808 积分:667 威望:0 精华:0 注册:2011/4/9 16:17:57
  发帖心情 Post By:2017/6/8 22:51:29    Post IP:110.184.34.143[只看该作者]

上面是轮询模式,改为K走完。

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


加好友 发短信
等级:超级版主 帖子:21598 积分:0 威望:0 精华:1 注册:2010/7/31 16:35:30
  发帖心情 Post By:2017/6/9 8:47:52    Post IP:180.169.30.6[只看该作者]

走完k根据你后台运行模式选择走完k就可以了

另外类似这种别人发出的算法模板要做改动等等,有时候工作人员也会有心无力的。

PS:用户最好能详细说明下,否者光拿别人的一段代码然后说如何不对,问题太过分散了

 

[此贴子已经被作者于2017/6/9 8:57:59编辑过]

 回到顶部