| 10320 | } |
| 10321 | |
| 10322 | public java.util.concurrent.CompletableFuture<Object> createTriggerOrder(Object symbol, Object type, Object side, Object amount, Object... optionalArgs) |
| 10323 | { |
| 10324 | |
| 10325 | return java.util.concurrent.CompletableFuture.supplyAsync(() -> { |
| 10326 | |
| 10327 | /** |
| 10328 | * @method |
| 10329 | * @name createTriggerOrder |
| 10330 | * @description create a trigger stop order (type 1) |
| 10331 | * @param {string} symbol unified symbol of the market to create an order in |
| 10332 | * @param {string} type 'market' or 'limit' |
| 10333 | * @param {string} side 'buy' or 'sell' |
| 10334 | * @param {float} amount how much you want to trade in units of the base currency or the number of contracts |
| 10335 | * @param {float} [price] the price to fulfill the order, in units of the quote currency, ignored in market orders |
| 10336 | * @param {float} triggerPrice the price to trigger the stop order, in units of the quote currency |
| 10337 | * @param {object} [params] extra parameters specific to the exchange API endpoint |
| 10338 | * @returns {object} an [order structure]{@link https://docs.ccxt.com/?id=order-structure} |
| 10339 | */ |
| 10340 | Object price = Helpers.getArg(optionalArgs, 0, null); |
| 10341 | Object triggerPrice = Helpers.getArg(optionalArgs, 1, null); |
| 10342 | Object parameters = Helpers.getArg(optionalArgs, 2, new java.util.HashMap<String, Object>() {{}}); |
| 10343 | if (Helpers.isTrue(Helpers.isEqual(triggerPrice, null))) |
| 10344 | { |
| 10345 | throw new ArgumentsRequired((String)Helpers.add(this.id, " createTriggerOrder() requires a triggerPrice argument")) ; |
| 10346 | } |
| 10347 | final Object finalTriggerPrice = triggerPrice; |
| 10348 | parameters = this.extend(parameters, new java.util.HashMap<String, Object>() {{ |
| 10349 | put( "triggerPrice", finalTriggerPrice ); |
| 10350 | }}); |
| 10351 | if (Helpers.isTrue(Helpers.GetValue(this.has, "createTriggerOrder"))) |
| 10352 | { |
| 10353 | return (this.createOrder(symbol, type, side, amount, price, parameters)).join(); |
| 10354 | } |
| 10355 | throw new NotSupported((String)Helpers.add(this.id, " createTriggerOrder() is not supported yet")) ; |
| 10356 | }); |
| 10357 | |
| 10358 | } |
| 10359 | |
| 10360 | public java.util.concurrent.CompletableFuture<Object> createTriggerOrderWs(Object symbol, Object type, Object side, Object amount, Object... optionalArgs) |
| 10361 | { |