IntradayMomentumIndex — Intraday Momentum Index
תוכן זה אינו זמין עדיין בשפה שלך.
RSI computed on open-to-close moves instead of close-to-close: it aggregates candle bodies rather than bar-to-bar changes, so overnight gaps do not enter the calculation at all. On a gappy instrument the two can disagree sharply, and that disagreement is the point.
Signature
IntradayMomentumIndex(period, on=<source>)| Argument | Type | Required | Notes |
|---|---|---|---|
period |
int Param or literal | Yes | Window. Default 14, bounds 1–400. |
on= |
symbol | No | Source symbol. Defaults to the trade symbol. Reads open and close. |
Formula
$$ \text{IMI} = 100,\frac{\sum (C - O)^{+}}{\sum (C - O)^{+} + \sum (O - C)^{+}} $$
Warmup
period bars; 50 on a window with no movement at all.
Reading the value
imi.valueimi < 30imi.crossed_above(50)Example
class ImiReversion(Strategy): """Fade an intraday-momentum washout.""" trade = Symbol() sizing = FixedCapital()
def execute(self): imi = IntradayMomentumIndex(14, on=self.trade) if imi.value < 30 and self.trade.is_flat: self.buy(self.trade, reason=f"IMI {imi.value:.0f}") if imi.value > 70 and self.trade.is_long: self.sell(self.trade, self.trade.position, reason="IMI overbought")Notes
- Tushar Chande’s Intraday Momentum Index.
- Uses simple sums rather than Wilder smoothing, matching the original definition.