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.
=T2S_OPosCount()
| 12 |
T2S_OPosBySymbol
Retrieves specific SUMMARY level position data for a list of symbols.
symbolComma-separated list of symbols (e.g., "AAPL,TSLA"). If empty, returns all.
fieldsAttributes to retrieve (e.g., "symbol,position,markPrice"). If empty, returns all available attributes.
isShowTitleBoolean (true/false) indicating whether to include the header row.
=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.
currenciesComma-separated list of currencies to filter by (e.g., "USD,EUR").
isShowTitleBoolean (true/false) indicating whether to include "Currency" and "Total" headers.
=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.
=T2S_OPosTotalBase()
| 25450.85 |
T2S_OPosByCategory
Filters SUMMARY level position by assetCategory (e.g., STK, OPT) or subCategory and returns specific fields.
categoriesComma-separated list of categories (e.g., "STK, ETF"). If empty, returns all.
fieldsAttributes to retrieve (e.g., "symbol,position,markPrice"). If empty, returns all available attributes.
isShowTitleBoolean (true/false) indicating whether to include the header row.
=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.
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_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 |