scan
Run a condition across many IDX stocks at once to find matches, even for tickers without existing alerts. Specify operator, left and right operands (e.g., close > sma20) to screen watchlists or movers.
Instructions
Run a condition across many IDX stocks at once — alert_check for stocks you have no rules for.
COST: bars are the expensive part. Throughput is capped at roughly 6.6 upstream requests a second, so a 20-symbol moving-average screen takes ~15s and anything referencing sma200 takes ~50s. Defaults are set at that honest ceiling; raising max_symbols much past 30 will time out before it finishes. A SECOND scan over an overlapping universe is far cheaper — bar pages are cached for six hours once settled — so sweep broadly once, then iterate on the condition.
Misses distinguish condition-false from warming-up and no-data. warming-up means the comparison could not be made: either not enough history yet, or an operand the series does not carry — a response that omits volume leaves it absent rather than zero, and no amount of extra history will settle that. Truncation is always reported with its reason, so a capped sweep never reads as a complete one.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| op | Yes | ||
| left | Yes | Condition left side, e.g. close | |
| right | Yes | Condition right side, e.g. sma20 | |
| panels | No | ||
| report | No | Series to report for each hit, e.g. ["close", "rsi14"] | |
| symbols | No | Explicit tickers. Omit to use movers or trending. | |
| overlays | No | ||
| universe | No | Default symbols. `watchlist` sweeps your own list — usually the one you want. | |
| max_seconds | No | Default 45 | |
| max_symbols | No | Default 20. See the cost note. | |
| watchlist_id | No | Which watchlist, from the `watchlist` tool. Defaults to your default list. |