public void UpdateProperties(RealData realData) { if (realData.CodeInfo.Code == this.Code) { this.ChiCangLiang = realData.Position; this.StBuyCount = realData.BidHand[0]; this.StBuyPrice = realData.BidPrice[0]; this.StSellCount = realData.AskHand[0]; this.StSellPrice = realData.AskPrice[0]; this.DownStopPrice = realData.LowerLimitPrice; this.I64Sum = (UInt64)realData.Sum; //this.ICurrentSum = realData.ICurrentSum ; this.ISettlementPrice = realData.SettlmentPrice; this.PrevSettleMent = realData.PrevSettlementPrice; this.UpStopPrice = realData.UpperLimitPrice; this.CurrentHand = realData.Hand; //this.I64Outside = realData.I64Outside; this.IClose = realData.ClosePrice; //this.IDealNumber = realData.IDealNumber; this.IMaxPrice = realData.MaxPrice; this.IMinPrice = realData.MinPrice; this.INewPrice = realData.NewPrice; this.Open = realData.OpenPrice; //this.NTime = realData.NTime; this.PrevClose = realData.PrevClose; //this.UsUpdateNumber = realData.UsUpdateNumber; this.Volumn = realData.Volumn; this.Market = CodeSetManager.CtpToExName(realData.CodeInfo.ExchCode); this.PreChicang = realData.PrevPosition; this.PrevClose = realData.PrevClose; this.UpdateTime = realData.UpdateTime; } }
public DisplayRealData UpdateDisplayProperties(RealData realData) { DisplayRealData displayData = new DisplayRealData(); try { displayData.Code = realData.CodeInfo.Code; if (realData.CodeInfo.ProductType != null && realData.CodeInfo.ProductType == "Combination" || displayData.Code.Contains("&")) { if (realData.CodeInfo.Code.Contains(" ")) { string[] tempType = realData.CodeInfo.Code.Split(' '); string[] tempGroup = tempType[1].Split('&'); displayData.Code1 = tempGroup[0]; displayData.Code2 = tempGroup[1]; } else { string[] tempGroup = realData.CodeInfo.Code.Split('&'); displayData.Code1 = tempGroup[0]; displayData.Code2 = tempGroup[1]; } } displayData.Name = realData.CodeInfo.Name; displayData.ChiCangLiang = realData.Position; displayData.StBuyCount = realData.BidHand[0]; displayData.StBuyPrice = realData.BidPrice[0]; displayData.StSellCount = realData.AskHand[0]; displayData.StSellPrice = realData.AskPrice[0]; displayData.DownStopPrice = realData.LowerLimitPrice; displayData.I64Sum = (UInt64)realData.Sum; //this.ICurrentSum = realData.ICurrentSum ; displayData.ISettlementPrice = realData.SettlmentPrice; displayData.PrevSettleMent = realData.PrevSettlementPrice; displayData.UpStopPrice = realData.UpperLimitPrice; displayData.CurrentHand = realData.Hand; //this.I64Outside = realData.I64Outside; displayData.IClose = realData.ClosePrice; //this.IDealNumber = realData.IDealNumber; displayData.IMaxPrice = realData.MaxPrice; displayData.IMinPrice = realData.MinPrice; displayData.INewPrice = realData.NewPrice; displayData.Open = realData.OpenPrice; //this.NTime = realData.NTime; displayData.PrevClose = realData.PrevClose; //this.UsUpdateNumber = realData.UsUpdateNumber; displayData.Volumn = realData.Volumn; displayData.Market = CodeSetManager.CtpToExName(realData.CodeInfo.ExchCode); displayData.PreChicang = realData.PrevPosition; displayData.PrevClose = realData.PrevClose; displayData.UpdateTime = realData.UpdateTime; } catch (Exception ex) { Util.Log_Error("exception: " + ex.Message); Util.Log_Error("exception: " + ex.StackTrace); } return(displayData); }