2001issue C031-4
Turning one candle into a ranked numeric object
CandleCode encodes color, body size, and shadows as one additive weight, with the open-close body in the highest bits, so a single bar can be ranked as a number rather than a drawing.
- The open-close relationship occupies the highest bits, so every isolated white candle ranks above every isolated black candle.
- Body size is reduced to four classes, sending a long white body to the top of the scale and a long black body to the bottom.
- Upper and lower shadows are not equal: the largest upper-shadow contribution is 12, and the largest lower-shadow contribution is 3.
- Size thresholds can be taken from recent volatility, including Bollinger Bands, even when the body-size distribution is exponential.
One candle, one weight
CandleCode is a binary encoding of one candlestick that ranks color, body size, and shadows into a single additive weight. The body is the open-to-close range, and it is treated as the highest-weight factor in the encoding.
CandleWeight is an alternative signed index that gives a white body a positive contribution and a black body a negative contribution.
Color in the highest bits
The encoding treats the open-close relationship as the dominant factor and places that information in the highest bits of a binary candle code. Because a white candle's code cannot fall below 64 and a black candle's code cannot exceed 63, every isolated white candle ranks above every isolated black candle.
Four body classes
Body size is reduced to four classes: null, small, middle, and large. Larger white bodies receive higher codes, and larger black bodies receive lower codes.
A long white body is assigned binary 111, or numeric 112. A long black body is assigned 000, or numeric 0. Those two assignments place the extremes of conviction at opposite ends of the scale.
A doji body occupies the middle of the weight range. It receives either 100, with value 64, or 001, with value 16, depending on whether it is treated as white or black. A doji sits in the middle of the scale because it expresses indecision rather than directional conviction.
Unequal shadows
A shadow is the wick above or below the body. Longer upper shadows raise the bullish weight, and longer lower shadows raise the bearish weight. Upper and lower shadows do not contribute equally: the maximum upper-shadow contribution is 12, while the maximum lower-shadow contribution is 3.
The same medium-body, small-upper-shadow pair scores 100 versus 103 when white and 20 versus 23 when black. A missing lower shadow raises the numeric weight relative to a long lower shadow.
Thresholds from recent volatility
A threshold is a size cutoff for small, middle, or large bodies, chosen from recent volatility statistics rather than a fixed pip count.
Hourly spot-currency body-size histograms over four-week windows were treated as exponential rather than log-normal. Initial thresholds were set so that about one-third of candles fell into each of the small and middle body clusters.
Currency-specific thresholds differed by about 10 to 20 percent across intervals, yet those shifts barely changed the behavior of averaged CandleCode indicators. That stability was presented as a sign of statistical robustness.
Bollinger Bands can supply practical size thresholds even when the underlying size distribution is exponential and the bands do not produce equally probable clusters.
All readings on this track · 25 readings
- 1986Construct a decision procedure that revises itself
- 1989Finish the volume checklist before scoring the breakout
- 1989Constructing supervised forecasts on moving averages
- 1991Candlestick labels as stacked construction tests
- 1992Walk-forward evaluation of weekly price-change patterns
- 1993RSI price pattern templates and open interest
- 1994Constructing a dual-net day-ahead index direction forecast
- 1994A clocked stochastic second crest with a window-high stop
- 1996Volatility-ratio, inside-day and narrow-range-4 entry construction
- 1998Sliding-window correlation for cup-and-handle construction
- 2000Constructing rectangles for breakout hypotheses
- 2001Turning one candle into a ranked numeric object
- 2002Fuzzy-scored chart patterns as testable rules
- 2002From hot-zones to an open-close-matrix
- 2003Volume pressure and a band-clearing breakout case
- 2004Evaluating chart patterns against price objectives
- 2004Cobweb turning points from price structure
- 2005Hybrid decision trees and pattern recognition for trend rules
- 2005Two-bar zone codes for testable pattern systems
- 2005Price bar pattern construction and next-bar frequency
- 2008Observe markets before following pattern or system rules
- 2012Treat a four-leg Fibonacci completion as an unpaid hypothesis
- 2014Hidden three-channel regression signals for stock and call option entries
- 2014A shared daily-chart-level framework for session trades and swing holds
- 2015Condensed candlestick signatures