public OkcTickerMsg getFuturesTicker(OKCoinFuturesType ftype) { try { string url = (this.restURL) + "future_ticker.do"; string postData = string.Format("symbol=btc_usd&contract_type={0}", getFuturesTypeString(ftype)); string result = MarketMaker.HttpGet(url, postData); var obj = JsonConvert.DeserializeObject <OkcTickerMsg>(result); return(obj); } catch (Exception ex) { return(null); } }
private string getFuturesTypeString(OKCoinFuturesType ftype) { switch (ftype) { case OKCoinFuturesType.ThisWeek: return("this_week"); case OKCoinFuturesType.NextWeek: return("next_week"); case OKCoinFuturesType.Quarter: return("quarter"); default: return(null); } }
// REST api public OkcDepth getDepthFutures(OKCoinFuturesType ftype) { int size = 200; int merge = 1; try { string url = (this.restURL) + "future_depth.do"; string postData = string.Format("symbol=btc_usd&contract_type={0}&size={1}&merge={2}", getFuturesTypeString(ftype), size, merge); //string responseStr = DoAuthenticatedAPIPost(url, apiKey, apiSecret, postData); string result = MarketMaker.HttpGet(url, postData); var obj = JsonConvert.DeserializeObject<OkcDepth>(result); return obj; } catch (Exception ex) { return null; } }
// REST api public OkcDepth getDepthFutures(OKCoinFuturesType ftype) { int size = 200; int merge = 1; try { string url = (this.restURL) + "future_depth.do"; string postData = string.Format("symbol=btc_usd&contract_type={0}&size={1}&merge={2}", getFuturesTypeString(ftype), size, merge); //string responseStr = DoAuthenticatedAPIPost(url, apiKey, apiSecret, postData); string result = MarketMaker.HttpGet(url, postData); var obj = JsonConvert.DeserializeObject <OkcDepth>(result); return(obj); } catch (Exception ex) { return(null); } }
private string getFuturesTypeString(OKCoinFuturesType ftype) { switch (ftype) { case OKCoinFuturesType.ThisWeek: return "this_week"; case OKCoinFuturesType.NextWeek: return "next_week"; case OKCoinFuturesType.Quarter: return "quarter"; default: return null; } }
public OkcTickerMsg getFuturesTicker(OKCoinFuturesType ftype) { try { string url = (this.restURL) + "future_ticker.do"; string postData = string.Format("symbol=btc_usd&contract_type={0}", getFuturesTypeString(ftype)); string result = MarketMaker.HttpGet(url, postData); var obj = JsonConvert.DeserializeObject<OkcTickerMsg>(result); return obj; } catch (Exception ex) { return null; } }