Skip to main content

A New Category of Trading Primitive

Traditional quant trading uses two types of inputs: price data and fundamental data. ClyptQ adds a third: AI-generated signals — produced by language models, web searches, and sentiment analysis. These aren’t bolt-on integrations or external scripts. They’re first-class operators in the same DAG that runs your technical indicators:
RSI and LLM output are both TaggedArrays. Both flow through RollingBuffers. Both participate in topological execution. The graph doesn’t care that one comes from a math formula and the other from GPT-4.

Why This Is Unique

No other trading platform treats AI as a composable operator. With ClyptQ, AI capabilities are declarative. You add an LLMScorer to your graph, and the framework handles caching, rate limiting, cost control, and mode-dependent execution.

The Three AI Operators

LLMScorer

Converts language model output into quantitative trading signals.
Output: TaggedArray with values in [-1.0, 1.0] — same format as any other alpha signal. Downstream operators (scalers, optimizers, order intentions) consume it identically.

WebSearchOperator

Fetches and analyzes real-time web information as a trading input.
Gate pattern: The gate_input parameter means the web search only executes when a condition is met (e.g., volatility spike). This controls costs — you don’t search Google 1,440 times per day for each symbol.

SentimentParser

Extracts structured sentiment from text using LLM or rule-based parsing.

The Ephemeral Pattern

AI operators are ephemeral — they only execute in paper and live modes: Why? AI operators are non-deterministic. The same prompt sent twice to GPT-4 can produce different results. This makes backtesting unreliable — you can’t reproduce results. How the graph handles it: When an ephemeral operator returns valid=False, downstream operators see the invalid mask and can:
  • Fall back to a non-AI signal path
  • Skip the tick entirely
  • Use the last valid AI signal (forward-fill)
In backtest: uses technical_signal (deterministic). In live: uses llm_signal when available, falls back to technical_signal when the LLM call fails.

Cost Control Strategies

AI API calls cost money. ClyptQ provides multiple mechanisms to control costs:

1. Call Interval

At 1-minute ticks, call_interval=60 means one API call per hour instead of 60.

2. Gate-Based Activation

AI operator only fires when market conditions warrant it.

3. Input Deduplication

If the prompt context is identical to the last call, skip the API call and reuse the previous result.

4. Caching

Same query within the cache window returns cached results.

Common Patterns

Pattern 1: News-Augmented Momentum

Combine traditional momentum with LLM-analyzed news:

Pattern 2: Event-Driven Trading

Search for market-moving events, trade on their impact:

Pattern 3: Rule-Based Backtest, AI Live

Use rule-based approximation for backtesting, AI for live:

What This Enables

AI operators unlock strategy categories that were previously impossible to implement systematically: The key insight: these AI capabilities are composable. They aren’t standalone systems — they’re operators that combine with technical indicators, portfolio state, and risk management in the same graph.

Relationship to Other Concepts