Open greekphilip opened 6 years ago
+1
bump
NewOrder order = new NewOrder( pair, OrderSide.SELL, OrderType.STOP_LOSS_LIMIT, TimeInForce.GTC, QTY, sellprice);
client.newOrder( order.stopPrice( stopprice ) );
NewOrder order = new NewOrder( pair, OrderSide.SELL, OrderType.STOP_LOSS_LIMIT, TimeInForce.GTC, QTY, sellprice);
client.newOrder( order.stopPrice( stopprice ) );
Thanks for this reply, quite some time passed, but it still helped me 😅
It seems like this is still not documented, so not so easy to find out
I have gone into the "NewOrder" class and added a constructor which takes the parameter "stopPrice".
public NewOrder(String symbol, OrderSide side, OrderType type, TimeInForce timeInForce, String quantity, String Price, String stopPrice){ this(symbol, side, type, timeInForce, quantity); this.price=price; this.stopPrice=stopPrice; }
I have also added two methods for creating stopLimitBuy and stopLimitSell orders.
public static NewOrder stopLimitSell(String symbol, TimeInForce timeInForce, String quantity, String price, String stopPrice){ return new NewOrder(symbol, OrderSide.SELL, OrderType.STOP_LOSS_LIMIT, timeInForce, quantity, price, stopPrice); }
public static NewOrder stopLimitBuy(String symbol, TimeInForce timeInForce, String quantity, String price, String stopPrice){ return new NewOrder(symbol, OrderSide.BUY, OrderType.STOP_LOSS_LIMIT, timeInForce, quantity, price, stopPrice); }
However when I try to create a new stop-limit order:
client.newOrder(stopLimitBuy("BTCUSDT", TimeInForce.GTC, "0.035375", "5000","4999"));
the following error occurs:
What is going on? I can't find how to create a stop-limit order for java binance API anywhere.
Please help me, Thank you...