Order Placer #
The order-placer
outcome places a new order whose price and quantity
values are specified in the configuration.
The order-placer
outcome cannot be backtested. More information about
strategy backtesting can be found
here.
Configuration #
{
"type": "order-placer",
"context_id": "order-placer-id-123",
"description": "a simple outcome",
"side": "buy",
"percent": true,
"quantity": "300.42",
"price": "last"
}
-
type
- string
The type of the outcome configuration.Outcome configuration types are described in detail here.
-
context_id
- string (optional; default: unused)
The ID of the outcome that is used when inserting data into the context store.The context data store and its IDs are described in detail here.
-
description
- string (optional; default: unused)
The description of the outcome and its purpose. -
side
- string (enum)
The side to use when placing an order. Possible values:buy
sell
-
percent
- boolean (optional; default: false)
The property that is used to determine whether thequantity
value is a percentage of the account cash/position’s quantity or not. Theside
property determines which quantity is used:- If the symbol is an asset pair (e.g.,
BTC/USD
):- If the side is
buy
, it is the quote asset’s position’s quantity. - If the side is
sell
, it is the base asset’s position’s quantity.
- If the side is
- If the symbol is not an asset pair (e.g.,
AAPL
):- If the side is
buy
, it is the exchange account’s cash quantity. - If the side is
sell
, it is the asset’s, which is represented by the symbol, position’s quantity.
- If the side is
- If the symbol is an asset pair (e.g.,
-
quantity
- string (decimal)
The quantity of base asset to buy/sell when placing an order. It must be greater than0
. Ifpercent
is set totrue
, it must also be less than or equal to100
. -
price
- string (enum)
The ticker price to use when placing an order. Possible values:last
ask
bid
Report #
{
"type": "order-placer",
"id": "9bsv0s78ajk0036f3m60",
"quantity": "300.42",
"price": "42.3"
}
-
type
- string
The type of the outcome report.Outcome report types are described in detail here.
-
id
- string
The ID of the order that was placed. -
quantity
- string (decimal)
The quantity of the order that was placed. -
price
- string (decimal)
The price of the order that was placed.
If an error occurs during theorder-placer
outcome’s execution, onlytype
anderror
properties are added to the report. Theerror
property is described in detail here.
Context #
The objects that the order-placer
outcome inserts into the context
store are as follows:
-
outcomes.<context-id>.id
- string
The ID of the order that was placed. -
outcomes.<context-id>.quantity
- string (decimal)
The quantity of the order that was placed. -
outcomes.<context-id>.price
- string (decimal)
The price of the order that was placed.
If an error occurs during theorder-placer
outcome’s execution, only theoutcomes.<context-id>.error
object is inserted into the context store. This context data object is described in detail here.