| 10396 | } |
| 10397 | |
| 10398 | public java.util.concurrent.CompletableFuture<Object> createStopLossOrder(Object symbol, Object type, Object side, Object amount, Object... optionalArgs) |
| 10399 | { |
| 10400 | |
| 10401 | return java.util.concurrent.CompletableFuture.supplyAsync(() -> { |
| 10402 | |
| 10403 | /** |
| 10404 | * @method |
| 10405 | * @name createStopLossOrder |
| 10406 | * @description create a trigger stop loss order (type 2) |
| 10407 | * @param {string} symbol unified symbol of the market to create an order in |
| 10408 | * @param {string} type 'market' or 'limit' |
| 10409 | * @param {string} side 'buy' or 'sell' |
| 10410 | * @param {float} amount how much you want to trade in units of the base currency or the number of contracts |
| 10411 | * @param {float} [price] the price to fulfill the order, in units of the quote currency, ignored in market orders |
| 10412 | * @param {float} stopLossPrice the price to trigger the stop loss order, in units of the quote currency |
| 10413 | * @param {object} [params] extra parameters specific to the exchange API endpoint |
| 10414 | * @returns {object} an [order structure]{@link https://docs.ccxt.com/?id=order-structure} |
| 10415 | */ |
| 10416 | Object price = Helpers.getArg(optionalArgs, 0, null); |
| 10417 | Object stopLossPrice = Helpers.getArg(optionalArgs, 1, null); |
| 10418 | Object parameters = Helpers.getArg(optionalArgs, 2, new java.util.HashMap<String, Object>() {{}}); |
| 10419 | if (Helpers.isTrue(Helpers.isEqual(stopLossPrice, null))) |
| 10420 | { |
| 10421 | throw new ArgumentsRequired((String)Helpers.add(this.id, " createStopLossOrder() requires a stopLossPrice argument")) ; |
| 10422 | } |
| 10423 | final Object finalStopLossPrice = stopLossPrice; |
| 10424 | parameters = this.extend(parameters, new java.util.HashMap<String, Object>() {{ |
| 10425 | put( "stopLossPrice", finalStopLossPrice ); |
| 10426 | }}); |
| 10427 | if (Helpers.isTrue(Helpers.GetValue(this.has, "createStopLossOrder"))) |
| 10428 | { |
| 10429 | return (this.createOrder(symbol, type, side, amount, price, parameters)).join(); |
| 10430 | } |
| 10431 | throw new NotSupported((String)Helpers.add(this.id, " createStopLossOrder() is not supported yet")) ; |
| 10432 | }); |
| 10433 | |
| 10434 | } |
| 10435 | |
| 10436 | public java.util.concurrent.CompletableFuture<Object> createStopLossOrderWs(Object symbol, Object type, Object side, Object amount, Object... optionalArgs) |
| 10437 | { |