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


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

   

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


  共有2904人关注过本帖平板打印复制链接

主题:[原创]提前下单再请教

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


加好友 发短信
等级:论坛游侠 帖子:416 积分:139 威望:0 精华:0 注册:2013/2/5 20:33:58
[原创]提前下单再请教  发帖心情 Post By:2013/7/29 16:20:10    Post IP:120.39.165.135[只看该作者]

    一个策略里面有两套系统,其中一套要求条件(long1/short1)一触发就下单,而另外一套要求条件(long2/short2)触发后在K线走完前提前N秒下单,图表交易时用“固定时间间隔1秒”轮询模式,下面代码是否正确?请老师指点:
tqxiadan:=(time0-timetot0(dynainfo(207))<=N) or not(islastbar);//提前下单秒数
    
//开多
   if long1 then begin
    sellshort(holding < 0 , ss,limitr,close),ignorecheckprice,orderqueue;
    buy(holding = 0, ss,limitr,close),ignorecheckprice,orderqueue;
    end

//开空
  if short1 then begin
    sell(holding > 0, ss,limitr,close),ignorecheckprice,orderqueue;
    buyshort(holding = 0, ss,limitr,close),ignorecheckprice,orderqueue;
    end

if tqxiadan then begin  

//开多
   if long2 then begin
    sellshort(holding < 0 , ss,limitr,close),ignorecheckprice,orderqueue;
    buy(holding = 0, ss,limitr,close),ignorecheckprice,orderqueue;
    end

//开空
  if short2 then begin
    sell(holding > 0, ss,limitr,close),ignorecheckprice,orderqueue;
    buyshort(holding = 0, ss,limitr,close),ignorecheckprice,orderqueue;
    end
end

 回到顶部