Skip to content

Excel

OptionsRealTime provides a comprehensive Excel RTD (Real-Time Data) API that streams live portfolio data directly into spreadsheets.

Excel Dashboard

The Excel integration subscribes directly to the same NATS data stream as the web UI, with full access to all fields and accounts. Where the web UI provides pre-built views for analyzing risk, Excel is the path for users who want to build their own dashboards and analytics in a spreadsheet, driven by RTD formulas.

The API is self-discoverable: functions exist to enumerate accounts, tables, fields, and values. Workbooks can be built to discover the connected account and adapt automatically.

Excel runs as an independent client. It can run on the same machine as the web UI or on any other machine that can reach the NATS server, and does not require the web UI to be running.

  1. Ensure OptionsRealTime Rover is running and connected to TWS (no user interfaces need to be running)
  2. Open the provided OptionsRealTime.xlsx template or create a new workbook
  3. RTD functions automatically connect to the NATS data stream

The Excel RTD add-in reads its settings from OptionsRealTime.ini, located in the installation folder (typically C:\Users\<username>\AppData\Local\OptionsRealTime\).

You can edit this file using the shortcut: OptionsRealTime → Advanced → Edit Excel RTD Config

[Addin]
LogLevel="trace"
LogPopupLevel="error"
DateFormats=["%Y-%m-%d", "%Y%b%d"]
[OptionsRealTime]
NatsUrl="nats://localhost:4222"
RtdThrottleMs=250
MaskSize=4
SettingDescription
NatsUrlNATS server address. Default is localhost:4222.
RtdThrottleMsMinimum interval between Excel updates in milliseconds. Lower = more responsive, higher = less CPU usage.
MaskSizeNumber of characters to mask in account IDs (for privacy when sharing screenshots).

If you’re running Excel on a different machine than NATS and Rover, you need to point Excel to the NATS server’s IP address:

  1. Open OptionsRealTime → Advanced → Edit Excel RTD Config
  2. Change NatsUrl from localhost to your NATS server’s IP:
    NatsUrl="nats://192.168.1.100:4222"
  3. Save and restart Excel

See the Multi-Machine Setup guide for complete instructions.

These functions return live values from the four core tables.

FunctionDescriptionArguments
ort_portfolio_valueReturns live portfolio field valueaccount ID, field name
ort_system_valueReturns live system field valueaccount ID, field name
ort_position_valueReturns live position field valueaccount ID, contract ID or symbol, field name
ort_underlying_valueReturns live underlying field valueaccount ID, contract ID or underlying, field name

Access the 5×9 implied volatility and price move scenario grid.

FunctionDescriptionArguments
ort_position_metricReturns metric value from scenario grid for a positionaccount ID, contract ID or symbol, metric field, IV label, move label
ort_underlying_metricReturns metric value from scenario grid for an underlyingaccount ID, contract ID or underlying, metric field, IV label, move label
ort_underlying_metric_priceReturns underlying price at specified move scenarioaccount ID, underlying, move label
FunctionDescriptionArguments
ort_accounts_sizeReturns count of connected accounts(none)
ort_account_atReturns account ID at 1-based indexindex
ort_accounts_masked_sizeReturns count of connected accounts(none)
ort_account_masked_atReturns masked account ID at 1-based indexindex
FunctionDescriptionArguments
ort_position_conids_sizeReturns count of positions for accountaccount ID
ort_position_conid_atReturns position contract ID at 1-based indexaccount ID, index
ort_position_symbols_sizeReturns count of position symbols for accountaccount ID
ort_position_symbol_atReturns position symbol at 1-based indexaccount ID, index
ort_position_expirations_sizeReturns count of unique expiration datesaccount ID
ort_position_expiration_atReturns expiration date at 1-based index (sorted ascending)account ID, index
FunctionDescriptionArguments
ort_position_conids_by_underlying_sizeReturns count of positions for a given underlyingaccount ID, underlying
ort_position_conid_by_underlying_atReturns conId at index for underlyingaccount ID, underlying, index
ort_position_symbols_by_underlying_sizeReturns count of positions for a given underlyingaccount ID, underlying
ort_position_symbol_by_underlying_atReturns symbol at index for underlyingaccount ID, underlying, index
FunctionDescriptionArguments
ort_position_conids_by_expiration_sizeReturns count of positions for a given expiration dateaccount ID, expiration
ort_position_conid_by_expiration_atReturns conId at index for expirationaccount ID, expiration, index
ort_position_symbols_by_expiration_sizeReturns count of positions for a given expiration dateaccount ID, expiration
ort_position_symbol_by_expiration_atReturns symbol at index for expirationaccount ID, expiration, index
FunctionDescriptionArguments
ort_underlying_conids_sizeReturns count of underlyings for accountaccount ID
ort_underlying_conid_atReturns underlying contract ID at indexaccount ID, index, [sort field], [sort order]
ort_underlying_symbols_sizeReturns count of underlying symbols for accountaccount ID
ort_underlying_symbol_atReturns underlying symbol at indexaccount ID, index, [sort field], [sort order]
ort_underlying_symbols_size_by_metricReturns count of underlying symbols (metric-sorted)account ID, metric field, IV label, move label
ort_underlying_symbol_at_by_metricReturns underlying symbol at index, sorted by metric valueaccount ID, index, metric field, IV label, move label, sort order

Notes:

  • Parameters in [brackets] are optional
  • Metric field: DELTA_DLRS_METRICS, DELTA_METRICS, EXTRINSIC_VAL_METRICS, GAMMA_DLRS_METRICS, GAMMA_METRICS, PNL_METRICS, PNL_UNREALIZED_METRICS, THETA2_ORT_METRICS, THETA_LIN_METRICS, THETA_METRICS, TM_VAL_METRICS (position table only), VALUE_METRICS, VEGA_METRICS
  • IV label: MKT, IV10, IV25, IV50, IV75
  • Move label: -20%, -10%, -5%, -1%, 0%, +1%, +5%, +10%, +20%
  • Sort order: DESC (highest first, default) or ASC (lowest first)
  • _by_metric functions sort underlyings by a specific cell in the 5×9 metric grid (e.g., PNL at MKT/0% or DELTA at IV25/+5%)

Enumerate available fields for each table.

FunctionDescriptionArguments
ort_system_fieldsReturns array of valid System table field names(none)
ort_system_fields_sizeReturns count of System table fields(none)
ort_system_field_atReturns System field name at 1-based indexindex
ort_portfolio_fieldsReturns array of valid Portfolio table field names(none)
ort_portfolio_fields_sizeReturns count of Portfolio table fields(none)
ort_portfolio_field_atReturns Portfolio field name at 1-based indexindex
ort_position_fieldsReturns array of valid Position table field names(none)
ort_position_fields_sizeReturns count of Position table fields(none)
ort_position_field_atReturns Position field name at 1-based indexindex
ort_underlying_fieldsReturns array of valid Underlying table field names(none)
ort_underlying_fields_sizeReturns count of Underlying table fields(none)
ort_underlying_field_atReturns Underlying field name at 1-based indexindex
FunctionDescriptionArguments
ort_move_labelsReturns array: -20%, -10%, -5%, -1%, 0%, +1%, +5%, +10%, +20%(none)
ort_move_labels_sizeReturns count of move scenario labels (9)(none)
ort_move_label_atReturns move label at 1-based indexindex
ort_iv_labelsReturns array: MKT, IV10, IV25, IV50, IV75(none)
ort_iv_labels_sizeReturns count of IV scenario labels (5)(none)
ort_iv_label_atReturns IV label at 1-based indexindex
ort_metric_fieldsReturns array of valid metric field names. TM_VAL_METRICS is only available for positions (ort_position_metric), not underlyings.(none)
ort_metric_fields_sizeReturns count of metric field names (13)(none)
ort_metric_field_atReturns metric field name at 1-based indexindex
FunctionDescriptionArguments
ort_get_mask_sizeReturns current account mask size (number of asterisks)(none)
ort_set_mask_sizeSets account mask size (1-8) and returns actual valuesize
ort_mask_accountMasks an account ID (e.g., U2641234 → U264****)account ID
ort_unmask_accountConverts masked account ID to real account IDmasked account ID
FunctionDescriptionArguments
ort_nats_stateReturns live NATS connection state(none)
ort_nats_startStarts NATS connection(none)
ort_nats_stopStops NATS connection(none)
ort_nats_initStarts or stops NATS connectionstart (TRUE/FALSE)
ort_request_refreshRequest full data refresh for an accountaccount ID
ort_request_refresh_allRequest full data refresh for all known accounts(none)
FunctionDescriptionArguments
ort_config_urlReturns configured NATS URL from ini file(none)
ort_config_throttleReturns current RTD throttle interval in ms(none)
ort_set_rtd_throttle_msecSets RTD throttle interval (50-60000 ms)milliseconds
FunctionDescriptionArguments
ort_versionReturns ORT version and build info(none)
ort_utc_nowReturns current UTC date/time (YYYY-MM-DD HH:MM:SS)(none)
ort_utc_now_rtdReturns live UTC time (RTD)(none)

OptionsRealTime includes a template workbook (OptionsRealTime.xlsx) with pre-built tabs demonstrating common use cases:

  • Accounts: Portfolio summary across all accounts

  • Exposure: Underlying-level aggregated data

  • Securities: Per-position detail

  • Underlying: Drill-down by underlying symbol

  • Maturity: Positions grouped by expiration

  • Vol Scenario: Position risk metrics across volatility scenarios

  • Vol Exposure: Underlying risk metrics across volatility scenarios

  • System: Connection health and diagnostics

  • Util: Helper functions and configuration

  • Documentation: Quick reference

Aggregated Greeks and PnL by underlying Portfolio Accounts

Detailed position view Securities

View of positions for a single underlying Underlying Detail

View of positions at a selected expiration Maturity View

Underlying metrics across price and IV scenarios Vol Exposure View

Metrics across IV and price scenarios for a single aggregated underlying Vol Scenario View

System health and data throughput System Health

No Visual Basic for Applications (VBA) is required. This is a pure .xlsx workbook consisting mostly of simple Real Time Data (RTD) formulas. No macros, no security warnings, no code to maintain.