Jump to content

Connect SuperML | Leeroopedia MCP: Equip your AI agents with best practices, code verification, and debugging knowledge. Powered by Leeroo — building Organizational Superintelligence. Contact us at founders@leeroo.com.

Principle:TA Lib Ta lib python Pattern Signal Interpretation

From Leeroopedia
Revision as of 18:22, 16 February 2026 by Admin (talk | contribs) (Auto-imported from principles/TA_Lib_Ta_lib_python_Pattern_Signal_Interpretation.md)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)


Knowledge Sources
Domains Technical_Analysis, Pattern_Recognition
Last Updated 2026-02-09 22:00 GMT

Overview

A signal encoding scheme where candlestick pattern detection results are represented as integer values (-100, 0, +100) indicating bearish, neutral, or bullish signals.

Description

All 61 CDL pattern functions in TA-Lib use a consistent three-valued integer encoding for their output:

  • +100: Strong bullish pattern detected
  • 0: No pattern detected at this position
  • -100: Strong bearish pattern detected

This encoding allows simple numerical operations:

  • Filtering: Find pattern occurrences with np.where(signal != 0)
  • Direction: Determine bullish/bearish by sign
  • Aggregation: Sum multiple pattern signals for composite indicators

Usage

Apply this principle when interpreting any CDL function output. Filter for non-zero values to find pattern occurrences, and use the sign to determine direction.

Theoretical Basis

The signal encoding maps pattern detection to a discrete signal:

# Signal interpretation logic
for i in range(len(signal)):
    if signal[i] > 0:
        action = "BULLISH"   # Consider buying
    elif signal[i] < 0:
        action = "BEARISH"   # Consider selling
    else:
        action = "NEUTRAL"   # No pattern, no action

Related Pages

Implemented By

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment