Skip to main content

Ember Ember Console Application (CLI)

Overview

This document describes the Ember Console Application, ember-cli, which is a command-line tool that can be used to:

  • Submit orders
  • Replace orders
  • Cancel orders
  • Discard orders
  • Halt or resume trading on the server

The CLI requires Ember to be running, and it communicates with the Ember server using the EMBER_HOME environment variable (and EMBER_WORK variable if Ember is running with separated home/work directories). Alternatively, Java system properties ember.home and ember.work can be used instead of environment variables.

Supported Commands

Here is a list of the supported commands that can be listed by the CLI help command:

export EMBER_HOME=/mnt/c/Projects/deltix/emberHowTo/ember/deltix/ember/bin/ember-cli
==> help
Usage:
set [<attribute_name> [<attribute_value>]]]
unset [<attribute_name>] [<attribute_name>]
submit [-f] [-n <number_of_orders>] [<orderId>]
replace [-f] [<originalOrderId> [<newOrderId>]]
cancel [-f] [<orderId> [<reason>]
status [<orderId>]
mass-status [-a <account>] [-t <traderId>] [-e <exchangeId>]
discard [-f] [<orderId> [<reason>]]
halt [-f] [projectionPath> [<reason> [CANCEL]]]
resume [-f] [<projectionPath> [<reason>]]
sleep [<interval>] (1s is default)
list-services
list-risk-table <projection>
exit
help [<command>]

The table below provides an overview of the above commands:

CommandDescription
setAllows setting attributes of requests sent by other commands, such as submit, replace, cancel, status, discard, halt, and resume. It shows the current values of the attributes if entered without any parameters.
unsetClears attributes specified on the command line or clears all attributes when entered without parameters.
submitSends a new order request. It allows specifying an order ID for the new order on the command line. If not specified, it uses the orderId attribute set with the set command or generates a new unique ID for the order.

The -n option allows you to issue multiple new order requests with a single command. For multiple orders, this command uses a specified or generated order ID for the first order, and then uses it as a prefix in the IDs of all the remaining orders issued by this command.
replaceSends a replace order request. It allows specifying the original and new order IDs on the command line or in context properties modified by the set command. If IDs are omitted, it uses the order ID of the last order issued during the CLI session as the original order ID, and generates an ID for the new order ID.
cancelSends an order cancel request. It allows specifying an order ID on the command line or in context properties. If omitted, it tries to use the ID of the last order issued during the CLI session.
statusSends an order status request. It allows specifying an order ID on the command line or in context properties. If omitted, it tries to use the ID of the last order issued during the CLI session.
mass-statusSends a mass-status request to Ember and returns the status of active orders that match filter parameters. It takes the account, traderID, and exchangeID on the command line, and the sourceID from context properties.
discardSends an order discard request. It allows specifying an order ID on the command line or in context properties. If omitted, it tries to use the ID of the last order issued during the CLI session.
haltHalts trading for a specified project path. Project path and reason parameters can be specified on the command line or in context with the set command.
resumeResumes trading for a specified projection path. Projection path and reason parameters can be specified on the command line or in context with the set command.
sleepPauses execution for a specified interval.
list-servicesLists Ember algorithms and trade connectors.
list-risk-tableLists risk table limits configured for a specified projection on the command line. The projection parameter should specify one of the projections in the Ember risk config.
exitExits the CLI session.

All the commands making changes (i.e., submit, replace, cancel, discard, halt and resume) display the request parameters and prompt the user for confirmation before sending the request to the Execution Server.

Most of the commands accept an optional -f flag. When set, commands issue order requests without prompting for confirmation.

set command

The set command allows users to set attributes for requests sent by various commands such as submit, replace, cancel, status, discard, halt, and resume.

Users can view all the supported attribute names and their current values by entering the set command without any parameters. Entering the set command with just an attribute name parameter will show current value of the attribute.

Attribute values that contain space characters should be enclosed in quotes. These attribute values are persisted between CLI sessions in the <ember.home>/ember_console.properties file.

Below is an example demonstrating how to set order parameters and submit an order:

set side BUY 
set quantity 1
set symbol BTCUSD
set orderType MARKET
set account "Gold 1"
submit

Custom order parameters can be entered using their numeric keys:

set attributes 6100=MARKER,6101=00:00:00.500

You can escape commas in attribute values by using a slash:

set attributes 7001=REJECT,DISCONNECT,DELAY:5,CONNECT,7002=Test

The current version of the tool requires you to set all custom attributes at once. If you need to change one attribute, you need to resubmit the entire set.