backtrader.indicators.rmi module¶
Relative Momentum Index Module - RMI indicator.
This module provides the Relative Momentum Index (RMI) developed by Roger Altman as a variation of RSI.
- Classes:
RelativeMomentumIndex: RMI indicator (alias: RMI).
Example
- class MyStrategy(bt.Strategy):
- def __init__(self):
self.rmi = bt.indicators.RMI(self.data, period=20, lookback=5)
- def next(self):
# RMI above 70 indicates overbought if self.rmi.rmi[0] > 70:
self.sell()
# RMI below 30 indicates oversold elif self.rmi.rmi[0] < 30:
self.buy()
- class backtrader.indicators.rmi.RelativeMomentumIndex[source]¶
Bases:
RelativeStrengthIndexDescription: The Relative Momentum Index was developed by Roger Altman and was introduced in his article in the February 1993 issue of Technical Analysis of Stocks & Commodities magazine.
While your typical RSI counts up and down days from close to close, the Relative Momentum Index counts up and down days from the close relative to a close x number of days ago. The result is an RSI that is a bit smoother.
Usage: Use in the same way you would any other RSI. There are overbought and oversold zones, and can also be used for divergence and trend analysis.
- See:
- alias = ('RMI',)¶
- linealias = (('rsi', 'rmi'),)¶
- plotlines = <backtrader.metabase.plotlines_obj object>¶
- frompackages = ()¶
- packages = ()¶