Skip to content

RsrsRotation


class backtide.strategies.RsrsRotation(period=18, top_k=5, rebalance_interval=20)

Multi-asset portfolio rotation ranked by Resistance Support Relative Strength.

Periodically ranks all assets by their RSRS indicator value and rotates into those with the strongest support signals. Assets whose support floor is rising fastest relative to resistance are considered to have the best risk/reward profile. Useful for support-based portfolio rotation across a universe of stocks.

Parameters

period : int, default=18

RSRS look-back window for ranking.

top_k : int, default=5
Number of top-ranked assets to hold.

rebalance_interval : int, default=20
Number of bars between rebalancing.

Attributes

name : str

Human-readable strategy name.

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


See Also

RocRotation

Multi-asset portfolio rotation ranked by Rate of Change.

Rsrs

Resistance Support Relative Strength trend-detection strategy.

TripleRsiRotation

Multi-timeframe Relative Strength Index portfolio rotation strategy.


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.