Screen positions
Steps
- Apply each criterion as a predicate against the latest bar of each ticker's enriched frame.
- Common screens (start here):
oversold_rsi:RSI_14 < 30overbought_rsi:RSI_14 > 70golden_cross:SMA_50crosses aboveSMA_200(vs. previous bar — not justSMA_50 > SMA_200)death_cross:SMA_50crosses belowSMA_200near_52w_high: latest close within 1% of trailing-252-bar maxnear_52w_low: latest close within 1% of trailing-252-bar min
- Return a structured result — for each matched ticker, list the criteria it matched and the values that triggered them.
- Don't silently coerce — if a screen requires
RSI_14and a ticker doesn't have enough bars, skip that ticker for that screen with a reason.
Output shape
[
{
"ticker": "AAPL",
"matched": ["overbought_rsi", "near_52w_high"],
"values": {"RSI_14": 78.6, "close": 184.32, "52w_high": 185.00}
}
]
Failure modes to avoid
- "Cross" detected as
A > Binstead of "Awas<= Blast bar, now>this bar". - 52-week extremes computed from
max(close)instead ofmax(high). - Single threshold for all markets — equities
RSI_14 < 30≠ cryptoRSI_14 < 30(volatility differs). - Silent skip when a ticker lacks bars — surface it.