The Portfolio Generator worker creates a new portfolio in the Everysk format with user supplied parameters. Either datastores, files or lists of securities can be used to create a new portfolio. You can either save the generated portfolio in the platform to be used in the workflow or use it temporarily in the workflow where it was generated, to be passed to other workers that consume a portfolio.
By clicking in the Portfolio Generator worker, a setup interface opens:
The Portfolio Generator worker must receive specific parameters in order to execute properly.
The portfolio field has two types of operations controlled by an expand icon (highlighted below in red):
This is the default: It is used when the various parameters from the portfolio (name, date, net liquidating value, base currency, securities) are being provided by the Everysk API, as a Portfolio object. It will be necessary to pass the whole portfolio to a Portfolio Generator worker as Upstream Data in order to save it in the Everysk Platform. You can check the The Worker Structure article to learn more about how to use data from the API inside a workflow.
When you need to supply all the elements from a portfolio, one by one, you will need to press the Expand icon to open more input fields. Fields for the portfolio's name, workspace, date, net liquidating value, base currency and tags will be exposed:
Set the workspace in which the portfolio will be saved on the platform using Fixed Workspace.
1.4 Net Liquidating Value (NLV)
1.5 Base Currency
The securities field has two types of operations controlled by a expand button as well: not expanded and expanded. Not Expanded is used when the list of securities has already been defined elsewhere (a file, a datastore, etc) and Expanded exposes fields to enter securities, one by one.
Similar to the portfolio functionality, Securities can be passed to this worker as lists. These list of securities can be previously specified in a File or Datastore for example.
In the Not Expanded format (default), only a single field is available to specify a list of securities:
By clicking in the Expand icon, more fields are exposed, enabling users to enter securities one by one. To create a new security from by given parameters, click on "edit" - the pencil icon - and a window will pop up on the screen.
Here you can add new securities by providing Symbol and Quantity. You can also add the securities Cost Price, Market Price and Label. Label is a customized string that can be used later to aggregate risks, PL and so forth.
You can add more securities by clicking on the Add Position button on securities section inside the worker.
1.7.3 Cost Price
1.7.4 Market Price
3. Storage Mode
When generating the new portfolio, you can choose whether this portfolio will be saved in the platform or not through the Storage Mode button. This button has two options: Transient and Create.
The generated portfolio will not be saved in the platform, but will be accessible for the next workers in the workflow.
The generated portfolio will be saved in the platform and will be accessible for the next workers in the workflow.
Once this worker finishes to execute successfully, it will return an object containing the generated portfolio to the workflow, which can be used by downstream workers. Below you can see an example of the Portfolio Generator's result object hierarchy. You can check the Output Types article to learn more about result objects types.
- 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)