Ejemplo n.º 1
0
        private void button3_Click(object sender, EventArgs e)
        {
            MdApi md  = MdApi.Instance;
            int   ret = md.Init("*****@*****.**", "Chs771005", MDMode.MD_MODE_NULL);

            if (ret != 0)
            {
                //登录失败
                return;
            }
            List <Bar> bars         = md.GetBars("SHSE.600004", 60, "2017-03-09 00:00:00", "2017-03-10 15:00:00");
            DateTime   startTimeUTC = TimeZone.CurrentTimeZone.ToLocalTime(new DateTime(1970, 1, 1));

            foreach (Bar bar in bars)
            {
                bar.strtime = startTimeUTC.AddSeconds(bar.utc_time).ToString();
            }
            ShowData(bars.OfType <object>().ToList());
        }