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 Stream Event Integration

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


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

Overview

An integration pattern for incorporating streaming indicator values into event-driven systems with transparent pandas/polars Series support.

Description

Streaming functions can be accessed through the main talib module (as talib.stream_SMA, talib.stream_RSI, etc.) where they benefit from the same _wrapper decorator that handles pandas/polars type conversion for the Function API.

The wrapper detects that streaming results are scalars (not arrays) by checking hasattr(result, '__len__') and returns them as-is, without attempting to convert them to Series objects.

Usage

Use this principle when integrating streaming indicators into systems that use pandas or polars as their data layer. The wrapper handles type conversion transparently.

Theoretical Basis

The streaming wrapper integration follows a detection pattern:

# Streaming result detection in _wrapper
result = func(*numpy_args)
first_result = result[0] if isinstance(result, tuple) else result
is_streaming = not hasattr(first_result, '__len__')
if is_streaming:
    return result  # Return scalar as-is, skip Series conversion

Related Pages

Implemented By

Page Connections

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