コード例 #1
0
 private void LevelsQuotesClick(double price, string buySell)
 {
     if (_MainWindow.dcFutHangqing.IsSelected)
     {
         foreach (var item in _MainWindow.RealDataCollection)
         {
             if (item.Code == this.lblCode.Content.ToString())
             {
                 if (LevelRealDataMouseLeftButtonDown != null)
                 {
                     RealData realRecord = new RealData();
                     if (realRecord.UpdateRealProperties(item as DisplayRealData))
                     {
                         LevelRealDataMouseLeftButtonDown(buySell, realRecord, price, false);
                         break;
                     }
                 }
             }
         }
     }
     else if (_MainWindow.dcOptHangqing.IsSelected)
     {
         foreach (OptionRealData item in _MainWindow.OptionRealDataCollection)
         {
             if (item.Code_C == this.lblCode.Content.ToString())
             {
                 if (LevelRealDataMouseLeftButtonDown != null)
                 {
                     RealData realRecord = item.GetOptRealData_C();
                     if (realRecord != null)
                     {
                         LevelRealDataMouseLeftButtonDown(buySell, realRecord, price, false);
                         break;
                     }
                 }
             }
             else if (item.Code_P == this.lblCode.Content.ToString())
             {
                 if (LevelRealDataMouseLeftButtonDown != null)
                 {
                     RealData realRecord = item.GetOptRealData_P();
                     if (realRecord != null)
                     {
                         LevelRealDataMouseLeftButtonDown(buySell, realRecord, price, false);
                         break;
                     }
                 }
             }
         }
     }
 }
コード例 #2
0
        private void GridHangQingData(DisplayRealData record)
        {
            string  buySell   = "";
            Boolean isBuySell = false;

            if (DgCell.Column == colBuyPrice || DgCell.Column == colBuyCount || DgCell.Column == colGroupBuyPrice || DgCell.Column == colGroupBuyCount)
            {
                buySell   = "卖";
                isBuySell = true;
            }
            else if (DgCell.Column == colSellPrice || DgCell.Column == colSellCount || DgCell.Column == colGroupSellPrice || DgCell.Column == colGroupSellCount)
            {
                buySell   = "买";
                isBuySell = true;
            }

            //点击最新价
            double sNewPrice = 0;

            if (DgCell.Column == colINewPrice || DgCell.Column == colGroupNewPrice)
            {
                sNewPrice = record.INewPrice;
            }

            //点击涨停价和跌停价时使用指定价下单
            double fixPrice = 0;

            if (DgCell.Column == colMaxPrice || DgCell.Column == colGroupMaxPrice)
            {
                buySell  = "买";
                fixPrice = record.UpStopPrice;
            }
            else if (DgCell.Column == colMinPrice || DgCell.Column == colGroupMinPrice)
            {
                buySell  = "卖";
                fixPrice = record.DownStopPrice;
            }
            //今开盘和昨结算
            double sJkpPrice = 0;
            double sZjsPrice = 0;

            if (DgCell.Column == colJkpPrice || DgCell.Column == colGroupJkpPrice)
            {
                sJkpPrice = record.Open;
            }
            else if (DgCell.Column == colZjsPrice || DgCell.Column == colGroupZjsPrice)
            {
                sZjsPrice = record.PrevSettleMent;
            }
            //点击最高价和最低价显示指定价
            double sHighPrice = 0;
            double sLowPrice  = 0;

            if (DgCell.Column == colHightPrice || DgCell.Column == colGroupHightPrice)
            {
                sHighPrice = record.IMaxPrice;
            }
            else if (DgCell.Column == colLowPrice || DgCell.Column == colGroupLowPrice)
            {
                sLowPrice = record.IMinPrice;
            }
            //点击昨收盘和今收盘
            double sZspPrice = 0;
            double sJspPrice = 0;

            if (DgCell.Column == colZspPrice || DgCell.Column == colGroupZspPrice)
            {
                sZspPrice = record.PrevSettleMent;
            }
            else if (DgCell.Column == colJspPrice || DgCell.Column == colGroupJspPrice)
            {
                sJspPrice = record.IClose;
            }
            //点击结算价
            double sJsjPrice  = 0;
            double sDrjjPrice = 0;

            if (DgCell.Column == colJsjPrice || DgCell.Column == colGroupJsjPrice)
            {
                sJsjPrice = record.ISettlementPrice;
            }
            else if (DgCell.Column == colDrjjPrice || DgCell.Column == colGroupDrjjPrice)
            {
                sDrjjPrice = record.AvgPrice;
            }

            RealData realRecord = new RealData();

            if (RealDataMouseLeftButtonDown != null && realRecord.UpdateRealProperties(record))
            {
                RealDataMouseLeftButtonDown(buySell, realRecord, fixPrice, sNewPrice, sJkpPrice, sZjsPrice, sHighPrice, sLowPrice, sZspPrice, sJspPrice, sJsjPrice, sDrjjPrice, isBuySell);
            }
        }