Ejemplo n.º 1
0
        public void ItBitSellTest()
        {
            ItBit itBit = new ItBit();

            //Buy at a really low price to the order doesn't actually get executed.
            //This operation will error out if there is any problem
            string orderId = itBit.Sell(0.0538m, 999.99m);

            itBit.DeleteOrder(orderId);
        }
Ejemplo n.º 2
0
        public void ItBitBuySellQueryDeleteTest()
        {
            ItBit  itBit = new ItBit();
            string buyOrderId;
            string sellorderId;

            //First, insert a buy and sell order. If there are any errors with either of these operations,
            //an exception will be thrown.

            //Buy at a really low price to the order doesn't actually get executed.
            buyOrderId = itBit.Buy(1.00m, 0.01m);

            //Sell at a really high price so the order doesn't actually get executed.
            sellorderId = itBit.Sell(itBit.MinimumBitcoinOrderAmount, 9999m);

            //Both orders should still be open
            Assert.IsFalse(itBit.IsOrderFulfilled(buyOrderId));
            Assert.IsFalse(itBit.IsOrderFulfilled(sellorderId));

            //Now delete both orders. If there are any errors with either of these operations,
            //an exception will be thrown.
            itBit.DeleteOrder(buyOrderId);
            itBit.DeleteOrder(sellorderId);
        }