Assign Trades Rules¶
The Assign Trades Rules worker determines the allocation rule for a trade that has been captured/sent. It receives a set of trades, which are assigned a rule using a configuration datastore. This rule set the allocation of the trade in terms of portfolio, and optionally, book. The Assign Trades Rules worker generates a datastore with the trades processed on an enterprise level.

Parameters¶
The Assign Trades Rules worker must receive specific parameters in order to execute properly. When parameters are not set correctly it may cause the worker to not work as expected. This worker's parameters are separated in the following tabs: Input and Output.
Input¶
The Input tab contains parameters which are consumed by the worker, in order to execute its calculations or actions.

Incoming Trades
The Incoming Trades field receives the data of operations and transactions carried out in the portfolio. These trades must be properly structured in a datastore, which is usually generated by a trade parser. Set Incoming Trades using Upstream Data, Fixed Datastore or Get Latest variants.

Workspace
The so-called fields set the research workspace of the Incoming Trades (1.1), Assign Portfolio Rules (1.3) or Assign Book Rules (1.5), respectively. Set workspace using Fixed Workspace variant.

Assign Portfolio Rules
This field receives a configuration datastore, which serves as a Lookup Table to, based on the property set in Assign Portfolio By (1.4), identifies the portfolio assignment rule to be applied. Set the Assign Portfolio Rules using a Upstream Data, Fixed Datastore or Get Latest variants.

The Assign Portfolio Rules datastore is a two-column table, the header must contain the following fields: Property and Rule. Each row corresponds to a property value and must have an associated rule. The table below shows an example of filling.
| Property | Rule |
|---|---|
| Trader 1 | Rule A |
| Trader 2 | Rule B |
| Trader 3 | Rule C |
¶
Assign Portfolio By
The Assign Portfolio By field determines the trade property that links the trade to the portfolio assignment rule. Currently, the options available are: Trader and Instrument Class.

Assign Book Rules
Similarly to Assign Portfolio Rules field, the Assign Book Rules field receives a configuration datastore, which serves as a Lookup Table to, based on the property set in Assign Book By (1.6), identifies the book assignment rule to be applied. Set the Assign Book Rules using a Upstream Data, Fixed Datastore or Get Latest variants.

The Assign Book Rules datastore is a two-column table, the header must contain the following fields: Property and Rule. Each row corresponds to a property value and must have an associated rule. The table below shows an example of filling.
| Property | Rule |
|---|---|
| Instrument Class 1 | Rule A |
| Instrument Class 2 | Rule B |
| Instrument Class 3 | Rule C |
¶
Assign Book By
The Assign Book By field determines the trade property that links the trade to the book assignment rule. Currently, the options available are: Trader and Instrument Class.

Output¶
The Output tab contains parameters that defines the worker execution results, and how it will be provided to downstream workers.

Name
Set the output datastore name using Template Text or Upstream Datavariants.
Date
Select the output datastore date using Fixed Date or Upstream Data variants. By default, the created datastore has the same date as the trades.
Workspace
Set the workspace in which the datastore will be saved on the platform.
Tags
Set the datastore tags using Fixed Tags or Upstream Data variants.
Results¶
The results of the Assign Trades Rules worker, is a datastore, containing allocation rules for portfolio and book, in addition to standard trade information. Below you can see an example of the Assign Trades Rules' result object hierarchy. You can check the Output Types article to learn more about result objects types.
- Datastore (datastore)
- ID (string)
- Name (string)
- Date (date)
- Tags (list)
- Data (list)
Data
The data in the datastore is a table, in which has the at least the following columns: Symbol, Quantity, Cost Price, Instrument Class, Execution Date, Book Rule, Portfolio Rule, Allocated Status. If additional information related to the trade is sent, such as trader, settlement, or dealer, the worker automatically adds these columns to the datastore data. Each row corresponds to a trade.