Skip to content

Rsi


class backtide.strategies.Rsi(rsi_period=14, bb_period=20, bb_std=2.0)

Relative Strength Index combined with Bollinger Bands for dual confirmation.

Combines RSI and Bollinger Bands. Enters long when RSI is in oversold territory and price is at or below the lower Bollinger Band, giving a dual confirmation of mean-reversion conditions. Exits when RSI returns to neutral or price reaches the upper band. Useful for catching bounces with higher conviction than RSI or Bollinger Bands alone.

Parameters

rsi_period : int, default=14

RSI look-back period.

bb_period : int, default=20
Bollinger Band moving average period.

bb_std : float, default=2.0
Number of standard deviations for the bands.

Attributes

name : str

Human-readable strategy name.

is_multi_asset : bool
Whether this is a multi-asset strategy.


See Also

AdaptiveRsi

Relative Strength Index with a dynamically adaptive look-back period.

AlphaRsiPro

Advanced Relative Strength Index with adaptive overbought/oversold levels.

BollingerMeanReversion

Mean-reversion strategy using Bollinger Band boundaries.


Methods

description Short explanation of what the strategy does.
evaluate Evaluate the strategy and return orders.
required_indicators Indicators that must be computed up-front for this strategy.


method description()

Short explanation of what the strategy does.

Returns

str

The description.



method evaluate(data, portfolio, state, indicators=None)

Evaluate the strategy and return orders.

Parameters

data : dict[str, np.array | pd.DataFrame | pl.DataFrame]

Keys are the experiment's symbols and values are the historical OHLCV data available up to the current bar.

portfolio : Portfolio
Current portfolio holdings (cash, positions and open orders).

state : State
Current simulation state.

indicators : dict[str, dict[str, np.array | pd.DataFrame | pl.DataFrame]] | None
The first keys are the indicator names. The second keys are the experiment's symbols. The values are the pre-computed indicator values. None if no indicators were selected.

Returns

list[Order]

Orders to place this tick.



method required_indicators()

Indicators that must be computed up-front for this strategy.

Returns a list of indicator instances, already parameterized with this strategy's current settings, that the engine will auto-include before the backtest starts.

Returns

list[BaseIndicator]

The required indicator instances.