Candle Foundations
5 algorithms in Price Action and Candlesticks · 2 with asserted arithmetic.
In this family#
-
Candle Anatomy verified
Decomposes one candle into body, upper and lower shadow, and direction. Every candlestick pattern is built on these measurements, so an inconsistent decomposition propagates into every pattern above it.
analyzeCandle(candle, directionEpsilon) -
Scale-Aware Body Classification verified
Classifies a candle body as long, short or doji **relative to recent bodies** rather than against a fixed threshold. A 50-point body is enormous on one instrument and unremarkable on another, so an absolute rule cannot transfer.
classifyBody(observation, priorClosedBodies, configInput) -
Shadow-to-Body Ratio contract
Decomposes one OHLC candle and reports raw and tick-stabilized shadow-to-body ratios without hiding the zero-body case.
shadowToBodyRatio(inputs) -
Gap Classification contract
Classifies full-range, body, or opening gaps in either direction using an explicit tick-scaled minimum distance.
gapClassification(inputs) -
Trend-Context Filter contract
Classifies prior closes as an uptrend, downtrend, or sideways context from normalized net movement and path efficiency.
trendContextFilter(inputs)
What they share#
Every topic here is a record-transform</code> or <code>row-classify, so once you have
called one the rest follow the same shape. Import paths differ only in the final segment:
import { analyzeCandle } from "fintech-algorithms/price-action-and-candlesticks/candle-foundations/candle-anatomy";
import { classifyBody } from "fintech-algorithms/price-action-and-candlesticks/candle-foundations/scale-aware-body-classification";Read them in the order above — the sequence is pedagogical, not alphabetical.
Where this sits#
Price Action and Candlesticks collects 38 algorithms across 5 families. For the concept behind this family rather than the call signatures, see the concept guides.