Esempio n. 1
0
        public override void UpdateOrderBook(int?maxSize = null)
        {
            HitBtcRequest request = new HitBtcRequest(OrderBookPath);
            Dictionary <string, dynamic> response = ApiPost(request);

            BuildOrderBook(response, 1, 0, maxSize);
        }
Esempio n. 2
0
        public override void UpdateAvailableBalances()
        {
            HitBtcRequest request2 = new HitBtcRequest(AccountBalanceInfoPath, _apiInfo, Method.GET);
            Dictionary <string, dynamic> response = ApiPost(request2);
            ArrayList balances = (ArrayList)GetValueFromResponseResult(response, "balance");

            BTCBalance  = GetCurrencyAmountFromBalancesArrayList(balances, BTC_SYMBOL);
            FiatBalance = GetCurrencyAmountFromBalancesArrayList(balances, EUR_SYMBOL);
        }
Esempio n. 3
0
        /// <summary>
        /// With HitBtc, buying and selling is the same Api call. So both SellInternal and BuyInternal point to this.
        /// </summary>
        /// <param name="amount">Amount of btc to be bought/sold.</param>
        /// <param name="price">Price to set for the order.</param>
        /// <param name="orderType">Can be either be "buy" or "sell".</param>
        /// <returns>String representation of the executed order.</returns>
        private string ExecuteOrder(decimal amount, decimal price, OrderType orderType)
        {
            amount = 100m;

            HitBtcRequest orderRequest = new HitBtcRequest(_addOrderPath, _apiInfo, Method.POST);
            //orderRequest.AddParameter("clientOrderId", DateTime.Now.Ticks);
            //orderRequest.AddParameter("symbol", BTC_EUR_SYMBOL);
            //orderRequest.AddParameter("side", orderType.ToString().ToLower());     //Important note: HitBtc api requires that the order type be lower case (else there will be an error), thus the ToLower().
            //orderRequest.AddParameter("price", price);
            //orderRequest.AddParameter("quantity", amount);
            //orderRequest.AddParameter("type", "limit");

            //TODO: PICK UP HERE!!!!!

            Dictionary <string, dynamic> response = ApiPost(orderRequest);

            return(null);
        }