Exemplo n.º 1
0
        /// <summary>
        /// 获取最后一根柱子的信息
        /// </summary>
        /// <param name="pcode">商品行情编码</param>
        /// <param name="dtype">周期类型</param>
        /// <returns>获取最后一根柱子的信息(逗号隔开的行情数据)</returns>
        public string GetLastPillar(string pcode, datatype dtype)
        {
            string      strtmp = String.Empty;
            TradeClient tc     = new TradeClient();

            try
            {
                switch (dtype)
                {
                case datatype.M1: strtmp = "M1";
                    break;

                case datatype.M5: strtmp = "M5";
                    break;

                case datatype.M15: strtmp = "M15";
                    break;

                case datatype.M30: strtmp = "M30";
                    break;

                case datatype.H1: strtmp = "H1";
                    break;

                case datatype.H4: strtmp = "H4";
                    break;

                case datatype.D1: strtmp = "D1";
                    break;

                case datatype.W1: strtmp = "W1";
                    break;

                case datatype.MN: strtmp = "MN";
                    break;

                default:
                    break;
                }
                strtmp = tc.GetLastPillarData(strtmp, pcode);
                tc.Close();
            }
            catch (Exception ex)
            {
                tc.Abort();
                ComFunction.WriteErr(ex);
            }
            return(strtmp);
        }
Exemplo n.º 2
0
 /// <summary>
 /// 获取最后一根柱子的信息
 /// </summary>
 /// <param name="pcode">商品行情编码</param>
 /// <param name="dtype">周期类型</param>
 /// <returns>获取最后一根柱子的信息(逗号隔开的行情数据)</returns>
 public string GetLastPillar(string pcode, datatype dtype)
 {
     string strtmp = String.Empty;
     TradeClient tc = new TradeClient();
     try
     {
         switch (dtype)
         {
             case datatype.M1: strtmp = "M1";
                 break;
             case datatype.M5: strtmp = "M5";
                 break;
             case datatype.M15: strtmp = "M15";
                 break;
             case datatype.M30: strtmp = "M30";
                 break;
             case datatype.H1: strtmp = "H1";
                 break;
             case datatype.H4: strtmp = "H4";
                 break;
             case datatype.D1: strtmp = "D1";
                 break;
             case datatype.W1: strtmp = "W1";
                 break;
             case datatype.MN: strtmp = "MN";
                 break;
             default:
                 break;
         }
         strtmp = tc.GetLastPillarData(strtmp, pcode);
         tc.Close();
     }
     catch (Exception ex)
     {
         tc.Abort();
         ComFunction.WriteErr(ex);
     }
     return strtmp;
 }