Example #1
0
        public GroupService.Queryinfo SendOrderHK(int Category, int PriceType, string Gddm, string Zqdm, float Price, int Quantity, StringBuilder result, StringBuilder errInfo)
        {
            GroupClient.GroupService.Queryinfo response = new GroupService.Queryinfo();
            try
            {
                TdxApi.QueryHKData(ClientID, 2, result, errInfo);
                var 单前ErrInfo = errInfo.ToString();
                if (单前ErrInfo != string.Empty)
                {
                    response.Result = result.ToString();
                    response.Error  = errInfo.ToString();
                }
                else
                {
                    response.Other = result.ToString();
                    TdxApi.SendHKOrder(ClientID, Category, 2, 0, Gddm, Zqdm, Price.ToString(), Quantity.ToString(), result, errInfo);
                }
            }
            catch (Exception ex)
            {
                response.Error += "下单异常:" + ex.Message;
            }

            return(response);
        }
Example #2
0
 public void CancelHKOrder(string hth, StringBuilder resultCancel, StringBuilder errCancelInfo)
 {
     if (this.ClientID > -1)
     {
         try
         {
             StringBuilder result  = new StringBuilder(1024 * 1024);
             StringBuilder errInfo = new StringBuilder(256);
             TdxApi.QueryHKData(ClientID, 0, result, errInfo);
             result.Clear();
             errInfo.Clear();
             TdxApi.CancelHKOrder(ClientID, hth, result, errInfo);
         }
         catch (Exception ex)
         {
             CommonUtils.Log("CancelHKOrder Exception", ex);
         }
     }
 }