Exemple #1
0
        public static void Main(string[] args)
        {
            MarketMaker mm = new MarketMaker("config.json");

            Console.WriteLine("\nPress [ENTER] for exit\n\n");
            Console.ReadLine();
        }
Exemple #2
0
        public static void Main(string[] args)
        {
            MarketMaker mm = new MarketMaker("config.json");

            Console.WriteLine("\nPress [ENTER] for exit\n\n");
            Console.ReadLine();
        }
Exemple #3
0
        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);
            }
        }
Exemple #4
0
        // 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);
            }
        }
Exemple #5
0
        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);
            }
        }
Exemple #6
0
        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);
            }
        }