Tool
Candle Anatomy
market.candle_anatomy
Inputs
No typed inputs.
Outputs
A bundle of candle-anatomy measurements for each bar — body size, upper wick, lower wick, total range, and the body relative to its rolling average — that downstream tools can read individually. Use it to express shape rules such as 'long lower wick and small body'.
Breaks a single candle down into its parts — the body, the upper wick, the lower wick and the full range — and reports each as a number you can read. It's the building block for any rule that cares about candle shape, like 'small body, long lower wick'.
How it works
For each bar it measures the body (the distance between open and close), the upper shadow (high minus the body top), the lower shadow (the body bottom minus low) and the total range (high minus low). It also compares the current body to a rolling average body over avg_period bars (smoothed with rolling_average_mode), so you can tell a small candle from a large one in context.
Configuration
How many bars are averaged to form the reference 'average body' that the current candle's body is compared against. Longer periods give a steadier baseline; shorter periods adapt faster to the most recent candles.
The moving-average type used to smooth the average body over avg_period (for example simple or exponential). Exponential weights recent candles more heavily, so the baseline reacts quicker to a change in candle size.
Connects to
Examples
- Shape filter: require the lower wick to be at least twice the body to flag hammer-like rejection at support.
- Volatility read: compare the current body to its rolling average to tell an expansion candle from a quiet one before sizing a trade.
Common mistakes
- Reading the body as a signed value when you only need its magnitude (or vice versa) — confusing a bullish from a bearish body when comparing open and close.
- Setting avg_period too short, so the 'average body' tracks the current candle too closely and almost never flags a candle as unusually large or small.