Skip to main content

Module candles

Module candles 

Source
Expand description

The candlestick chart of market ohlc (mockup approved 2026-10-26).

One column per candle, newest on the right, sized to the terminal (or the TUI pane). Each row holds two price steps: a body is drawn with half blocks (▀ ▄ █), a wick with thin lines (│ ╵ ╷). Up candles (close ≥ open) are green, down candles red. A price axis on the left and a time axis under the candles. Pure: no I/O.

Structs§

Summary
What the candles of a window add up to.

Constants§

CHART_ROWS
Rows of the chart (each two price steps).
MIN_COLUMNS
Fewest candles the chart is drawn for.

Functions§

axis_cols
The width of the price axis labels for candles between low and high.
chart
The chart of candles (oldest first) in rows rows, one column per candle, each line starting with the price axis. time formats a candle’s open time (ms) for the time axis.
columns_for
The candle columns that fit in width terminal columns, after the rail (│ ) and the price axis.
summary
The summary of candles (oldest first), or None when there are none.