The Trades Inserter worker is responsible for inserting trades from a datastore that contains the trade information inside the respective portfolios. This worker have two different ways to process the trades: Choosing the Insertion Mode field (view item 1.1) you select the way in which the worker will process the information of the incoming trades. In the Target Portfolio operating mode, all trades are inserted into a single Portfolio which is selected in the Portfolio (view item 1.2) field, if the option selected is Set By Portfolio UID, the Portfolio UID information in each of the trades individually is mandatory, this one is responsible for identifying the target portfolios in which the trades will be inserted. This worker has the option of saving the trade in the destination portfolio (update) if the operation has already been carried out, however, it also provides a preliminary check (transient) in case of the trade has not been carried out, and finally, you can create a new version portfolio (only in Target Portfolio mode). If the portfolio is monitored by the Real P&L Widget, there will be the option of inserting the trade into the Report, then influencing the calculated P&L. You can also provision trades if needed. The Trades Inserter worker generates a portfolio list containing the generated portfolios after adding the trades.
Parameters
The Trades Inserter 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.
1. Input
The Input tab contains parameters which are consumed by the worker, in order to execute it's calculations or actions.
1.1 Insertion Mode
The Insertion method field defines the processing search method when looking for the portfolios that trades will be inserted. If the option "Target Portfolio" is chosen, it is necessary to assign a specific portfolio in which the trades will be inserted. In the "Set by Portfolio UID" option, it is mandatory to send the Portfolio UID information for each trade, which identifies the respective destination portfolio.
1.2 Portfolio
Set the target portfolio using Fixed Portfolio, Get Latest or Upstream Data variants. Only necessary in the Target Portfolio Insertion Mode.
1.3 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 Trades Storage worker. Set Incoming Trades using Upstream Data, Fixed Datastore or Get Latest variants.
1.4 Workspace
The so-called fields set the research workspace of the Portfolio (1.2) and Incoming Trades (1.3). Set workspace using Fixed Workspace variant.
1.5. Notify Real-Time P&L Widget
Select whether the added trades will update an existing Real-Time P&L widget, influencing the calculated P&L.
1.6. Generate Trades Provision
Select whether added trades will be provisioned. If this field is not selected, no provision is generated.
2. Output
The Output tab contains parameters that defines the worker execution results, and how it will be provided to downstream workers.
The fields Name, Date, Workspace, NLV, Base Currency and Tags are only necessary when Insertion Mode (view item 1.1) is set to Target Portfolio.
2.1 Name
Set the portfolio name using Template Text or Upstream Data variants.
2.2 Date
Select the portfolio date using Fixed Date or Upstream Data variants.
2.3 Workspace
Set the workspace in which the merged portfolio will be saved on the platform using Fixed Workspace.
2.4 Net Liquidating Value (NLV)
Set the portfolio NLV using Number or Upstream Data variants.
2.5 Base Currency
Select the portfolio base currency using Select or Upstream Data variants.
2.6 Tags
Set the portfolio tags using Fixed Tags or Upstream Data variants.
2.7 Storage Mode
Select if the result datastore will be saved on the platform, update an existing portfolio or be a transient one through the following options: Transient, Update or Create (only in Target Portfolio mode).
Results
The result of the Trades Inserter worker will vary depending on the Insertion Mode field (view item 1.1) selected option. If the option of the Insertion Mode field is selected as Target Porfolio, the output will be a Portfolio Object, however, if the option is Set by Portfolio UID, the output will be a List of Portfolios Objects. Below you can see an example of the Trades Inserter result object hierarchy for each Insertion Mode option. You can check the Output Types article to learn more about result objects types.
Insertion Mode is set as Target Portfolio:
- Portfolio (portfolio)
- ID (string)
- Name (string)
- Tags (list)
- Date (date)
- Base Currency (number)
- NLV (number)
- Securities (list)
- ID (string)
- Status (string)
- Instrument Class (string)
- Symbol (string)
- Label (string)
- Quantity (number)
Insertion Mode is set as Set By Portfolio UID:
- List (list of portfolios)
- Portfolio (portfolio)
- ID (string)
- Name (string)
- Tags (list)
- Date (date)
- Base Currency (number)
- NLV (number)
- Securities (list)
- ID (string)
- Status (string)
- Instrument Class (string)
- Symbol (string)
- Label (string)
- Quantity (number)
- Portfolio (portfolio)