Guides / Cookbooks
Cookbooks · Signals: rules plus forecasts · Intermediate · about 8 min
RSI and Bollinger mean-reversion checks
Check whether a stock is stretched to the downside with RSI and Bollinger rules, then ask whether the next week leans toward a bounce.
When to use it
"Oversold" is a fact about today; a bounce is a forecast. A mean-reversion entry wants both, and keeping them as separate answers stops a deep RSI from being read as a prediction.
The request
{ "model": "ora-fin1", "state": { "symbol": "AMZN" }, "questions": { "oversold": { "type": "yes_no", "ask": "rsi(C,14) < 30" }, "below_band": { "type": "yes_no", "ask": "C < bblower(C,20,2)" }, "stretched": { "type": "yes_no", "ask": "rsi(C,14) < 35 or C < bblower(C,20,2)" }, "oversold_en": { "type": "yes_no", "instructions": "Is its 14-day RSI below 30?" }, "up_week": { "type": "yes_no", "instructions": "Will the stock be higher in a week?" }, "drop5": { "type": "yes_no", "instructions": "Will it drop at least 5% at some point in the next month?" } } }Open this in the PlaygroundThe real response
AMZN:
{ "model": "ora-fin1", "answers": { "oversold": { "type": "yes_no", "yes_no": 0.1, "rule": "rsi(C,14) < 30", "basis": "rule" }, "below_band": { "type": "yes_no", "yes_no": 0.5676, "rule": "C < bblower(C,20,2)", "basis": "rule" }, "stretched": { "type": "yes_no", "yes_no": 0.5676, "rule": "rsi(C,14) < 35 or C < bblower(C,20,2)", "basis": "rule" }, "oversold_en": { "type": "yes_no", "yes_no": 0.1, "rule": "rsi(C, 14) < 30", "basis": "comparison", "explain": "rsi < 30" }, "up_week": { "type": "yes_no", "yes_no": 0.493 }, "drop5": { "type": "yes_no", "yes_no": 0.462 } }, "usage": { "input_tokens": 455, "output_tokens": 24 }, "context": { "source": "server", "symbol": "AMZN", "as_of": "2026-10-30" }, "version": "ora-fin-0.1.1" }RSI is not oversold (
oversold0.1; the English version compiled to the same rule), but the close sits about on its lower Bollinger band (below_band0.5676, near the line).ortakes the higher part, sostretchedis 0.5676. The forecast does not lean either way (up_week0.493). For MSFT the band belief is 0.4578 andup_week0.574.The code
Requires curl 7.76+. Save as run.sh, then: bash run.shcurl -sS https://oramodel.com/v1/systemone \ -H "Authorization: Bearer $JEV_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "ora-fin1", "state": { "symbol": "AMZN" }, "questions": { "oversold": { "type": "yes_no", "ask": "rsi(C,14) < 30" }, "below_band": { "type": "yes_no", "ask": "C < bblower(C,20,2)" }, "stretched": { "type": "yes_no", "ask": "rsi(C,14) < 35 or C < bblower(C,20,2)" }, "oversold_en": { "type": "yes_no", "instructions": "Is its 14-day RSI below 30?" }, "up_week": { "type": "yes_no", "instructions": "Will the stock be higher in a week?" }, "drop5": { "type": "yes_no", "instructions": "Will it drop at least 5% at some point in the next month?" } } }'Act on it
Require both a stretch and a lean before you treat it as a setup, and keep the rule's belief as a strength, not a switch:
a = {k: v["yes_no"] for k, v in data["answers"].items()} if a["stretched"] >= 0.6 and a["up_week"] >= 0.55: add_to_reversion_list(symbol, strength=a["stretched"]) elif a["stretched"] >= 0.6: note(symbol, "stretched, but no bounce lean in the forecast")On this session neither symbol clears both lines, so nothing is added.
Variations
- Wider bands:
C < bblower(C,20,2.5). A different oscillator:stochk(14) < 20. - An exit in the same request:
rsi(C,14) > 50orC > avg(C,20). - Ready-made pairs: Examples → Strategies → Mean Reversion.
- Wider bands:
Information, not investment advice. Every number on this page is a real response for the session shown; answers change with each session.