Investment Studio > Expressions > Functions > Lookup > ASSET_UNITS
| Scalar form: | float asset_units(integer asset_index, date quote_date) Returns the number of units of the asset identified by asset_index which were held in the selected portfolio on the specified quote_date. |
| Array form: | float array[*][2]
asset_units(integer asset_index, date start_date, date end_date) Returns a two-column array containing dates (first column) and number of units (second column) of the asset identified by asset_index which were held in the selected portfolio during the time period start_date to end_date. Only dates when the number of units changed are included. The array is time-sorted in ascending order (earliest date in first row, latest date in last row). |
Asset indices are references to entries in Investment Studio's internal table of assets in the selected portfolio. The table is automatically created and maintained behind the scene, and may be rearranged at any time. Asset indices should therefore never be specified using constants, but rather obtained through the interface methods provided by the object hosting the expression (if need be with the aid of the transaction_asset function). See e.g. the discussion of lookup cells in Grid objects.
See also asset_close, asset_currency, asset_fee_flows, asset_first_trade, asset_flows, asset_high, asset_last_trade, asset_low, asset_nav, asset_open, asset_principal_flows, asset_quotes, asset_volume.