Skip to content
StatePath
Tool Atlasinterpretor.oscillator_state

Tool

Oscillator State

interpretor.oscillator_state

InterpretorOscillator

Inputs

oscillatorBuffer (time series)

Any numeric oscillator buffer — RSI, CCI, Williams %R, MACD, etc. Its scale must match the levels you set.

Outputs

Boolean

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.

Oscillator State overview diagram

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

Overboughtoverbought

True while the oscillator sits above the overbought level — momentum is stretched to the upside.

Overbought diagram

When to use: Gate fade/short setups or block fresh longs when the oscillator is in the high zone.

Oversoldoversold

True while the oscillator sits below the oversold level — momentum is stretched to the downside.

Oversold diagram

When to use: Gate dip-buy/long setups or block fresh shorts when the oscillator is in the low zone.

Neutralneutral

True when the oscillator is between the oversold and overbought levels — no momentum extreme.

Neutral diagram

When to use: Gate range-trading or trend-continuation entries that you only want while momentum is calm and mid-range.

Above centerlineabove_centerline

True while the oscillator is above its midline — momentum is net bullish.

Above centerline diagram

When to use: Bias the strategy long whenever momentum holds above the centerline (50 for RSI, 0 for MACD/CCI).

Below centerlinebelow_centerline

True while the oscillator is below its midline — momentum is net bearish.

Below centerline diagram

When to use: Bias the strategy short whenever momentum holds below the centerline.

Rising from oversoldrising_from_oversold

Fires on the single bar the oscillator crosses back up out of the oversold zone — a momentum turn-up.

Rising from oversold diagram

When to use: Trigger long entries right as momentum exits oversold, instead of buying while it is still falling.

Falling from overboughtfalling_from_overbought

Fires on the single bar the oscillator crosses back down out of the overbought zone — a momentum turn-down.

Falling from overbought diagram

When to use: Trigger short entries right as momentum exits overbought, instead of selling while it is still rising.

Configuration

modeenum

Which state to test: overbought, oversold, neutral, above/below centerline, or the edge events rising-from-oversold and falling-from-overbought.

Choices:overboughtoversoldneutralabove_centerlinebelow_centerlinerising_from_oversoldfalling_from_overbought
overbought_levelscalar

The upper cutoff that counts as overbought (used by the overbought, neutral, and falling-from-overbought modes).

overbought_level diagram
oversold_levelscalar

The lower cutoff that counts as oversold (used by the oversold, neutral, and rising-from-oversold modes).

oversold_level diagram
centerlinescalar

The midline level (50 for RSI, 0 for MACD/CCI) used by the above-centerline and below-centerline modes.

centerline diagram

Connects to

Reads from
Feeds into

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.

See also