Investment Studio > Views > Assets > Grid fields

For generic help on Grid record definitions, see

Record definition editor
Grid data types
Expressions
Alphabetic function reference

The following notes are specific to the Asset view's Grid object. Click in its toolbar or use Customize > Setup in its pop-up menu to open the record definition editor.

This Grid's primary purpose is to provide direct access to Investment Studio's internal table of assets in the selected portfolio. Its record definition should therefore contain at least one Asset type field (Why? See the discussion of lookup record fields!).
In most cases, asset name, symbol and currency should all be exposed and editable.
Include an editable Color-type custom property called "_COLOR" in the Grid's record definition to tell Chart and Graph objects in the Assets view which color to use for each asset (when Autocolor is enabled). Editing the value of this property causes all Charts and Graphs in the view to be updated accordingly.

The Quotes view also supports the "_COLOR" property and shares its value for each asset with the Assets view.

Chart and Graph expressions can access Grid field values for the selected asset using the "GRID" symbol qualifier, as in "GRID._NAV".
Use the special symbols FROM_DATE and TO_DATE to find out the view's current date range, as set in the toolbar (e.g. to get asset NAVs and compute returns over the time frame being displayed). Since up-to-date NAVs may not be available, the dates of the actual quotes should always be provided too.
Use the special symbol PORTFOLIO to get the index of the selected portfolio in Investment Studio's internal table of loaded portfolios. This allows portfolio data to be used in expressions and comparisons to be made between individual assets and the portfolio (e.g. fraction of portfolio NAV, beta, correlation).
Use the special symbol SELECTED to get the index of the selected asset in Investment Studio's internal table of assets in the selected portfolio. This allows comparisons to be made between each asset (identified by the value of any Asset type field in the Grid's record definition) and the selected asset (identified by SELECTED). For instance, you could compare relative strengths or compute asset price correlations, and have them automatically recomputed whenever a new asset (or a new date range) is selected in the Grid.
Comparisons across assets can also involve a fixed asset rather than the SELECTED one. Since asset indices may change at any time, they can not be specified using constants, but they can be obtained by a simple trick. The following expression will return the index of the asset with symbol "TEST" (or #N/A if no such asset is found):

=match("TEST", mop("asset_symbol()", makevector(1000, 0, 1)), 0) - 1

This expression assumes that there are at most 1000 assets in the portfolio - increase the first makevector argument if there are more (!). Alternatively, use the portfolio_flags function with the special symbol PORTFOLIO to get a listing of all assets in the selected portfolio, then count them with rows.