get_deltas(fields, reset=False)
Description:
Returns the subscribed symbols (via get_quotes) for which one or more of the specified fields have changed since the last update reset. Used to monitor real-time updates efficiently without polling all symbols repeatedly.
Function Signature:
get_deltas(fields: List[str], reset: bool = False) -> tupleParameters:
| Name | Type | Required | Default | Description |
| fields | List[str] | Yes | — | List of field names to track for changes (e.g., ['last', 'volume']). |
| reset | bool | No | False | If True, resets the internal update tracker. All changes are tracked fresh after this call. |
Return:
Returns a tuple of symbol strings that have experienced a change in any of the specified fields since the last reset. An empty tuple means nothing has changed.
How It Works:
- Tracks symbols subscribed via get_quotes() with subscribe=True.
- Compares the latest field values against the last known values.
- If a change is detected in any tracked field, the symbol is returned.
Reset Behavior:
- get_deltas() resets automatically after a call to get_quotes(), or a manual call to get_deltas(..., reset=True).
- Resetting clears the internal state for all subscribed symbols and fields, not just the ones passed.