コード例 #1
0
        /**
         * getPairExample
         * All trading pairs supported by exchanges
         */
        public static void GetPairExample()
        {
            /***Initialize the calling object*/
            IdaxApiRestClient idaxApiRestClient = IdaxConfig.init();

            /**Call remote interface**/
            PairEntry pairEntry = idaxApiRestClient.getPairEntry();
        }
コード例 #2
0
        /**
         * getTradeExample
         * Get Recently Trades
         */
        public static void GetTradeExample()
        {
            /***Initialize the calling object*/
            IdaxApiRestClient idaxApiRestClient = IdaxConfig.init();

            /**Request parameter encapsulation**/
            string symbol = IdaxApiConstants.ETH_BTC;

            /**Call remote interface**/
            TradeEntry tradeEntry = idaxApiRestClient.getTradeEntry(symbol);
        }
コード例 #3
0
        /**
         * getUserInfoExample
         * Get account info
         */
        public static void getUserInfoExample()
        {
            /***Initialize the calling object*/
            IdaxApiRestClient idaxApiRestClient = IdaxConfig.init();

            /**Request parameter encapsulation**/
            UserInfoRequest userInfoRequest = new UserInfoRequest();

            userInfoRequest.timestamp = DateTime.UtcNow.UnixTimeStamp();
            userInfoRequest.key       = IdaxConfig.API_KEY;

            /**Call remote interface**/
            UserInfoEntry userInfoEntry = idaxApiRestClient.getUserInfo(userInfoRequest);
        }
コード例 #4
0
        /**
         * cancelOrderExample
         * Cancel orders
         */
        public static void cancelOrderExample()
        {
            /***init IdaxApiRestClient*/
            IdaxApiRestClient idaxApiRestClient = IdaxConfig.init();

            /**Request parameter encapsulation**/
            CancelOrderRequest cancelOrderRequest = new CancelOrderRequest();

            cancelOrderRequest.key       = IdaxConfig.API_KEY;
            cancelOrderRequest.timestamp = DateTime.UtcNow.UnixTimeStamp();
            cancelOrderRequest.orderId   = "3259662510000000069";

            /**Call remote interface**/
            CancelOrderEntry cancelOrderEntry = idaxApiRestClient.cancelOrder(cancelOrderRequest);
        }
コード例 #5
0
        /**
         * getKlineExample
         * Get kline data
         */
        public static void GetKlineExample()
        {
            /***Initialize the calling object*/
            IdaxApiRestClient idaxApiRestClient = IdaxConfig.init();

            /**Request parameter encapsulation**/
            string       symbol       = IdaxApiConstants.ETH_BTC;
            KlineRequest kLineRequest = new KlineRequest();

            kLineRequest.pair   = symbol;
            kLineRequest.period = PeriodEnum.ONE_WEEK.GetDisplayAttribute();
            kLineRequest.size   = 10;
            kLineRequest.since  = DateTime.UtcNow.UnixTimeStamp();

            /**Call remote interface**/
            KlineEntry klineEntry = idaxApiRestClient.getKlineEntry(kLineRequest);
        }
コード例 #6
0
        /**
         * getOrderHistoryExample
         * Get historical order information and return information only for the last two days
         */
        public static void getOrderHistoryExample()
        {
            /***Initialize the calling object*/
            IdaxApiRestClient idaxApiRestClient = IdaxConfig.init();

            /**Request parameter encapsulation**/
            string symbol = IdaxApiConstants.ETH_BTC;
            OrderHistoryRequest orderHistoryRequest = new OrderHistoryRequest();

            orderHistoryRequest.currentPage = 1;
            orderHistoryRequest.key         = IdaxConfig.API_KEY;
            orderHistoryRequest.orderState  = -1;
            orderHistoryRequest.pair        = symbol;
            orderHistoryRequest.timestamp   = DateTime.UtcNow.UnixTimeStamp();
            orderHistoryRequest.pageLength  = 10;

            /**Call remote interface**/
            OrderHistoryEntry orderHistoryEntry = idaxApiRestClient.getOrderHistory(orderHistoryRequest);
        }
コード例 #7
0
        public static void GetOrderInfoExample()
        {
            /***Initialize the calling object*/
            IdaxApiRestClient idaxApiRestClient = IdaxConfig.init();

            /**Request parameter encapsulation**/
            string           symbol           = IdaxApiConstants.ETH_BTC;
            OrderInfoRequest orderInfoRequest = new OrderInfoRequest();

            orderInfoRequest.key       = IdaxConfig.API_KEY;
            orderInfoRequest.pair      = symbol;
            orderInfoRequest.pageIndex = 1;
            orderInfoRequest.pageSize  = 20;
            orderInfoRequest.timestamp = DateTime.UtcNow.UnixTimeStamp();
            orderInfoRequest.orderId   = 9799L;

            /**Call remote interface**/
            OrderInfoEntry orderInfoEntry = idaxApiRestClient.getOrderInfo(orderInfoRequest);
        }
コード例 #8
0
        /**
         * placeOrderExample
         * Create new order
         */
        public static void placeOrderExample()
        {
            /***Initialize the calling object**/
            IdaxApiRestClient idaxApiRestClient = IdaxConfig.init();

            /**Request parameter encapsulation**/
            string            symbol            = IdaxApiConstants.ETH_BTC;
            PlaceOrderRequest placeOrderRequest = new PlaceOrderRequest();

            placeOrderRequest.pair      = "APL_BTC";
            placeOrderRequest.timestamp = DateTime.UtcNow.UnixTimeStamp();
            placeOrderRequest.amount    = "11211111";
            placeOrderRequest.price     = "0.00000007";
            placeOrderRequest.orderType = OrderTypeEnum.Limit.GetDisplayAttribute();
            placeOrderRequest.orderSide = OrderSideEnum.Buy.GetDisplayAttribute();
            placeOrderRequest.key       = IdaxConfig.API_KEY;

            /**Call remote interface**/
            PlaceOrderEntry placeOrderEntry = idaxApiRestClient.placeOrder(placeOrderRequest);
        }
コード例 #9
0
        /**
         * getMyTradesExample
         * Get my historical trading information
         */
        public static void getMyTradesExample()
        {
            /***Initialize the calling object*/
            IdaxApiRestClient idaxApiRestClient = IdaxConfig.init();

            /**Request parameter encapsulation**/
            string symbol = IdaxApiConstants.ETH_BTC;

            MyTradesRequest myTradesRequest = new MyTradesRequest();

            myTradesRequest.key         = IdaxConfig.API_KEY;
            myTradesRequest.pair        = symbol;
            myTradesRequest.orderSide   = OrderSideEnum.Sell.GetDisplayAttribute();
            myTradesRequest.currentPage = 0;
            myTradesRequest.pageLength  = 20;
            myTradesRequest.startDate   = DateTime.UtcNow.AddDays(-2).UnixTimeStamp();
            myTradesRequest.endDate     = DateTime.UtcNow.UnixTimeStamp();
            myTradesRequest.timestamp   = DateTime.UtcNow.UnixTimeStamp();

            /**Call remote interface**/
            MyTradesResultEntry myTradesEntry = idaxApiRestClient.getMyTrades(myTradesRequest);
        }