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.
=T2S_OPOS_SUMMARY_COUNT()
| 12 |
T2S_OPOS_SUMMARY_TOTAL
Calculates position totals, either grouped by currency or converted to the Account Base Currency.
currenciesComma-separated list of currencies to filter (e.g., "USD,HKD"), if it is empty, return all.
isBaseTotalIf true, returns a single number (total in base currency), default is false.
isShowTitleIf false, hides headers for the currency table, default is true.
=T2S_OPOS_SUMMARY_TOTAL("", true, false)
| 25450.85 |
T2S_OPOS_SUMMARY_FILTER
Retrieves position data filtered by symbols, categories (asset or sub), or both.
symbolsComma-separated symbols (e.g., "AAPL, TSLA"). Empty for all.
categoriesComma-separated categories (e.g., "STK, ETF"). Empty for all.
fieldsAttributes to retrieve, default is "symbol,position,markPrice,positionValue".
isShowTitleIf false, hides headers for the currency table, default is true.
=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.
symbolsComma-separated list of underlying symbols. If empty, returns all.
stockFieldsFields for stock rows (e.g., "symbol,position,markPrice"). If empty, returns all available attributes.
optionFieldsFields for option rows (e.g., "symbol,expiry,strike,putCall"). If empty, returns all available attributes.
isShowTitleBoolean (true/false) indicating whether to include the header row.
configStringA 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 trueBoolean (true/false) to toggle the visibility of the "cashRequired" column. covered trueBoolean (true/false) to toggle the visibility of the "coveredStockQty" column. uncovered trueBoolean (true/false) to toggle the visibility of the "uncoveredStockQty" column. remain trueBoolean (true/false) to toggle the visibility of the "remainUncoveredStockQty" column. isShowTitleBoolean (true/false) indicating whether to include the header row.
=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.
symbolsComma-separated list of symbols. If empty, returns all.
fieldsComma-separated fields, query the fields inside the report. ("symbol", "openDateTime", "reportDate", "position", etc). Defaults is symbol, position.
extraFieldsOptional: Comma-separated fields, the fields are not inside the report. Current supports: "days" (Holding duration days). Defaults is "".
isShowTitleIf false, hides headers for the currency table, default is true.
=T2S_OPOS_LOT("VOO", "symbol,position", "days", true)
| symbol | position | days |
| VOO | 120 | 21 |
| VOO | 200 | 21 |