15795606 22.11.2011 19:44:26
15797742 22.11.2011 19:44:26
15799884 22.11.2011 19:44:26
15800184 22.11.2011 19:44:26
15801671 22.11.2011 19:44:26
15804911 22.11.2011 19:44:26
15804914 22.11.2011 19:44:26
15808007 22.11.2011 19:44:26
15811279 22.11.2011 19:44:26
15813304 22.11.2011 19:44:26
15814551 22.11.2011 19:44:26
15821865 22.11.2011 19:44:26
15823016 22.11.2011 19:44:26
15823983 22.11.2011 19:44:26
15824023 22.11.2011 19:44:26
15826239 22.11.2011 19:44:26
Asks.Count= 0 Bids.Count= 0
There is no BestAsk
There is no BestBid
Здесь вылетела ошибка. // Это я вписал руками
Asks.Count= 15 Bids.Count= 20
BestAsk.Price= 31629
BestBid.Price= 31584
Код
Код
private void SetStartExpertPrice()
{
if(Security.LastTrade != null && Security.LastTrade.Time.AddMinutes(_validTimeForLastTrade) >= DateTime.Now){
_expertPrice = new ExpertPrice(Security.LastTrade);
}
else{
MarketDepth myGlass = MainWindow.Instance.Trader.GetMarketDepth(Security);
string info = "";
info += "Asks.Count= " + myGlass.Asks.Count() + " Bids.Count= " + myGlass.Bids.Count() + "\n";
if(Security.BestAsk != null){
info += "BestAsk.Price= " + Security.BestAsk.Price + "\n";
}
else{
info += "There is no BestAsk" + "\n";
}
if(Security.BestBid != null){
info += "BestBid.Price= " + Security.BestBid.Price + "\n";
}
else{
info += "There is no BestBid" + "\n";
}
System.Diagnostics.Debug.WriteLine(info);
_expertPrice = new ExpertPrice((Security.BestAsk.Price + Security.BestBid.Price) / 2, DateTime.Now);
}
this.lblPrice.Content = _expertPrice.Price; //Строка 131, на ней вылетела ошибка.
}