scan
Run a custom condition across many IDX stocks at once to discover stocks matching criteria without needing predefined alert rules. Specify left indicator, operator, right indicator; optionally report series for each hit.
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 (not enough history to say yet) and no-data. 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. |