Orders
šØ Important: If you haven't yet connected your brokerage accounts via SheetsFinance then you won't have access to this function, please refer to the Brokerage docs page to get started.
Access your real-time brokerage account recent orders data directly in Google Sheets using the SF_BROKERAGE() function. By default the function returns your orders from the last 30 days, and you can use startDate and endDate to pull in a specific date range.
=SF_BROKERAGE(account, "orders", metrics, startDate, endDate, "", options)accountis the nickname of the brokerage account connection you want to pull data from. You can find the nickname of your connected brokerage accounts from the Brokerage Sidebar in Google Sheets (Extensions > SheetsFinance > Brokerage). You can set custom nicknames for your brokerage accounts, see the Setting Nicknames for Your Brokerage Accounts for more information.typeis the type of data you want to pull in, in this case"orders".metricsselects what data you want to pull in. You can leave this blank or set it to"all"to output ALL available orders metrics. You can also chain together multiple metrics using the&operator, for example"symbol&name&type&action&executionPrice". See the full list of available metrics below.startDate[OPTIONAL] is the start date for the orders you want to pull in, in the formatYYYY-MM-DD. If omitted, orders default to the last 30 days and go back up to 90 days.endDate[OPTIONAL] is the end date for the orders you want to pull in, in the formatYYYY-MM-DD.optionsadjusts the formatting and ordering of the output. The available options are:"NH"- No header row."ob=<metric>"- Order the output by a specific metric, for example"ob=symbol"."-"- Reverse the output order. This is especially useful when combined withob, for example"ob=symbol&-".
š„ Hot Tip: You can sort recent orders by any returned field using the options argument. For example, "ob=symbol" sorts alphabetically and "ob=symbol&-" reverses that order.
Metrics
The metrics available for the "orders" type are as follows:
"all"- All available order data."symbol"- The symbol of the order."name"- The name of the order."currency"- The currency of the order."exchange"- The exchange the order is listed on."type"- The type of order."optionSymbol"- The option symbol of the order."action"- The action of the order."status"- The status of the order."totalQuantity"- The total quantity of the order."openQuantity"- The open quantity of the order."canceledQuantity"- The canceled quantity of the order."filledQuantity"- The filled quantity of the order."executionPrice"- The execution price of the order."limitPrice"- The limit price of the order."stopPrice"- The stop price of the order."orderType"- The type of order."timeInForce"- The time in force of the order."timePlaced"- The time the order was placed."timeUpdated"- The time the order was updated."timeExecuted"- The time the order was executed."expiryDate"- The expiry date of the order.
Examples
š¤ Reminder for the below examples:"alpaca" is the nickname of our example brokerage account, you will need to replace this with the nickname of your own brokerage account.
Example 1: Pulling in the last 30 days of orders for an account
=SF_BROKERAGE("alpaca", "orders")
Example 2: Pulling in specific metrics from your account recent orders
=SF_BROKERAGE("alpaca", "orders", "symbol&name&type&action&executionPrice")
Example 3: Pulling in recent orders with no header row
=SF_BROKERAGE("alpaca", "orders", "symbol&name&type&action&executionPrice", "", "", "", "NH")
Example 4: Pulling in orders for a specific date range
=SF_BROKERAGE("alpaca", "orders", "all", "2026-09-01", "2026-09-30")