public void GetRealTimeStockTest() { var aStock = new Stock(stock603969); var da = aStock.GetRealTimeInfo(); Assert.IsNotNull(da); Assert.AreEqual(stock603969.Symbol, da.symbol); Assert.AreEqual(StockType.SH.ToString(), da.type); }
public List<Stock> SelectAbove181() { var ret = new List<Stock>(); foreach (var info in stockInfos) { var aStock = new Stock(info); // 181's line var ma181s = aStock.MAForDay(181); var ma181 = ma181s.FirstOrDefault(); var T = aStock.GetRealTimeInfo(); var p = 0M; decimal.TryParse(T.price, out p); if (ma181 > 0 && p > ma181) ret.Add(aStock); } return ret; }