Skip to content
Open RaamTrade

Marubozu

A bar that is almost all body: it opened at one extreme and closed at the other, with no meaningful shadow. One side controlled the entire session. Returns +1 white, −1 black.

Signature

Marubozu(lookback, shadow_ratio, on=<source>)
Argument Type Required Notes
lookback int Param Yes Pinned at 1. Bounds 1–1.
shadow_ratio float Param or literal Yes Largest shadow on either side, as a fraction of the range. Default 0.05, bounds 0.0–0.3.
on= symbol No Source symbol. Defaults to the trade symbol. Reads open, high, low, close.

Formula

Both shadows within shadow_ratio of the range; sign from the body’s direction.

Warmup

None.

Reading the value

p.value
p > 0

Pattern indicators return a flag, not a level: +1 bullish, -1 bearish, 0 absent. They are zero on most bars by design, so treat them as event triggers rather than as something to smooth or cross.

Example

class MarubozuMomentum(Strategy):
"""Act on the pattern only in the direction of the longer trend."""
trade = Symbol()
sizing = FixedCapital()
def execute(self):
p = Marubozu(1, 0.05, on=self.trade)
sma = SMA(50, on=self.trade)
if p.value > 0 and self.trade.close > sma.value and self.trade.is_flat:
self.buy(self.trade, reason="White marubozu in an uptrend")
if self.trade.is_long and self.trade.close < sma.value:
self.sell(self.trade, self.trade.position, reason="Trend lost")

Notes

  • The strongest single-bar continuation signal in the vocabulary, and the least ambiguous to detect — no body-size judgement is involved, only shadow size.