Models
![](/static/img/que-resp-il.png)
Models
Order
{
id: string,
ex_id: EX_ID,
pair_source: string,
is_buy: boolean,
status: ORDER_STATUS,
quantity: number,
price: number,
executed_quantity: number,
total: number,
timestamp_nano: number
}
The model of the exchange order.
-
id - the order's exchange identifier.
- ex_id - id of the exchange. Look at the EX_ID constant.
- pair_source - the short exchange name of the pair.
- is_buy - "true" if this is a "buy" order, otherwise "false".
- status - order status. Look at the ORDER_STATUS constant.
- quantity - the quantity of coins in the order.
- price - order price.
- executed_quantity - executed quantity.
- total - executed quantity in the second coin.
- timestamp_nano - UNIX timestamp in nanoseconds.
TradeOrder
{
id: number,
ex_id: EX_ID,
pair: string,
pair_source: string,
is_buy: boolean,
is_bot: boolean,
type: TRADE_ORDER_TYPE,
quantity: number,
price: number,
error: string,
ex_order_id: string
}
Trade order model. Used to work with and subscribe to the trade bot.
- id - order identifier.
- ex_id - id of the exchange. Look at the EX_ID constant.
- pair - full pair name.
- pair_source - short pair name.
- is_buy - "true" if this is a "buy" order, otherwise "false".
- is_bot - is false if the order is manually created.
- type - constant. Look at TRADE_ORDER_TYPE
- quantity - the quantity of coins in the order.
- price - order price.
- error - may contain the text of an order execution error.
- ex_order_id - the order's exchange identifier. It is necessary to obtain data about the exchange order.
TrailingOrder
{
id: number,
ex_id: EX_ID,
pair: string,
pair_source: string,
is_buy: boolean,
origin_price: number,
step_percent: number,
dump_percent: number,
stop_loss: number,
quantity: number
}
Trailing order model. Used to work with trailing bots and subscriptions to it.
- id - order identifier.
- ex_id - id of the exchange. Look at the EX_ID constant.
- pair - full pair name.
- pair_source - short pair name.
- is_buy - "true" if this is a "buy" order, otherwise "false".
- origin_price - initial trailing price.
- step_percent - the percentage of the next trailing step.
- dump_percent - a percentage of the price to roll back to sell.
- stop_loss - the price of the stop loss value.
- quantity - the quantity of coins on the order.
AskBid
{
pair_source: string,
ask: [][]number,
bid: [][]number
}
Contains DOM data.
- pair_source - short pair name.
-
ask - an array sorted in ascending order.
- ask[n][1] - price
- ask[n][2] - volume
-
bid - an array sorted in descending order.
- bid[n][1] - price
- bid[n][2] - volume
2019 All rights reserved