예제 #1
0
 def test_cancel_by_id(self):
     try:
         mk = Market('USD', 'BTC', 'XBTUSD', 1, 0, 0)
         order = self.e.bid(mk, rate=100, quantity=1)
         # print(vars(order))
         cancelled = self.e.cancel(order_id=order.order_id)
         self.assertTrue(isinstance(cancelled, list))
         self.assertTrue(isinstance(cancelled[0], Order))
         # print(cancelled)
     finally:
         self.e.cancel(all=True)
예제 #2
0
 def test_cancel_by_id(self):
     try:
         mk = Market('ETC', 'BTC', 'ETCBTC', .001, 0, 0)
         order = self.e.bid(mk, rate=.0001, quantity=.001)
         # print(order)
         cancelled = self.e.cancel(order_id=order.order_id)
         self.assertTrue(isinstance(cancelled, list))
         self.assertTrue(isinstance(cancelled[0], Order))
         # print(cancelled)
     finally:
         self.e.cancel(all=True)
예제 #3
0
 def test_candles(self):
     mk = Market('ETC', 'BTC', 'ETCBTC', .001, 0, 0)
     candles = self.e.candles(mk)
     # print(candles)
     self.assertTrue(isinstance(candles, list))
     self.assertTrue(isinstance(candles[0], Candle))
예제 #4
0
 def test_ticker(self):
     mk = Market('ETC', 'BTC', 'ETCBTC', .001, 0, 0)
     ticker = self.e.ticker(mk)
     self.assertTrue(isinstance(ticker, Ticker))
예제 #5
0
 def test_balance(self):
     mk = Market('ETC', 'BTC', 'ETCBTC', .001, 0, 0)
     orderbook = self.e.order_book(mk)
     # print(vars(orderbook.asks[0]))
     self.assertTrue(isinstance(orderbook, OrderBook))
예제 #6
0
 def test_orders(self):
     mk = Market('ETC', 'BTC', 'ETCBTC', .001, 0, 0)
     self.e.bid(mk, rate=.0001, quantity=.001)
     orders = self.e.orders(mk)
     self.assertTrue(isinstance(orders, list))
     self.assertTrue(isinstance(orders[0], Order))
예제 #7
0
 def test_cancel_all(self):
     mk = Market('ETC', 'BTC', 'ETCBTC', .001, 0, 0)
     self.e.bid(mk, rate=.0001, quantity=.001)
     cancelled = self.e.cancel(all=True)
     self.assertTrue(isinstance(cancelled[0], Order))
예제 #8
0
 def test_cancel_by_market(self):
     mk = Market('ETC', 'BTC', 'ETCBTC', .001, 0, 0)
     self.e.bid(mk, rate=.0001, quantity=.001)
     cancelled = self.e.cancel(market=mk)
     self.assertTrue(isinstance(cancelled, list))
     self.assertTrue(isinstance(cancelled[0], Order))
예제 #9
0
 def test_ask(self):
     mk = Market('ETC', 'BTC', 'ETCBTC', .001, 0, 0)
     order = self.e.ask(mk, rate=100, quantity=.001)
     # print(vars(order))
     self.assertTrue(isinstance(order, Order))
     self.e._orders_cancel('ETCBTC')
예제 #10
0
 def test_orders(self):
     mk = Market('USD', 'BTC', 'XBTUSD', 1, 0, 0)
     self.e.bid(mk, rate=100, quantity=1)
     orders = self.e.orders()
     self.assertTrue(isinstance(orders, list))
     self.assertTrue(isinstance(orders[0], Order))
예제 #11
0
 def test_cancel_all(self):
     mk = Market('USD', 'BTC', 'XBTUSD', 1, 0, 0)
     self.e.bid(mk, rate=100, quantity=1)
     cancelled = self.e.cancel(all=True)
     self.assertTrue(isinstance(cancelled[0], Order))
예제 #12
0
 def test_cancel_by_market(self):
     mk = Market('USD', 'BTC', 'XBTUSD', 1, 0, 0)
     self.e.bid(mk, rate=100, quantity=1)
     cancelled = self.e.cancel(market=mk)
     self.assertTrue(isinstance(cancelled, list))
     self.assertTrue(isinstance(cancelled[0], Order))
예제 #13
0
 def test_ask(self):
     mk = Market('USD', 'BTC', 'XBTUSD', 1, 0, 0)
     order = self.e.ask(mk, rate=1000000, quantity=1)
     # print(vars(order))
     self.assertTrue(isinstance(order, Order))
     self.e._cancel_all()
예제 #14
0
 def test_position(self):
     mk = Market('USD', 'BTC', 'XBTUSD', 1, 0, 0)
     position = self.e.position(mk)
     # print(position)
     self.assertTrue(isinstance(position, int))
예제 #15
0
 def test_ticker(self):
     mk = Market('USD', 'BTC', 'XBTUSD', 1, 0, 0)
     ticker = self.e.ticker(mk)
     self.assertTrue(isinstance(ticker, Ticker))