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

[原创]移动止损后台交易模板 [金字塔]

  • 咨询内容: 以下内容为程序代码:

    1 input:stopnum(20,5,50,5);
    2 runmode:1;
    3
    4 if tholding=0 then begin
    5     extgbdataset('stopprice',low-stopnum*mindiff);
    6     tbuy(1,1,lmt,close);
    7 end;
    8
    9 if tholding>0 then begin
    10     if low-stopnum*mindiff>extgbdata('stopprice') then
    11         extgbdataset('stopprice',low-stopnum*mindiff);
    12     
    13     if low<=extgbdata('stopprice') then begin
    14         tsell(1,tholding,lmt,extgbdata('stopprice')),orderqueue;
    15         tbuyshort(1,1,lmt,extgbdata('stopprice')),orderqueue;
    16     end;
    17 end;
    18
    19 if tholding<0 then begin
    20     if high+stopnum*mindiff<extgbdata('stopprice') then
    21         extgbdataset('stopprice',high+stopnum*mindiff);
    22     
    23     if high>=extgbdata('stopprice') then begin
    24         tsellshort(1,tholding,lmt,extgbdata('stopprice')),orderqueue;
    25         tbuy(1,1,lmt,extgbdata('stopprice')),orderqueue;
    26     end;    
    27 end;
    28

     

  • 金字塔客服:

    通不过

     

  • 用户回复: 将代码前面序号去掉

     

  • 网友回复: 学习了

     

  • 网友回复: ...一下就奖励5个金币。。真好啊。

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

相关文章

    没有相关内容