| name | cross-sectional |
| description | Use for any cross-sectional strategy that ranks a large universe and trades only a subset (e.g. long-short deciles/quintiles). The principle — narrow to a bounded set as early as you can, store the target weights, and subscribe to only that bounded set (never the whole universe); the rebalance orders the py`dict`cs`Dictionary` (finalizing weights there only when they need a subscription-only dataset). How you obtain the ranking inputs depends on the universe dataset (see below) — there is no single recipe. |
Cross-sectional long-short — trade a subset without subscribing to the whole universe
A cross-sectional strategy screens a large universe but trades only a small subset (e.g. a long-short of two quintiles). The cost trap: add the whole universe and compute the signal in pyon_datacsOnData/the rebalance — QC then subscribes to every screened name and streams its data every bar, and the algorithm crawls. The principle is to narrow to a bounded set as early as possible, store the target weights, and return only that bounded set so QC subscribes to just those; the rebalance then places the orders.
Universe mechanics shared by every dynamic universe — the MINUTE resolution default, scheduling selection to the rebalance calendar, and what to return during warm-up — are in the universes skill; apply them here too. One cross-sectional-specific addition: when a numeric signal is computed for hundreds or thousands of names every selection (rolling-window arithmetic, z-scores, rank transforms), compute it as array math over the whole cross-section — one names×window matrix, one argsort — not a per-name Python loop; at that scale the interpreted loop dominates runtime even with a bounded subscription set. A per-name loop is fine for small universes or genuinely path-dependent per-name logic that array operations cannot express.
Where the ranking can happen depends on the universe dataset
The universe selection function hands you that dataset's universe data points, and each dataset exposes different attributes — and some datasets provide no universe selection at all. So there is no one recipe; pick by what the data point gives you: