public static void Main(string[] args) { MarketMaker mm = new MarketMaker("config.json"); Console.WriteLine("\nPress [ENTER] for exit\n\n"); Console.ReadLine(); }
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); } }
// 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); } }
public OkcFuturesHoldingCross getFuturesPositionsCross() { try { string url = (this.restURL) + "future_position.do"; string postData = string.Format("api_key={0}&symbol=btc_usd", apiKey); string signString = postData + "&secret_key=" + apiSecret; string signature = CalculateMD5Hash(signString); postData += "&sign=" + signature; string result = MarketMaker.HttpPost(url, postData); //var obj = JsonConvert.DeserializeObject<OkcTickerMsg>(result); return(null); } catch (Exception ex) { return(null); } }
public OkcFuturesUserInfoFix getFuturesUserInfoFix() { try { string url = (this.restURL) + "future_userinfo_4fix.do"; string postData = string.Format("api_key={0}", apiKey); string signString = postData + "&secret_key=" + apiSecret; string signature = CalculateMD5Hash(signString); postData += "&sign=" + signature; string result = MarketMaker.HttpPost(url, postData); var obj = JsonConvert.DeserializeObject <OkcFuturesUserInfoFix>(result); return(obj); } catch (Exception ex) { return(null); } }