您现在的位置:程序化交易>> 期货公式>> 金字塔等>> 金字塔知识>>正文内容

关于后台持仓同步 [金字塔]

  • 咨询内容: 请教:以下代码,是阿火的后台持仓同步模版,前5行是否并不是后台用的模版?只是一个图表的开仓程序? 然后,程序中是指定账户下单,如何改成所有账户都能下单(用于机构版多账户)
    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

     

  • 金字塔客服:  1.是的。前面部分其实是图表的代码。2.多账号可以 用多账号组的方式去下单。这样就会对所有账号组下面的账号下单。进入多账号设置里面把多个账号设成一个组管理就可以了。 你下单语句里面的参数填写账号组的名称就行了。

    此主题相关图片如下:temp.png


     

     来源:程序化久久网( WWW.CXH99.COM )

  • 用户回复: 关于2,因为后台程序里的语句是指定账户的,比如:ac:='800988';//下单账户
    wt:=tremainqty(0,ac,stklabel);这些语句怎么改成所有账户的?我试着把第二句改成 wt:=tremainqty(0,stklabel);好像是报错!

     

  • 网友回复:

     

    //ac:='800988';//下单账户
    wt:=tremainqty(0,'',stklabel);

     

     

    您蹦到的报错信息,都是语法错误,建议你自己针对错误,查看相关的函数说明

    [此贴子已经被作者于2020/9/14 10:57:48编辑过]

 

有思路,想编写各种指标公式,交易模型,选股公式,还原公式的朋友

可联系技术人员 QQ: 262069696  点击在线交流或微信号:cxh99cxh99  进行 有偿收费 编写!

怎么收费,代编流程等详情请点击阅读!

(注:由于人数限制,QQ或微信请选择方便的一个联系我们就行,加好友时请简单备注下您的需求,否则无法通过。谢谢您!)


【字体: 】【打印文章】【查看评论

相关文章

    没有相关内容