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


金字塔客服中心 - 专业程序化交易软件提供商金字塔软件交易策略发布专区 → 【高频策略】利用挂单价差实现高频交易的策略

   

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


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

主题:【高频策略】利用挂单价差实现高频交易的策略

帅哥哟,离线,有人找我吗?
量化资产
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:新手上路 帖子:16 积分:0 威望:0 精华:0 注册:2018/5/6 14:33:55
  发帖心情 Post By:2018/9/26 9:10:57 [只看该作者]

用在锌上试试
diff:=5;手数:=1;多持:=tbuyholding(1);空持:=tsellholding(1);
持价:=TAVGENTERPRICE;
挂单价差:(ASKPRICE-BIDPRICE)/diff,NOAXIS;
DEBUGFILE('C:\TEST.TXT','挂单价差 %.0f', 挂单价差);DEBUGOUT('挂单价差 %.0f', 挂单价差);
//开平仓条件
开仓条件:=挂单价差>=5;平仓条件:=挂单价差<=2;
//开仓挂单
if 多持=0 and 空持=0  then begin
    tcancel(开仓条件=0 and tisremain(1)>0 ,1); //不满足条件就撤单
    tcancel(开仓条件=0 and tisremain(3)>0 ,3); 
    tbuy     (开仓条件  and tisremain(1)=0,手数,lmt,BIDPRICE+diff,0);
    tbuyshort(开仓条件  and tisremain(3)=0,手数,lmt,ASKPRICE-diff,0);
end
//平仓挂单
if 多持>0 and 空持>0  then begin
    tcancel(平仓条件=0 and tisremain(2)>0 ,2); //不满足条件就撤单
    tcancel(平仓条件=0 and tisremain(4)>0 ,4);
    tsell     (平仓条件 and tisremain(2)=0,多持,lmt,ASKPRICE,0);
    tsellshort(平仓条件 and tisremain(4)=0,空持,lmt,BIDPRICE,0);
end
//单腿处理
if 多持=0 and 空持>0  then begin
    买单挂条件 :=BIDPRICE<=持价-3*diff;卖单止损条件:=ASKPRICE>=持价+3*diff and not(买单挂条件);
    tcancel   (卖单止损条件   or  TSUBMIT(1)>60,1); //满足卖单止损条件,就撤开多单
    tcancel   (卖单止损条件=0 or  TSUBMIT(4)>60,4); //不满足卖单止损条件或者平空单60秒未成交,就撤平空单
    tbuy      (卖单止损条件=0 and tisremain(4)=0 and tisremain(1)=0,手数,lmt,BIDPRICE+diff,0);
    tsellshort(卖单止损条件   and tisremain(4)=0 and tisremain(1)=0,空持,lmt,BIDPRICE+diff,0);//满足卖单止损条件,就平空单,追单
end
if 多持>0 and 空持=0 then begin
    卖单挂条件 :=ASKPRICE>=持价+3*diff;买单止损条件:=BIDPRICE<=持价-3*diff and not(卖单挂条件);
    tcancel   (买单止损条件   or  TSUBMIT(1)>60,3);
    tcancel   (买单止损条件=0 or  TSUBMIT(1)>60,2);
    tbuyshort (买单止损条件=0 and tisremain(3)=0 and tisremain(2)=0,手数,lmt,ASKPRICE-diff,0);
    tsell     (买单止损条件   and tisremain(3)=0 and tisremain(2)=0,多持,lmt,ASKPRICE-diff,0);
end


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