protected void OnTickersInfoRecv(JObject jObject) { JArray items = jObject.Value <JArray>("data"); if (items == null) { return; } foreach (JObject item in items) { string tickerName = item.Value <string>("symbol"); BitmexTicker t = (BitmexTicker)Tickers.FirstOrDefault(tt => tt.CurrencyPair == tickerName); if (t == null) { continue; } JEnumerable <JToken> props = item.Children(); foreach (JProperty prop in props) { string name = prop.Name; string value = prop.Value == null? null: prop.Value.ToString(); switch (name) { case "lastPrice": t.Last = FastValueConverter.Convert(value); break; case "highPrice": t.Hr24High = FastValueConverter.Convert(value); break; case "lowPrice": t.Hr24Low = FastValueConverter.Convert(value); break; case "bidPrice": t.HighestBid = FastValueConverter.Convert(value); break; case "askPrice": t.LowestAsk = FastValueConverter.Convert(value); break; case "timestamp": t.Timestamp = t.Time = Convert.ToDateTime(value); break; case "lastChangePcnt": t.Change = FastValueConverter.Convert(value); break; case "volume24h": t.Volume = FastValueConverter.Convert(value); break; } } t.UpdateTrailings(); lock (t) { RaiseTickerUpdate(t); } } }