Example #1
0
        public static DateTime ExchangeDateTime([In] this DepthMarketDataField field)
        {
            // 大商所夜盘时,ActionDay可能已经是指向的第二天
            int HH = field.UpdateTime / 10000;

            // 这个功能写入到C层中
            //if (HH > 20)
            //{
            //    if (field.ExchangeID.CompareTo("DCE") == 0)
            //    {
            //        return field.ExchangeDateTime_();
            //    }
            //}

            int mm = field.UpdateTime % 10000 / 100;
            int ss = field.UpdateTime % 100;

            int yyyy = field.ActionDay / 10000;
            int MM   = field.ActionDay % 10000 / 100;
            int dd   = field.ActionDay % 100;

            return(new DateTime(yyyy, MM, dd, HH, mm, ss, field.UpdateMillisec));
        }
Example #2
0
 static void OnRtnDepthMarketData(object sender, ref DepthMarketDataField marketData)
 {
     Console.WriteLine(marketData.InstrumentID);
     Console.WriteLine(marketData.ExchangeID);
     Console.WriteLine(marketData.LastPrice);
 }
Example #3
0
 public static string ToFormattedStringExchangeDateTime([In] this DepthMarketDataField field)
 {
     return(string.Format("[TradingDay={0};ActionDay={1};UpdateTime={2},UpdateMillisec={3}]",
                          field.TradingDay, field.ActionDay, field.UpdateTime, field.UpdateMillisec));
 }
Example #4
0
 static void OnRtnDepthMarketData(object sender, ref DepthMarketDataField marketData)
 {
     Console.WriteLine(marketData.InstrumentID);
     Console.WriteLine(marketData.ExchangeID);
     Console.WriteLine(marketData.LastPrice);
 }