Module 'bot'
![](/static/img/que-resp-il.png)
Module 'bot'
Used to work with trading and trailing bots.
Functions:
create_trade_order(ex: EX_ID, pair: string, is_buy: boolean, price: number, quantity: number, order_type: TRADE_ORDER_TYPE) return: order_id: number(may throw an error)
Create an order in the trade bot tool.
- ex - constant. Use the start form of the script to get this variable.
- pair - full name of the pair (market). Use the start form of the script to get this variable.
- is_buy - "true" if buying, "false" if selling.
- price - order price.
- quantity - order quantity.
- order_type - constant. Look at the TRADE_ORDER_TYPE
Returns the order id (order_id) and throws an error if the order with the specified parameters cannot be placed at this exchange.
close_trade_order(order_id: number) (may throw an error)
Close an existing order in the trade bot symbol.
- order_id - order ID.
create_trailing_order(ex: EX_ID, pair: string, is_buy: boolean, origin_price: number, step_percent: number, dump_percent: number, stop_loss: number, quantity: number) return: order_id: number (may throw an error)
Create an order in the trailing bot symbol.
- ex - constant. Use the start form of the script to get this variable.
- pair - full name of the pair (market). Use the start form of the script to get this variable.
- is_buy - "true" if buying, "false" if selling.
- origin_price - initial trailing price.
- step_percent - the percentage of growth in the next trailing step.
- dump_percent - the percentage of the order execution threshold.
- stop_loss - if trailing fails and the price reaches the current value, the bot will execute the order. Ignored if it is zero.
- quantity - the quantity of the trailing order.
Returns order id (order_id). It will throw an error if an order with the specified parameters cannot be placed at this exchange.
close_trailing_order(order_id: number) (may throw an error)
Close an existing order in the trailing bot symbol.
- order_id - order ID.
2019 All rights reserved