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

T2S_OPOS_SUMMARY_COUNT

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
LEVEL OF DETAIL: SUMMARY
=T2S_OPOS_SUMMARY_COUNT()
12

T2S_OPOS_SUMMARY_TOTAL

Calculates position totals, either grouped by currency or converted to the Account Base Currency.

currencies

Comma-separated list of currencies to filter (e.g., "USD,HKD"), if it is empty, return all.

isBaseTotal

If true, returns a single number (total in base currency), default is false.

isShowTitle

If false, hides headers for the currency table, default is true.

REQUIRED REPORT: OpenPosition
REQUIRED FIELDS:
currency fxRateToBase positionValue levelOfDetail
LEVEL OF DETAIL: SUMMARY
=T2S_OPOS_SUMMARY_TOTAL("", true, false)
25450.85

T2S_OPOS_SUMMARY_FILTER

Retrieves position data filtered by symbols, categories (asset or sub), or both.

symbols

Comma-separated symbols (e.g., "AAPL, TSLA"). Empty for all.

categories

Comma-separated categories (e.g., "STK, ETF"). Empty for all.

fields

Attributes to retrieve, default is "symbol,position,markPrice,positionValue".

isShowTitle

If false, hides headers for the currency table, default is true.

REQUIRED REPORT: OpenPosition
REQUIRED FIELDS:
assetCategory markPrice position positionValue subCategory symbol levelOfDetail
LEVEL OF DETAIL: SUMMARY
=T2S_OPOS_SUMMARY_FILTER("QQQ,VOO", "STK", "symbol,position,markPrice", true)
symbol position markPrice
QQQ 100 588
VOO 320 604.43

T2S_OPOS_SUMMARY_OPTIONCOMBINED

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
LEVEL OF DETAIL: SUMMARY
=T2S_OPOS_SUMMARY_OPTIONCOMBINED("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

T2S_OPOS_LOT

Returns holding duration in days and other details for specific symbols. Processes "LOT" level details to ensure accurate date information.

symbols

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

fields

Comma-separated fields, query the fields inside the report. ("symbol", "openDateTime", "reportDate", "position", etc). Defaults is symbol, position.

extraFields

Optional: Comma-separated fields, the fields are not inside the report. Current supports: "days" (Holding duration days). Defaults is "".

isShowTitle

If false, hides headers for the currency table, default is true.

REQUIRED REPORT: OpenPosition
REQUIRED FIELDS:
openDateTime position reportDate symbol levelOfDetail
LEVEL OF DETAIL: LOT
=T2S_OPOS_LOT("VOO", "symbol,position", "days", true)
symbol position days
VOO 120 21
VOO 200 21