Trades to Sheets for Google Sheets™ add-on Function Reference

T2S_OPosCount

Returns the total count of SUMMARY level position rows currently held in the cached IBKR report.

No parameters required.
REQUIRED REPORT: OpenPosition
REQUIRED FIELDS:
levelOfDetail
=T2S_OPosCount()
12

T2S_OPosBySymbol

Retrieves specific SUMMARY level position data for a list of symbols.

symbol

Comma-separated list of symbols (e.g., "AAPL,TSLA"). If empty, returns all.

fields

Attributes to retrieve (e.g., "symbol,position,markPrice"). If empty, returns all available attributes.

isShowTitle

Boolean (true/false) indicating whether to include the header row.

REQUIRED REPORT: OpenPosition
REQUIRED FIELDS:
levelOfDetail symbol
=T2S_OPosBySymbol("AAPL,MSFT", "symbol,position,positionValue", true)
symbol position positionValue
AAPL 10 1850.50
MSFT 5 2100.25

T2S_OPosTotalByCcy

Calculates total open position values grouped by their trading currency.

currencies

Comma-separated list of currencies to filter by (e.g., "USD,EUR").

isShowTitle

Boolean (true/false) indicating whether to include "Currency" and "Total" headers.

REQUIRED REPORT: OpenPosition
REQUIRED FIELDS:
levelOfDetail positionValue currency
=T2S_OPosTotalByCcy("USD,EUR", true)
Currency Total
USD 15400.75
EUR 3200.40

T2S_OPosTotalBase

Calculates the total value of all positions converted to the account base currency.

No parameters required.
REQUIRED REPORT: OpenPosition
REQUIRED FIELDS:
fxRateToBase positionValue levelOfDetail
=T2S_OPosTotalBase()
25450.85

T2S_OPosByCategory

Filters SUMMARY level position by assetCategory (e.g., STK, OPT) or subCategory and returns specific fields.

categories

Comma-separated list of categories (e.g., "STK, ETF"). If empty, returns all.

fields

Attributes to retrieve (e.g., "symbol,position,markPrice"). If empty, returns all available attributes.

isShowTitle

Boolean (true/false) indicating whether to include the header row.

REQUIRED REPORT: OpenPosition
REQUIRED FIELDS:
assetCategory levelOfDetail subCategory symbol
=T2S_OPosByCategory("STK", "symbol,position,positionValue", true)
symbol position positionValue
TSLA 20 3500.00
NVDA 10 8200.50

T2S_OPosOptionCombined

Generates a table pairing stock positions with related options, calculating coverage and cash requirements.

symbols

Comma-separated list of underlying symbols. If empty, returns all.

stockFields

Fields for stock rows (e.g., "symbol,position,markPrice"). If empty, returns all available attributes.

optionFields

Fields for option rows (e.g., "symbol,expiry,strike,putCall"). If empty, returns all available attributes.

isShowTitle

Boolean (true/false) indicating whether to include the header row.

configString

A semicolon-separated (;) string of key-value pairs to customize table output.
Available Configuration Keys:

Key Default Description
s_prefix "" Prefix prepended to all stock field headers.
o_prefix "" Prefix prepended to all option field headers.
f_prefix "" Prefix prepended to function-calculated headers like "type" and "cashRequired".
na_val "-" The string value used to represent null, empty, or non-applicable data.
cash true Boolean (true/false) to toggle the visibility of the "cashRequired" column.
covered true Boolean (true/false) to toggle the visibility of the "coveredStockQty" column.
uncovered true Boolean (true/false) to toggle the visibility of the "uncoveredStockQty" column.
remain true Boolean (true/false) to toggle the visibility of the "remainUncoveredStockQty" column.
isShowTitle

Boolean (true/false) indicating whether to include the header row.

REQUIRED REPORT: OpenPosition
REQUIRED FIELDS:
assetCategory expiry levelOfDetail multiplier position positionValue putCall strike underlyingSymbol symbol
=T2S_OPosOptionCombined("AAPL", "symbol,position", "symbol,strike,putCall", true, "s_prefix=S_;o_prefix=O_;f_prefix=F_;na_val=N/A")
S_symbol S_position F_type O_symbol O_strike O_putCall F_coveredStockQty F_uncoveredStockQty F_cashRequired F_remainUncoveredStockQty
AAPL 350 STOCK N/A N/A N/A N/A N/A 0 250
N/A N/A OPTION AAPL 280317C00260000 260 C 100 0 0 N/A