Search in sources :

Example 1 with BinanceTradeService

use of org.knowm.xchange.binance.service.BinanceTradeService in project XChange by knowm.

the class BinanceTradeDemo method raw.

public static void raw(BinanceExchange exchange) throws IOException {
    CurrencyPair pair = CurrencyPair.EOS_ETH;
    BinanceTradeService tradeService = (BinanceTradeService) exchange.getTradeService();
    // Get open orders
    OpenOrders orders = tradeService.getOpenOrders(pair);
    LimitOrder order = orders.getOpenOrders().stream().collect(StreamUtils.singletonCollector());
    if (order != null) {
        System.out.println(order);
    }
}
Also used : BinanceTradeService(org.knowm.xchange.binance.service.BinanceTradeService) OpenOrders(org.knowm.xchange.dto.trade.OpenOrders) LimitOrder(org.knowm.xchange.dto.trade.LimitOrder) CancelOrderByCurrencyPair(org.knowm.xchange.service.trade.params.CancelOrderByCurrencyPair) DefaultOpenOrdersParamCurrencyPair(org.knowm.xchange.service.trade.params.orders.DefaultOpenOrdersParamCurrencyPair) CurrencyPair(org.knowm.xchange.currency.CurrencyPair)

Example 2 with BinanceTradeService

use of org.knowm.xchange.binance.service.BinanceTradeService in project XChange by knowm.

the class BinanceExchange method initServices.

@Override
protected void initServices() {
    this.binance = ExchangeRestProxyBuilder.forInterface(BinanceAuthenticated.class, getExchangeSpecification()).build();
    this.timestampFactory = new BinanceTimestampFactory(binance, getExchangeSpecification().getResilience(), getResilienceRegistries());
    this.marketDataService = new BinanceMarketDataService(this, binance, getResilienceRegistries());
    this.tradeService = new BinanceTradeService(this, binance, getResilienceRegistries());
    this.accountService = new BinanceAccountService(this, binance, getResilienceRegistries());
}
Also used : BinanceTradeService(org.knowm.xchange.binance.service.BinanceTradeService) BinanceMarketDataService(org.knowm.xchange.binance.service.BinanceMarketDataService) BinanceAccountService(org.knowm.xchange.binance.service.BinanceAccountService)

Example 3 with BinanceTradeService

use of org.knowm.xchange.binance.service.BinanceTradeService in project XChange by knowm.

the class BinanceUsExchange method initServices.

@Override
protected void initServices() {
    this.binance = ExchangeRestProxyBuilder.forInterface(BinanceAuthenticated.class, getExchangeSpecification()).build();
    this.timestampFactory = new BinanceTimestampFactory(binance, getExchangeSpecification().getResilience(), getResilienceRegistries());
    this.marketDataService = new BinanceMarketDataService(this, binance, getResilienceRegistries());
    this.tradeService = new BinanceTradeService(this, binance, getResilienceRegistries());
    this.accountService = new BinanceUsAccountService(this, binance, getResilienceRegistries());
}
Also used : BinanceTradeService(org.knowm.xchange.binance.service.BinanceTradeService) BinanceUsAccountService(org.knowm.xchange.binance.service.BinanceUsAccountService) BinanceMarketDataService(org.knowm.xchange.binance.service.BinanceMarketDataService)

Aggregations

BinanceTradeService (org.knowm.xchange.binance.service.BinanceTradeService)3 BinanceMarketDataService (org.knowm.xchange.binance.service.BinanceMarketDataService)2 BinanceAccountService (org.knowm.xchange.binance.service.BinanceAccountService)1 BinanceUsAccountService (org.knowm.xchange.binance.service.BinanceUsAccountService)1 CurrencyPair (org.knowm.xchange.currency.CurrencyPair)1 LimitOrder (org.knowm.xchange.dto.trade.LimitOrder)1 OpenOrders (org.knowm.xchange.dto.trade.OpenOrders)1 CancelOrderByCurrencyPair (org.knowm.xchange.service.trade.params.CancelOrderByCurrencyPair)1 DefaultOpenOrdersParamCurrencyPair (org.knowm.xchange.service.trade.params.orders.DefaultOpenOrdersParamCurrencyPair)1