Exemple #1
0
        public override void InitDayData(Define.TTdxDllShareData data)
        {
            Define.TTDX_DAYInfo dayInfo = new Define.TTDX_DAYInfo();

            for (int pos = 0, readData = 0; readData < data.count; pos += Marshal.SizeOf(dayInfo), ++readData)
            {
                dayInfo = (Define.TTDX_DAYInfo)Utility.BytesToStuct(data.buf, dayInfo.GetType(), pos);
                StockNode node = new StockNode();
                node.time   = dayInfo.DAY.ToString();
                node.open   = dayInfo.Open;
                node.close  = dayInfo.Close;
                node.low    = dayInfo.Low;
                node.high   = dayInfo.High;
                node.volumn = dayInfo.Volume;

                WriteToDayLine(node);
            }
            dayInit = true;
        }
        public override void InitDayData(Define.TTdxDllShareData data)
        {
            Define.TTDX_DAYInfo dayInfo = new Define.TTDX_DAYInfo();

            for (int pos = 0, readData = 0; readData < data.count; pos += Marshal.SizeOf(dayInfo), ++readData)
            {
                dayInfo = (Define.TTDX_DAYInfo)Utility.BytesToStuct(data.buf, dayInfo.GetType(), pos);
                StockNode node = new StockNode();
                node.time = dayInfo.DAY.ToString();
                node.open = dayInfo.Open;
                node.close = dayInfo.Close;
                node.low = dayInfo.Low;
                node.high = dayInfo.High;
                node.volumn = dayInfo.Volume;

                dayLine.Add(node);
            }
            dayInit = true;
        }