public DbMessage GetDbTrades(BitmexUser user, string instrument, int count) { var args = new Dictionary <string, string>(); args.Add("account", user.Id); args.Add("count", count.ToString()); args.Add("instrument", instrument); var json = _api.GetQuery("/v1/trade", null, RestApiClient.UrlEncode(args)); return(JsonConvert.DeserializeObject <DbMessage>(json)); }
public BitstampCandle GetBitstampCandle(DateTime dt, string instrument, int periodSecs) { var args = new Dictionary <string, string>(); args.Add("time", dt.ToString()); args.Add("instrument", instrument); args.Add("periodSecs", periodSecs.ToString()); args.Add("exchange", ExchangeName.Bitstamp.ToString()); var json = _api.GetQuery("/v1/charts/candle", null, RestApiClient.UrlEncode(args)); return(JsonConvert.DeserializeObject <BitstampCandle>(json)); }
public BitmexInstrumentSettings[] GetBitmexInstruments(string accountId) { var args = new Dictionary <string, string>(); args.Add("account", accountId); var json = _api.GetQuery("/v1/exch/instruments/bitmex", null, RestApiClient.UrlEncode(args)); return(JsonConvert.DeserializeObject <BitmexInstrumentSettings[]>(json)); }
public DbPositionState GetPositionState(BitmexUser user, string instrument) { var args = new Dictionary <string, string>(); args.Add("account", user.Id); args.Add("host_name", Dns.GetHostName()); args.Add("instrument", instrument); var json = _api.GetQuery("/v1/position/state", null, RestApiClient.UrlEncode(args)); return(JsonConvert.DeserializeObject <DbPositionState>(json)); }
public DbIndicatorVwapLite[] GetVwapGains(DateTime date, string exchange) { var args = new Dictionary <string, string>(); args.Add("date", date.ToShortDateString()); args.Add("exchange", exchange); var json = _api.GetQuery("/v1/indicator/vwaps", null, RestApiClient.UrlEncode(args)); var vwaps = JsonConvert.DeserializeObject <DbIndicatorVwapLite[]>(json); for (int i = 0; i < vwaps.Length; i++) { var ts = vwaps[i].Timestamp; vwaps[i].Timestamp = new DateTime(ts.Year, ts.Month, ts.Day, ts.Hour, ts.Minute, ts.Second, DateTimeKind.Utc); } return(vwaps); }
public DbPriceLevel[] GetPriceLevels(bool onlyActive = true) { var json = _api.GetQuery("/v1/pricelevels", null, "only_active=" + onlyActive); return(JsonConvert.DeserializeObject <DbPriceLevel[]>(json)); }
public static ExchangeSettingsData Get(RestApiClient2 api, string exName) { var json = api.GetQuery("/v1/exch/settings/" + exName); return(JsonConvert.DeserializeObject <ExchangeSettingsData>(json)); }