Discovering Market Edges With LLM Reasoning

Price Bars In, Edges Out
Raw price bars hold no opinion, and this pipeline compresses weekly sessions into structural edges through LLM reasoning layers.
Three layers sit between raw bars and a decision, a session parser extracting structure from candlesticks, a reasoning engine identifying edges, and a compiler rolling weekly edges into quarterly playbooks with winrates and invalidation for review.
Weekly sessions become edges, phases, and traps, monthly extraction merges duplicates and normalizes direction, quarterly summarization cross-validates against economic events, what lands is a playbook, not just alerts, with winrates on every edge.
Notebooks Without Structure
Most edge discovery tools fall into two camps, charting suites demand manual annotation of every session while signal bots send alerts without explaining why, the gap was a pipeline that reads price data, reasons about structure, and returns edges.
Charting suites leave reasoning to the trader, sessions annotated by hand, patterns spotted by eye, edges kept in a notebook that grows without structure, signal bots move faster but explain nothing, firing alerts that demand trust without context.
Freeform direction fields and self-reported winrates inflate confidence without cross-validation, so work piles up without compressing into rules. A pipeline that classifies, extracts, and summarizes turns it into a playbook, each layer grounded in winrates and regime conditions. What sits in the editor is a set of edges to test, with invalidation next to every entry.

Labels Drift, Trust Inflates
- Charting suites demand manual annotation of every session and pattern.
- Signal bots send alerts without explaining why an edge works or fails.
- Freeform direction fields produce hundreds of inconsistent labels across weeks.
- Self-reported winrates from single weeks inflate confidence without cross-validation.
Layers Close the Gap
- Classify weekly sessions into edges, phases, traps, and lessons.
- Extract monthly patterns by merging duplicates and normalizing direction.
- Summarize quarterly playbooks cross-validated against economic events.
- Store every layer with deterministic IDs and concurrent-safe upserts.
- Return codified rules with winrates, regime conditions, and invalidation.
A Pipeline, Three Stages
The strategy is one pipeline, three layers. A weekly classifier designed to find edges, phases, and traps feeds a monthly extractor that merges duplicates and normalizes direction, while a quarterly summarizer cross-validates against economic events to produce a playbook. Each layer compresses the last, turning sessions into rules with winrates and regime conditions.
One pipeline, three layers, each compressing the last. A weekly classifier finds edges, phases, and traps from session metrics. A monthly extractor merges identical patterns across weeks, normalizes direction, and consolidates traps into canonical descriptions. A quarterly summarizer cross-validates against economic events, producing a playbook with winrates on every edge.
Every layer has a clear job. Weekly finds, monthly merges, quarterly validates, and the playbook lands ready for backtesting.

Reasoning Over Raw Bars
Every week enters as raw bars and leaves as structured edges. A fetcher pulls OHLC and calendar data, feeding a calculator that splits sessions into blocks and extracts price levels, volume zones, delta trends, and node clusters. The result is a markdown table of session metrics, passed to a reasoning model that identifies which signals produce directional moves.
// Load a random week, classify, then extract and summarize
const weekData = Schema.getRandomWeek('XAUUSD')
const context = Pipeline.buildL1Context(weekData)
const classified = await Pipeline.classify(config, context)
// classified.edges, classified.traps, classified.lessons
const monthly = await Pipeline.extract(config, monthClassifiers)
const playbook = await Pipeline.summarize(config, l3Context)
// playbook.edges with winrates and invalidation
A parser extracts edges, traps, and lessons from the response, storing each week with a deterministic ID, while monthly extraction merges patterns across weeks, normalizes direction, and consolidates traps into canonical descriptions with winrates.

Playbook Landed, Ready for Backtest
| Layer | Scope | Delivered |
|---|---|---|
| Classify | Weekly | Edges, phases, traps, and lessons per week |
| Extract | Monthly | Canonical merged patterns with normalized direction |
| Summarize | Quarterly | Cross-validated playbook with winrates |
| Storage | All | Deterministic IDs with concurrent-safe upserts |
| Sync | Backfill | OHLC and economic calendar with auto-backfill |
Grounded by Economic Events
- One entry point kept weekly, monthly, and quarterly layers aligned.
- Deterministic IDs prevented duplicate work across pipeline runs.
- Monthly extraction removed a class of inconsistent labels and duplicates.
- Cross-validation against economic events grounded quarterly playbooks in context.
The Playbook Stays Auditable
What began as a way to find edges for one pair became a pipeline compressing weekly sessions into quarterly playbooks. Classify, extract, and summarize share one entry point, keeping the loop from bars to playbook short, with winrates on every edge.
Every edge carries a winrate and invalidation rule so backtesting starts from codified rules not freeform notes, sessions turn into structure, the editor holds the result, and the loop from bars to playbook stays short and fully auditable end to end.
The pipeline turns weeks into structure, structure into rules. Every edge testable, every playbook grounded, the loop stays short.