public decimal?GetSecOpenVal(string code) { Security security = RegisterSecurity(code); if (security != null) { decimal?value = security.OpenPrice; while (value == null) { Thread.Sleep(100); value = security.OpenPrice; } Trader.UnRegisterSecurity(security); //Trader.UnRegisterTrades(security); return(value); } return(null); }