Board logo

标题: 为什么不能在tick图里面止损 [开拓者 TB] [打印本页]

作者: 龙听    时间: 2019-8-3 16:15     标题: 为什么不能在tick图里面止损 [开拓者 TB]

咨询内容: 为什么不能在tick图里面止损
  1. //------------------------------------------------------------------------
  2. // 简称: DUANXIAN
  3. // 名称: DUANXIAN
  4. // 类别: 公式应用
  5. // 类型: 用户应用
  6. // 输出: Void
  7. //------------------------------------------------------------------------
  8. Params
  9.          //此处添加参数

  10. Vars
  11.          //此处添加变量
  12. Begin
  13.          //此处添加代码正文

  14.         If(!CallAuctionFilter()) Return;

  15.              if(barstatus==0)setglobalvar(0,0);
  16. if(barstatus==0)setglobalvar(1,0);
  17.          if(barstatus==2)
  18. {
  19.          //多开
  20. if(Q_OutsideVol>GetGlobalVar(0) and (Q_LastVol()>1000 and  Q_OpenIntFlag>0) and (Q_Last==GetGlobalVar(2)))
  21.         {
  22.      
  23.               A_SendOrder(Enum_Buy,Enum_Entry,1,Q_Last);


  24.        }

  25.        //空开
  26.         

  27. if(Q_InsideVol>GetGlobalVar(1) and (Q_LastVol()>1000 and  Q_OpenIntFlag>0) and  (Q_Last==GetGlobalVar(3)))
  28.    {

  29.           A_SendOrder(Enum_Sell,Enum_Entry,1,Q_Last);

  30.         }
  31.       
  32.          
  33.           //平多
  34.          if(A_BuyPosition()>0)
  35.           {
  36.                   A_SendOrder(Enum_Sell,Enum_Exit,1,A_BuyAvgPrice+2);
  37.          }        
  38. //平空
  39.          if(A_SellPosition>0 )
  40.           {
  41.          
  42.          A_SendOrder(Enum_Buy,Enum_Exit,1,A_SellAvgPrice-2);
  43.                 }
  44.       

  45.          
  46.         //止损
  47.       //空止损
  48.       
  49.           if(A_SellPosition>0 )
  50.           {  
  51.           if(Q_InsideVol>GetGlobalVar(1) and (Q_LastVol()>1000 and  Q_OpenIntFlag>0) and  (Q_Last==GetGlobalVar(3)))
  52.           {  
  53. A_DeleteOrder(A_OpenOrderContractNo(0));
  54. A_SendOrder(Enum_Buy,Enum_Exit,1,Q_Last);
  55.        }
  56.     }
  57.     //多止损
  58. if(A_BuyPosition()>0 )
  59.           {
  60.                   if(Q_InsideVol>GetGlobalVar(1) and (Q_LastVol()>1000 and  Q_OpenIntFlag>0) and  (Q_Last==GetGlobalVar(3)))
  61.          {
  62.          A_DeleteOrder(A_OpenOrderContractNo(0));
  63.                  A_SendOrder(Enum_Sell,Enum_Exit,1,Q_Last);
  64.                      
  65.          }
  66.          
  67.          }

  68. }
  69.         setglobalvar(0,Q_OutsideVol);
  70.           setglobalvar(1,Q_InsideVol);
  71.           SetGlobalVar(2,Q_AskPrice);
  72.           SetGlobalVar(3,Q_BidPrice);
  73.          
  74. End
  75. //------------------------------------------------------------------------
  76. // 编译版本:        2018/09/25 122512
  77. // 内核版本:        V2.8.2.14
  78. // 版权所有        kingofdragon1
  79. // 更改声明        TradeBlazer Software保留对TradeBlazer平台
  80. //                        每一版本的TradeBlazer公式修改和重写的权利
  81. //------------------------------------------------------------------------
复制代码





欢迎光临 龙听期货论坛 (http://www.qhlt.cn/) Powered by Discuz! 7.2