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


金字塔客服中心 - 专业程序化交易软件提供商金字塔软件公式模型编写问题提交 → [原创]再请教orderqueue和代码写法

   

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


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

主题:[原创]再请教orderqueue和代码写法

帅哥哟,离线,有人找我吗?
木鱼石传说
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:论坛游侠 帖子:416 积分:139 威望:0 精华:0 注册:2013/2/5 20:33:58
[原创]再请教orderqueue和代码写法  发帖心情 Post By:2013/8/20 22:35:35    Post IP:110.83.183.10[只看该作者]

浏览了多个朋友问的关于orderqueue的用法,有了一点新认识。请教老师,下面四种的开平仓写法,他们执行起来的效果一样吗?有什么区别?请老师指点

第一种写法:平仓、开仓整合在触发条件下,用了orderqueu

//开多
   if longcond then begin
    sellshort(holding < 0 , ss,market),orderqueue;
    buy(holding = 0, ss,market),orderqueue;
    end

//开空
  if shortcond then begin
    sell(holding > 0, ss,market),orderqueue;
    buyshort(holding = 0, ss,market),orderqueue;
    end

第二种写法:平仓、开仓代码分开写,用了orderqueu

//开多
   if longcond then begin
    sellshort(holding < 0 , ss,market),orderqueue;
    end
  if long then begin
    buy(holding = 0, ss,market),orderqueue;
    end

//开空
  if shortcond then begin
    sell(holding > 0, ss,market),orderqueue;
    end
  if short then begin
    buyshort(holding = 0, ss,market),orderqueue;
    end


第三种写法:平仓、开仓整合在触发条件下,不用orderqueu

//开多
   if longcond then begin
    sellshort(holding < 0 , ss,market);
    buy(holding = 0, ss,market);
    end

//开空
  if shortcond then begin
    sell(holding > 0, ss,market);
    buyshort(holding = 0, ss,market);
    end

第四种写法:平仓、开仓代码分开写,不orderqueu

//开多
   if longcond then begin
    sellshort(holding < 0 , ss,market);
    end
  if long then begin
    buy(holding = 0, ss,market);
    end

//开空
  if shortcond then begin
    sell(holding > 0, ss,market);
    end
  if short then begin
    buyshort(holding = 0, ss,market);
    end
[此贴子已经被作者于2013/8/20 22:37:32编辑过]

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


加好友 发短信
等级:论坛游侠 帖子:416 积分:139 威望:0 精华:0 注册:2013/2/5 20:33:58
  发帖心情 Post By:2013/8/20 22:45:34    Post IP:110.83.183.10[只看该作者]

问的具体一些:

1,第一种写法“平仓、开仓整合在触发条件下,用了orderqueu”与第二种写法“平仓、开仓代码分开写,用了orderqueu"执行机理一样吗?

2,第三种写法“平仓、开仓整合在触发条件下,不用orderqueu”与第四种写法“平仓、开仓代码分开写,不orderqueu"执行机理一样吗?

3,第一种与第三种执行机理有何不同?第二种与第四种执行机理有何不同?

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


加好友 发短信
等级:罗宾汉 帖子:46311 积分:50819 威望:0 精华:2 注册:2011/3/23 8:50:25
  发帖心情 Post By:2013/8/21 8:45:02    Post IP:58.246.57.26[只看该作者]

这个不复杂,加了orderqueue的,就是队列下单模式,需要等前面的单子收到成交回报之后才执行下单动作;不加就不等收到成交回报,触发信号就下单

[此贴子已经被作者于2013/8/21 8:45:09编辑过]


金字塔—专业程序化交易量化投资平台

客户服务部

----------------------------------------------------------- 欢迎您参加我公司的技术培训,具体培训需求请发邮件到service@weistock.com

您的宝贵建议或者投诉,请发往邮箱:weiwei@weistock.com

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


加好友 发短信
等级:论坛游侠 帖子:416 积分:139 威望:0 精华:0 注册:2013/2/5 20:33:58
  发帖心情 Post By:2013/8/21 11:16:54    Post IP:110.83.183.10[只看该作者]

如上还有几个问题,也请老师一并回答

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


加好友 发短信
等级:管理员 帖子:7302 积分:32559 威望:1000 精华:45 注册:2003/12/30 16:34:32
  发帖心情 Post By:2013/8/21 13:30:32    Post IP:58.246.57.26[只看该作者]

看orderqueue函数说明,觉得看不懂,或者有迷惑的地方可以提出来,不合理不合适的地方,我们会做修改
[此贴子已经被作者于2013/8/21 13:30:48编辑过]

 回到顶部