Constructor
new AOHost(argsopt)
- Source:
Parameters:
Name | Type | Attributes | Description | ||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
args |
object |
<optional> |
arguments Properties
|
Members
(static) TEARDOWN_GRACE_PERIOD_MS :number
- Source:
- Default Value:
- 10000
How long orders are allowed to settle for before teardown in ms.
Type:
- number
Methods
aosRunning() → {boolean}
- Source:
Returns:
aosRunning - true if any algo order is currently running
- Type
- boolean
close() → {Promise}
- Source:
Close the exchange adapter connection.
Returns:
p - resolves on connection close
- Type
- Promise
connect()
- Source:
Opens a new socket connection on the internal adapter
getAdapter() → {object}
- Source:
Get configured exchange adapter
Returns:
adapter
- Type
- object
getAO(id) → {object}
- Source:
Returns the algo order definition identified by the provided ID
Parameters:
Name | Type | Description |
---|---|---|
id |
string | i.e. bfx-iceberg |
Returns:
aoDef
- Type
- object
getAOInstance(gid) → {object}
- Source:
Returns the active AO instance state identified by the provided GID
Parameters:
Name | Type | Description |
---|---|---|
gid |
string | algo order group ID |
Returns:
state - algo order state
- Type
- object
getAOInstances() → {Array.<object>}
- Source:
Returns an array of all running algo order instances
Returns:
aoInstances
- Type
- Array.<object>
getAOs() → {Array}
- Source:
Fetch configured algorithmic orders
Returns:
aos
- Type
- Array
(async) loadAllAOs()
- Source:
Loads and starts all saved previously active algo orders
reconnect()
- Source:
Disconnect & reconnect the exchange adapter
(async) reloadAllAOs()
- Source:
Implodes all current AO instances, but does NOT stop them. Afterwards, all known AOs are loaded and started again.
(async) startAO(id, args, gidCBopt) → {string}
- Source:
Creates and starts a new algo order instance, based on the AO def identified by the supplied ID
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
id |
string | algo order definition ID, i.e. bfx-iceberg |
|
args |
object | algo order arguments/parameters |
|
gidCB |
function |
<optional> |
callback to acquire GID prior to ao:start |
Returns:
gid - instance GID
- Type
- string
(async) stopAO(gid)
- Source:
Stops an algo order instance by GID
Parameters:
Name | Type | Description |
---|---|---|
gid |
string | algo order instance GID |
Events
dataBook
- Source:
Triggered when an order book update is received.
Parameters:
Name | Type | Description |
---|---|---|
update |
Array.<Array> | incoming snapshot or price level |
meta |
EventMetaInformation | source channel information |
dataCandles
- Source:
Triggered when a candle snapshot or individual candle is received.
Parameters:
Name | Type | Description |
---|---|---|
update |
Array.<Array> | incoming snapshot or single candle |
meta |
EventMetaInformation | source channel information |
dataManagedBook
- Source:
Triggered when an order book update is received, and an internally managed order book instance is updated. The entire order book is passed to the event listeners.
Parameters:
Name | Type | Description |
---|---|---|
book |
object | full order boook |
meta |
EventMetaInformation | source channel information |
Listeners of This Event:
dataManagedCandles
- Source:
Triggered when a candle update is received, and an internally managed candle dataset is updated. The entire dataset is passed to the event listeners.
Parameters:
Name | Type | Description |
---|---|---|
candles |
Array.<object> | full dataset |
meta |
EventMetaInformation | source channel information |
Listeners of This Event:
dataNotification
- Source:
Triggered when a notification is received.
Parameters:
Name | Type | Description |
---|---|---|
notification |
Array.<Array> | incoming notification data |
meta |
EventMetaInformation | source channel information |
dataTicker
- Source:
Triggered when a ticker is received.
Parameters:
Name | Type | Description |
---|---|---|
ticker |
Array.<Array> | incoming ticker data |
meta |
EventMetaInformation | source channel information |
dataTrades
- Source:
Triggered when a trade snapshot or single trade is received
Parameters:
Name | Type | Description |
---|---|---|
update |
Array.<Array> | incoming snapshot or single trade |
meta |
EventMetaInformation | source channel information |
Listeners of This Event:
errorsInsufficientBalance
Triggered when an order fails due to have insufficient balance
Parameters:
Name | Type | Description |
---|---|---|
order |
object | the order that failed |
notification |
object | the incoming notification |
Listeners of This Event:
errorsMinimumSize
- Source:
Triggered when an order fails due to being below the minimum size for that market.
Parameters:
Name | Type | Description |
---|---|---|
order |
object | the order that failed |
notification |
object | the incoming notification |
Listeners of This Event:
lifeStart
- Source:
Triggered when an algorithmic order begins execution.
Listeners of This Event:
- module:AccumulateDistribute.onLifeStart
- module:Iceberg.onLifeStart
- module:MACrossver.onLifeStart
- module:OCOCO.onLifeStart
- module:PingPong.onLifeStart
- module:TWAP.onLifeStart
lifeStop
- Source:
Triggered when an algorithmic order ends execution.
Listeners of This Event:
- module:AccumulateDistribute.onLifeStop
- module:Iceberg.onLifeStop
- module:MACrossover.onLifeStop
- module:OCOCO.onLifeStop
- module:PingPong.onLifeStop
- module:TWAP.onLifeStop
ordersOrderCancel
- Source:
Triggered on atomic order cancellation
Parameters:
Name | Type | Description |
---|---|---|
order |
object | the order that was cancelled |
Listeners of This Event:
- module:AccumulateDistribute.onOrdersOrderCancel
- module:Iceberg.onOrdersOrderCancel
- module:MACrossover.onOrdersOrderCancel
- module:OCOCO.onOrdersOrderCancel
- module:OCOCO.onOrdersOrderFill
- module:PingPong.onOrdersOrderCancel
- module:TWAP.onOrdersOrderCancel
ordersOrderError
- Source:
Triggered on a generic order error
Parameters:
Name | Type | Description |
---|---|---|
order |
object | the order that caused the error |
Listeners of This Event:
ordersOrderFill
- Source:
Triggered on atomic order fill
Parameters:
Name | Type | Description |
---|---|---|
order |
object | the order that was filled |