0

我无法弄清楚如何使用 XChange Java 库为我的 Poloniex Exchange 限价单设置卖出/买入价格。

贝娄是初始化和我的投标方法,但没有设置价格。

ExchangeSpecification exSpec = new ExchangeSpecification(PoloniexExchange.class);
exSpec.setApiKey(POLONIEX_API_KEY_PROP_NAME);
exSpec.setSecretKey(POLONIEX_API_SECRET_PROP_NAME);
Exchange poloniex = ExchangeFactory.INSTANCE.createExchange(exSpec);

//-- TRADE SERVICE.
TradeService tradeService = poloniex.getTradeService();

MarketDataService marketDataService = poloniex.getMarketDataService();
Ticker ticker = marketDataService.getTicker(CURRENCY_PAIR);

~

private static String placeBuyLimitOrder(TradeService tradeService) throws Exception {

    LimitOrder order = new LimitOrder(OrderType.BID, MAIN_IN_TRADE.divide(oldBid, 8, RoundingMode.HALF_UP).setScale(8), CURRENCY_PAIR, null, null, oldBid.subtract(Utils.SATOSHI));
    order.setOrderFlags(null);

    String orderId = tradeService.placeLimitOrder(order);

    return orderId;
}

这种方式将我的出价设置为拍卖中的最高出价,但我想将我设置得更高。有谁知道自己设定出价/要价的热度?

谢谢。

4

1 回答 1

0

改变:

LimitOrder order = new LimitOrder(OrderType.BID, MAIN_IN_TRADE.divide(oldBid, 8, RoundingMode.HALF_UP).setScale(8), CURRENCY_PAIR, null, null, oldBid.subtract(Utils.SATOSHI));

至 :

LimitOrder order = new LimitOrder(OrderType.BID, MAIN_IN_TRADE.divide(oldBid + 0.005, 8, RoundingMode.HALF_UP).setScale(8), CURRENCY_PAIR, null, null, oldBid.subtract(Utils.SATOSHI));

如果你想要0.005更高

于 2018-03-22T14:51:36.067 回答