Rsi threshold buy sell
Buy marks dips where the RSI balance falls below -0.5; sell marks rallies above +0.5.
Over the last rsi_window bars this sums the price rises and falls, weights each move by log(volume + 1) when the volume input is connected, and returns (gains minus losses) over (gains plus losses), a value between -1 and +1 called the balance. Buy marks bars where the balance is below lower; sell marks bars where it is above upper. Each marker only records that a threshold was crossed, because the indicator itself checks no reversal and waits for no turn in price.
How to read it
- Markers sit on the candles; this indicator has no pane of its own.
- A buy marker means recent falls outweighed rises by more than three to one (balance below -0.5). A sell marker means rises outweighed falls by more than three to one (balance above +0.5).
- On SPY one-minute bars in September 2026 at default settings, each side marked about 8% of bars and started about 22 separate runs a day, so these markers are common, not rare.
- With confirm_days at 1, every bar of a run is marked: read a run as one stretch of sustained pressure, not as many signals. The first rsi_window bars never mark while the window fills.
What it outputs
- Buy: balance below lower
- Marks each bar where the balance is below lower (default -0.5): recent falls clearly outweighed rises. A dip marker, not a breakout.
- Sell: balance above upper
- Marks each bar where the balance is above upper (default +0.5): recent rises clearly outweighed falls. A rally marker, not a reversal call.
When it fires
Buy fires on bars where the balance is below lower: recent falls outweighed rises by over three to one at defaults. Sell fires above upper, where rises outweighed falls the same way. Each marks a stretch of extreme pressure, not a turn in price.
Settings
- rsi_window
- How many recent bars the balance is measured over. Shorter (around 7) reacts within minutes and marks more often; longer (60 or more) moves slowly and marks fewer, longer runs. Nothing marks until this many bars have loaded.
- lower
- The buy level. Lowering it (toward -1) needs a deeper sell-off, so fewer buy markers; raising it toward 0 marks more dips. The slider goes to 51, but the balance stays within -1 to +1.
- upper
- The sell level. Raising it (toward +1) needs a stronger rally, so fewer sell markers; lowering it toward 0 marks more rallies. The slider goes to 51, but the balance stays within -1 to +1.
- confirm_days
- How many consecutive bars the condition must hold before marking. At 1 every bar of a run is marked; at N only the Nth bar of each run of N or more is, giving fewer, later markers that skip one-bar flickers.
Pitfalls
- Buy marks weakness, not strength: in a steady downtrend the balance can stay below lower for a long stretch, so buy markers keep coming as price falls.
- Nothing enforces lower below upper. If lower ends up above upper, both sides mark most bars, and the two sliders can contradict each other.
- The balance stays between -1 and +1, so a lower below -1 or an upper above +1 never marks. The sliders run to 51, so those values are easy to reach by accident.