Tool
Oscillator State
interpretor.oscillator_state
Inputs
Any numeric oscillator buffer — RSI, CCI, Williams %R, MACD, etc. Its scale must match the levels you set.
Outputs
A boolean that is true on each bar the chosen momentum state holds, ready to wire into a filter or signal.
Oscillator State reads any oscillator buffer and answers a single momentum question as True or False, so you can gate trades on it. Point it at RSI, CCI, Williams %R, or any numeric oscillator, set the levels to that oscillator's scale, and pick the state you care about.
How it works
Per bar it evaluates the chosen mode against the oscillator value: overbought (above overbought_level), oversold (below oversold_level), neutral (in between), above_centerline or below_centerline, plus the edge events rising_from_oversold (just crossed up out of oversold) and falling_from_overbought (just crossed down out of overbought). Set overbought_level, oversold_level, and centerline to match the oscillator (RSI uses 70/30/50; Williams %R uses -20/-80/-50; CCI uses 100/-100/0).
Modes
True while the oscillator sits above the overbought level — momentum is stretched to the upside.
When to use: Gate fade/short setups or block fresh longs when the oscillator is in the high zone.
True while the oscillator sits below the oversold level — momentum is stretched to the downside.
When to use: Gate dip-buy/long setups or block fresh shorts when the oscillator is in the low zone.
True when the oscillator is between the oversold and overbought levels — no momentum extreme.
When to use: Gate range-trading or trend-continuation entries that you only want while momentum is calm and mid-range.
True while the oscillator is above its midline — momentum is net bullish.
When to use: Bias the strategy long whenever momentum holds above the centerline (50 for RSI, 0 for MACD/CCI).
True while the oscillator is below its midline — momentum is net bearish.
When to use: Bias the strategy short whenever momentum holds below the centerline.
Fires on the single bar the oscillator crosses back up out of the oversold zone — a momentum turn-up.
When to use: Trigger long entries right as momentum exits oversold, instead of buying while it is still falling.
Fires on the single bar the oscillator crosses back down out of the overbought zone — a momentum turn-down.
When to use: Trigger short entries right as momentum exits overbought, instead of selling while it is still rising.
Configuration
Which state to test: overbought, oversold, neutral, above/below centerline, or the edge events rising-from-oversold and falling-from-overbought.
The upper cutoff that counts as overbought (used by the overbought, neutral, and falling-from-overbought modes).
The lower cutoff that counts as oversold (used by the oversold, neutral, and rising-from-oversold modes).
The midline level (50 for RSI, 0 for MACD/CCI) used by the above-centerline and below-centerline modes.
Connects to
Examples
- Wire market.rsi in, set mode to oversold with oversold_level 30, and use the BOOL as a long-entry filter.
- Set mode to rising_from_oversold to trigger only on the bar momentum turns back up out of oversold territory.
Common mistakes
- Leaving the default 70/30/50 levels on an oscillator with a different scale, like Williams %R (-100..0), so the gate never fires.
- Treating a steady overbought reading as a sell — in a strong trend an oscillator can sit overbought for many bars.