Investment Studio > Expressions > Functions > Lookup > ASSET_QUOTES
float array[*][*] asset_quotes(integer asset_index, string fields, date start_date, date end_date = start_date, integer max_quotes = -1)
Returns an array containing dates (first column) and requested quote fields (subsequent columns) for the asset identified by asset_index over the time period start_date to end_date.
The fields string can contain any combination of the following characters:
| O | Day's Open price. |
| H | Day's High price. |
| L | Day's Low price. |
| C | Day's Close price. |
| V | Day's trading Volume. |
| I | Day's Open Interest. |
| B | Day's Bid price. |
| A | Day's Ask price. |
| P | Day's Bid Size. |
| Q | Day's Ask Size. |
The string is not case sensitive, so "ohlcv" is equivalent to "OHLCV". Each character corresponds to a column in the result array; for instance, "HLC" will return an array containing the mandatory (first) date column, followed by a (second) column with intraday highs (H), a (third) column with intraday lows (L) and a (fourth) column with closing prices (C).
For each day in the requested date range, at least one of the requested quote fields must be available for a row to be added to the result array.
If start_date < end_date, the result array is time-sorted in ascending order (earliest date in first row, latest date in last row). If start_date > end_date, the result array is time-sorted in descending order (latest date in first row, earliest date in last row). If end_date is omitted, it defaults to start_date (meaning only quotes for that day will be returned).
If max_quotes > 0, no more quotes than max_quotes will be returned. If start_date > end_date, the oldest quotes in excess of max_quotes are discarded. If start_date < end_date, the most recent quotes in excess of max_quotes are discarded.
If max_quotes is omitted, it defaults to -1, imposing no limitation on the number of quotes returned.
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_ask, asset_ask_size, asset_bid, asset_bid_size, asset_close, asset_currency, asset_high, asset_low, asset_nav, asset_open, asset_open_interest, asset_units, asset_volume.