Skip to content

Long Line Candle

Patterns pattern candlestick classic

A candle with an unusually long body.

Visual Example

Long Line Candle — annotated preview mapping to core implementation

Synthetic ideal per library logic. Generated 2026-07-01 IST via docs/generate_all_previews.py (reproducible; maps to core Next<T> implementation).

Description

A candle with an unusually long body.

Indicates strong momentum in the direction of the candle.

QuantWave evaluates this pattern on completed OHLC windows using TA-Lib-aligned geometry rules. Output is an event signal (+100 bullish, −100 bearish, 0 none) — ideal for rule-based strategies and encoded ML features.

Typical applications:

  • Scan for completed pattern windows — never act on partial formations
  • Combine with Market Structure or trend filters in production
  • Encode signed output (+/−/0) before ML training
  • Expect false positives in choppy ranges; require volume or HTF confirmation

QuantWave implements this via the universal Next<T> trait — bit-identical across Rust streaming, Python streaming, and Polars .ta() batch plugins.

Formula / Specification

Recognition Rules (TA-Lib-compatible, CDLLONGLINE in quantwave-core/src/indicators/pattern.rs):

  1. Stateless candlestick pattern evaluated on OHLC windows.
  2. Returns a signed signal (+100 bullish, −100 bearish, 0 none) on the completion bar.
  3. Exact threshold geometry (body ratios, gap requirements, shadow lengths) matches the TA-Lib reference implementation wrapped via talib_cdl! in quantwave-core/src/indicators/pattern.rs.
  4. Validate against quantwave-core/tests/gold_standard/ vectors where present.

Parameters

Parameter Default Description
(none) No tunable parameters for this detector.

Usage Examples

Streaming (Rust)

use quantwave_core::indicators::CDLLONGLINE;
use quantwave_core::traits::Next;

let mut det = CDLLONGLINE::new();
for (o, h, l, c) in &ohlcv {
    let sig = det.next((o, h, l, c));
}

Streaming (Python)

from quantwave import CDLLONGLINE

det = CDLLONGLINE()
for o, h, l, c in ohlcv:
    sig = det.next((o, h, l, c))

Polars Batch (Python)

import polars as pl
import quantwave  # registers pl.col().ta

df = (
    pl.read_csv('ohlcv.csv')
    .lazy()
    .with_columns(
        pl.col("open").ta.cdl_longline("open", "high", "low", "close").alias("long_line_candle")
    )
    .collect()
)

All surfaces are bit-identical via the single Next<T> implementation and proptests.

Edge Cases & Limitations

  • Requires sufficient complete OHLC bars; early bars yield no signal.
  • False positives are common in sideways markets — gate with trend or structure filters.
  • Pattern semantics follow TA-Lib body/shadow rules; literature variants may differ.
  • Signed output (+/−/0) should be consumed as events, not continuous features without encoding.
  • Combine with volume expansion or higher-timeframe confirmation for production use.
  • No look-ahead bias; signal is known only after the pattern window closes.

Boundary Behavior

Condition Behavior
Warm-up Leading bars return NaN until warmup_bars is satisfied.
period > len When period exceeds series length, output is all NaN.
NaN inputs NaN in input propagates to output (NaN out).
Invalid params Non-positive period or missing required params raise ValueError.
Empty data Empty input returns an empty result series.

Sources & References

Primary Source: https://www.investopedia.com/articles/active-trading/062315/using-bullish-candlestick-patterns-buy-stocks.asp

Implementation: quantwave-core/src/indicators/pattern.rs (CDLLONGLINE / CDLLONGLINE_METADATA). Pattern reference: TA-Lib CDL family via talib_cdl! in pattern.rs. Nison (1991) cited for psychology only — no duplicated boilerplate. Parity: quantwave-core/tests/gold_standard/cdllongline.json

Provenance: Standards bulk upgrade 2026-07-01 IST — see docs/DOCUMENTATION_STANDARDS.md.