Mechanical · Backtested · Fully Automated

Trade Momentum
by the Rules

AutoTrader scans IBKR in real time and trades one backtested pattern — flag_breakout — across two autonomous personalities. No LLM sits in the live decision path. Every entry, exit, and risk limit is mechanical, deterministic, and configurable from the UI.

2
Trading Personalities
0
LLM Calls in Live Path
200d
Backtest Validation
24
Live Scanner Columns

See Every Screen

A PyQt6 desktop app you run on your own machine against your own IBKR account. Swipe through the real working surfaces — scanner, strategy config, analytics, and backtesting.

From Scan to Trade, Mechanically

Every trade is the output of a deterministic 6-stage pipeline — no LLM, no discretion. The same code runs live and in backtest, so what you validate is exactly what executes.

📡
Scan Movers
📈
Find Impulse
🏴
Detect Flag
🟢
Confirm Breakout
🎯
Mechanical Exit
Forced Flat
IBKR Scanner HIGH_OPEN_GAP, TOP_PERC_GAIN, HOT_BY_VOLUME and more, prefiltered by % change, volume, price & spread
Swing Lookback Searches up to 40 bars for an impulse swing high — the move the flag pulls back from
Tight Flag 4+ consecutive bars (A) consolidating within an 8% range — looser flags are skipped
Volume Confirm Breakout bar must trade ≥ 1.0× the flag's average bar volume, with reward:risk ≥ 0.5:1
Target · Stop · Trail Measured-move target arms a trailing stop; fixed stop sits 1% below the flag low
Session Cutoff A flattens at 09:28 ET, B at 15:55 — no position is ever carried past its window

IBKR-Powered
Market Scanner

Subscribe to multiple IBKR scanner codes in parallel — HIGH_OPEN_GAP, TOP_PERC_GAIN, HOT_BY_VOLUME, and more. Tickers are filtered in real time on % change, volume, price and spread, then evaluated bar-by-bar against the active flag_breakout setup.

Step 1

Scanner picks up movers

HIGH_OPEN_GAP and TOP_PERC_GAIN scanners surface tickers gapping up pre-market.

Step 2

RVOL vs. 30-day baseline

Relative volume is computed against the 30-day average daily volume, with a 3-minute trend flag to show whether participation is building.

Step 3

flag_breakout evaluated live

Each ticker's bars are checked for an impulse → tight flag → confirmed breakout. The Strategy and Reason columns show exactly why a setup is forming, waiting, or rejected.

Step 4

Full session captured for replay

Every scanner cycle is recorded to disk so the exact session can be replayed bar-for-bar through the same engine — backtest and live share one code path.

IBKR Scanner — HIGH_OPEN_GAP • flag_breakout • Premarket
Chg% ≥ 10%
Vol ≥ 30K
Price $1–$50
Spread ≤ 3%
Float cap off
TickerChg%Gap%VolRVOLFloat RotCatalystSetup
AIXI +47.3% +38.1% 2.1M 18.4x 2.1x HIGH ENTRY
SOAR +31.5% +22.0% 890K 9.7x 1.6x HIGH WAIT
SIDU +18.2% +15.4% 450K 5.2x 0.9x MED no setup
LABX +12.6% +9.3% 220K 3.1x 0.6x LOW no setup
SKYQ +28.9% +19.7% 1.3M 12.6x 1.9x HIGH WAIT

Context on the Tape — Not a Trade Trigger

Optional live news from Benzinga, Finnhub, RTPR, IBKR ticks, and Massive — deduplicated and sentiment-scored — enriches the scanner so you can see why a name is moving. It does not place trades: live entries are purely mechanical flag_breakout.

LIVE FEED 5 sources active
08:14
AIXIBenzinga: AIXI Receives FDA Fast Track Designation for AI-Driven Diagnostic Platform
Sentiment: 9.2/10 · Catalyst: HIGH · Prob: 0.91
08:09
SOARRTPR: SOAR Announces $50M Strategic Partnership with Defense Contractor
Sentiment: 8.7/10 · Catalyst: HIGH · Prob: 0.84
08:03
SIDUFinnhub: Sidus Space to Present Phase III Clinical Trial Results at ASCO
Sentiment: 7.8/10 · Catalyst: MED · Prob: 0.67
07:58
SKYQMassive: SkyQuant Q3 Earnings Beat; Revenue Up 42% YoY, Raises Full-Year Guidance
Sentiment: 8.1/10 · Catalyst: HIGH · Prob: 0.79
07:44
TBHIBKR Tick: TBH Completes Reverse Merger with Industry Leader; Begins Trading Under New Symbol
Sentiment: 6.9/10 · Catalyst: MED · Prob: 0.58

How the Sentiment Overlay Works

A two-tier scorer ranks headlines for context in the scanner and analytics — it never gates a live entry.

🧠
Primary: OpenAI / Claude
0–10 score + reasoning string

Sends ticker + headline + abstract to your chosen AI provider (via get_ai_provider() — never hard-coded). Results are cached per ticker/day/headline to prevent duplicate API calls.

Fallback: Heuristic Keyword Engine
Weighted bullish / bearish keyword model

When the AI provider is unavailable, a local keyword model nudges a neutral baseline up for bullish terms (approvals, partnerships, upgrades) and down for bearish ones (dilution, bankruptcy, fraud) — so a score is always available.

⚗️
ML Catalyst Scorer
Machine-learning classifier · runs on every headline

A machine-learning model scores each headline for catalyst strength and a companion classifier tags the catalyst type. Both populate the scanner's Catalyst columns to help you rank what's moving — they never trigger a trade.

Two Personalities, One Proven Pattern

AutoTrader runs flag_breakout concurrently in two independent personalities — premarket and regular hours — each with its own validated parameters, trading window, and risk limits. Both were found by systematic backtest search and confirmed on 90- and 200-day data.

Personality A · Premarket

Flag Breakout — Premarket

Trades 04:00–09:25 ET and is forced flat at 09:28. Demands a longer impulse lookback and a 4-bar flag, so it only fires on well-formed premarket setups.

  • Entry Strategyflag_breakout
  • Swing Lookback40 bars
  • Min Flag Bars4
  • Max Flag Range8.0%
  • Breakout Vol Mult≥ 1.0×
  • Stop Buffer1% below flag low
  • Min Reward:Risk0.5 : 1
  • Trail After Target1.0%
  • Max Trades / Day5
Personality B · Regular Hours

Flag Breakout — Regular Hours

Trades 09:30–16:00 ET and is forced flat at 15:55. A shorter lookback and 2-bar flag suit faster intraday consolidations, with a stricter reward:risk floor.

  • Entry Strategyflag_breakout
  • Swing Lookback30 bars
  • Min Flag Bars2
  • Max Flag Range8.0%
  • Breakout Vol Mult≥ 1.0×
  • Stop Buffer1% below flag low
  • Min Reward:Risk0.7 : 1
  • Trail After Target5.0%
  • Max Trades / Day7
The Pattern

What flag_breakout Looks For

A textbook continuation setup, detected purely from price & volume — no news, no AI, no discretion.

  • 1 · Impulseswing high in lookback
  • 2 · Flagtight pullback ≤ range
  • 3 · Breakoutclose above flag high
  • 4 · Volume≥ flag avg × mult
  • 5 · Targetmeasured move
  • 6 · Stopbelow flag low
  • 7 · Trailarms at target
  • Every gateUI-editable
🔬
Found by Search, Confirmed by Backtest

flag_breakout beat pullback and vwap_reclaim in a systematic 30-day parameter search, then was confirmed on 90- and 200-day cached data before going live. Other entry strategies remain in the codebase, ready to be promoted the same way once they clear the same bar.

Every Gate Is Yours to Tune

flag_breakout exposes its full rule set in the Strategy panel, layered on top of global universe filters and risk controls — no code edits required.

Prefilter (Universe)
min change % · min volume · min/max price · max float · max spread · RVOL floor
Flag Detection
swing lookback bars · min flag bars · max flag range %
Breakout Confirmation
breakout volume multiplier · minimum reward:risk
Exit & Trail
stop buffer % · measured-move target · trail-after-target % · breakeven floor
Session & Compound
entry window · forced-flat time · compound mode · switch margin
Circuit Breakers
max concurrent · max daily trades · max consecutive losses · stale-bar cutoff

Historical Simulation on Real 1-Min Bars

Replay any date range against cached IBKR 1-minute bar data. Every trade is simulated at market speed with full parameter fidelity.

$1,000

Starting balance, compounded across the session

14+

Trade-level metrics tracked per simulation run

1:1

Replay runs the identical live decision engine

Per-Trade Metrics

Entry/exit price, P&L %, hold duration, shares, reward:risk at entry, exit reason (trailing stop / stop below flag low / measured-move target / forced flat), plus the scanner snapshot — sentiment, catalyst and headline — captured at the moment the setup fired.

Daily Aggregates

Win rate, total P&L per day, trade count, session loss tracking, and compound returns over the date range.

Session Capture & Replay

Every live scanner cycle is recorded to disk, so any session can be replayed bar-for-bar through the same engine — the mechanism used to validate flag_breakout on 90- and 200-day windows before promotion.

Backtest Replay — flag_breakout · Personality A · 90 days
Win Rate
50%
Avg / Trade
+1.97%
Total Trades
437
Cumulative P&L %
Ticker Entry Exit P&L% Exit Reason
AIXI $2.14 $3.06 +43.0% Trailing stop
SOAR $5.80 $6.92 +19.3% Trailing stop
LABX $1.22 $1.10 −9.8% Stop (flag low)
SKYQ $3.45 $4.30 +24.6% Forced flat 09:28

AI-Assisted
Trade Review

Live trades are mechanical — but after the close you can ask an AI optimizer to review your history and propose parameter changes. It analyzes and suggests; it never places a trade. One click turns a recommendation into a saved strategy config.

Strategy Optimization Insights Jun 24, 2026 · 8 trades
Why did AIXI win big but LABX lost today?
AIXI formed a clean 4-bar flag (6.1% range) off a +9.4% impulse and broke out on 1.3× the flag's average volume — a textbook flag_breakout with reward:risk of 1.8. The trailing stop banked +43% once the measured-move target armed.

LABX broke out but its flag range was wide (9.6%) and the breakout bar barely cleared the 1.0× volume gate. The move failed back through the flag low and stopped out at −9.8%.
What parameter changes do you recommend?
Tighten ai_flag_max_range_pct to 7.0% and raise ai_flag_breakout_vol_mult to 1.2×. Today's winners all had flags under 7% range and broke out above 1.2× volume — this would have filtered LABX while keeping every winner. Click below to save as a new config.

Analytics Dashboard Features

📈

Daily P&L + Equity Line

A bar per day in dollars with a cumulative equity line overlaid. Hover any bar to see that day's $ and summed %.

📋

14-Column Trade History

Date, entry/exit time, session, strategy, ticker, buy/sell $, P&L%, hold (m), sell reason, sentiment, catalyst, headline. Click a row to inspect the scanner state and exact params captured at trade time.

🤖

Auto Strategy Builder

AI analyzes your trade history and recommends optimized parameters. One click applies them to a new strategy automatically.

🏆

Stat Cards

Total trades, win rate, avg profit %, total P&L, best trade, worst trade — always visible at the top of the dashboard.

Know Exactly Why a Ticker Was Rejected

Every strategy check is surfaced with the actual vs. required value. No more wondering why a trade was skipped — see the full pass/fail breakdown in real time.

AIXI vs. flag_breakout · A
ENTRY
Impulse swing: +9.4% found in 40 bars
Flag bars: 4 ≥ 4 req.
Flag range: 6.1% ≤ 8% req.
Breakout close above flag high confirmed
Breakout volume: 1.3× ≥ 1.0× req.
Reward:risk: 1.8 ≥ 0.5 req.
Time: 08:31 ET in 04:00–09:25 window
SOAR vs. flag_breakout · A
WAIT
Impulse swing: +12.0% found in 40 bars
Flag bars: 3 ≥ 4 req. ❌
Flag range: 9.1% ≤ 8% req. ❌
Breakout volume: 0.8× ≥ 1.0× req. ❌
Reward:risk: 0.4 ≥ 0.5 req. ❌
Time: 08:42 ET in 04:00–09:25 window
Re-checked each new bar until flag tightens

Everything You Need to Trade Smarter

A complete trading system — from real-time alerts to risk management — with every parameter configurable from the UI.

🌊

Momentum Surge Highlighting

Scanner rows tint when a name surges past a configurable threshold over a short window — ≥10% in 1 minute, ≥15% in 2, ≥20% in 3 — each with its own colour, so fast movers jump out of the table at a glance.

🔄

Dual-Personality Orchestration

Premarket (A) and regular-hours (B) personalities run flag_breakout concurrently through one shared state-machine chassis — each with independent trading windows, parameters, daily trade caps, and forced-flat times.

📦

Compound Mode

Holds a single position sized to live account equity and rotates into a stronger setup only when its reward:risk beats the held trade by 1.15×. Backtested $1,000 → ~$28,474 over 90 days under Personality A.

🔌

IBKR Execution

Live and paper trading via IB Gateway (ports 4001/4002) or TWS (7496/7497). Configurable client ID and automatic reconnect on disconnect.

🗂

Float Data Resolution

Resolves shares float from a local FMP cache first, then the FMP API, then a Massive feed fallback — and caches the result. An optional max-float cap can gate the universe (off by default).

🛡

Circuit Breakers

Suspend new entries after a configurable run of consecutive losses, cap daily trades per personality, limit concurrent positions, and skip stale bars — so an unattended session can't spiral.

🕰

Daily Auto-Reset

At 04:00 ET a background loop clears the scanner history file, re-anchors each ticker's session baselines, and resets per-symbol trade counts and cumulative P&L — ready for the new session.

🧩

Tunable & Extensible

Every flag_breakout gate is editable from the Strategy panel and round-trips to ui_config.json. Additional entry strategies (pullback, vwap_reclaim) live in the codebase, ready to promote once they clear the same backtest bar.

🔁

Sentiment Cache

Scores are cached by ticker, day and normalised headline, so the same article is never re-scored and the AI provider isn't billed twice for it. The cache rolls over automatically each new session.

50+ Configurable Parameters

Every trading parameter is accessible from the UI — no code edits required. Changes take effect on the next automation cycle.

Min Change %
≥ 10%
Price Range
$1 – $50
Min Volume
30,000
Max Spread
3%
Flag Range
≤ 8.0%
Breakout Vol
≥ 1.0× flag avg
Min Reward:Risk
0.5 : 1
Trail After Target
1.0%
Position Size
$200 / entry
Compound Mode
ON equity
Max Trades / Day
5
AI Provider
OpenAI / Claude analytics

Momentum Surge Configuration

Set the % move that counts as a surge over each short window, and pick the colour each tier paints the row.

Surge Activity — 1-Minute Move
AIXI
+18.4%
SKYQ
+12.6%
SOAR
+9.7%
SIDU
+5.2%
LABX
+3.1%
Thresholds: 1m ≥ 10% · 2m ≥ 15% · 3m ≥ 20% · each colour-coded

Built for Reliability & Speed

Async First

asyncio event loop in background thread. Semaphore-limited concurrent IBKR requests (5 bar fetches, 2 news). Non-blocking UI at all times.

💾

Persistent Cache

Sentiment scores cached per ticker/day/headline. IBKR 1-min bars cached for backtesting. Resolved float values cached to disk to avoid repeat lookups.

🔒

Risk Guardrails

Session loss/profit limits, a consecutive-loss breaker, daily trade caps, per-ticker entry-check limits, and a fixed stop plus trailing stop on every position.

🔄

Auto Recovery

IBKR connection watchdog, WebSocket auto-reconnect for all news feeds, health monitoring with in-app log window for recovery events.

Set It Up Once.
Let It Trade For You.

Once configured, AutoTrader operates entirely on its own — scanning the market, reading news, scoring catalysts, entering positions, and exiting them without you lifting a finger.

STEP 01
⚙️

You Configure Once

Set your strategy parameters, risk limits, news source, and AI provider through the UI. AutoTrader saves everything to disk — no manual setup required on the next run.

STEP 02
▶️

Press Start

A single button kick-starts the automation loop. The system connects to IBKR, subscribes to scanner feeds, opens news WebSockets, and begins monitoring — all in the background.

STEP 03
🤖

It Runs Itself

AutoTrader handles every decision autonomously — detecting a flag breakout, sizing and placing the order, then managing the exit with a mechanical target, stop, and trailing rule. Every step is logged in the Activity Log in real time.

What Runs Automatically

📡
Scanner streaming from IBKR

Multiple scanner codes stream simultaneously and are filtered on price, gap %, float and RVOL — building the universe of names each personality watches bar-by-bar.

🏴
flag_breakout pattern detection

Each ticker's bars are scanned for an impulse swing, a tight flag, and a confirmed breakout on volume — purely from price & volume, with no LLM in the loop. Optional sentiment is shown alongside for context only.

📊
Market data validation

IBKR is queried for price, volume, gap %, float, and RVOL. Only tickers that pass every active strategy filter proceed to the buy stage.

🟢
Breakout entry with reward:risk check

The order fires on the confirmed breakout bar — provided breakout volume clears the multiplier and the measured-move target gives at least the minimum reward:risk. Otherwise it waits for the next bar.

🎯
Mechanical exit management

A fixed stop sits 1% below the flag low. Touching the measured-move target arms a trailing stop (with a breakeven floor); the session cutoff forces any open position flat — 09:28 for A, 15:55 for B.

🔁
Daily session reset at 04:00 ET

A background loop clears the scanner history, re-anchors each ticker's session baselines, and zeroes per-symbol trade counts and cumulative P&L — so the system starts each morning fresh without any intervention.

Built-in Guardrails

Full autonomy doesn't mean no safety net. AutoTrader enforces hard risk limits at every layer so the system can run unattended without blowing up your account.

Consecutive-Loss Breaker Auto-halt

After a configurable run of losing trades in a row (default 3), new entries are suspended for the rest of the session — so a bad morning can't compound.

Daily Trade Cap Per personality

Each personality has its own maximum trades per day — 5 for premarket (A), 7 for regular hours (B) — plus a cap on concurrent open positions.

Forced-Flat Cutoff Per session

No position is ever carried past its window. A flattens everything at 09:28 ET, B at 15:55 — bypassing the normal stop/target to guarantee a flat book.

Compound Switch Guard Per position

In compound mode the system only abandons a held position for a new one when the candidate's reward:risk beats it by 1.15× — preventing churn between marginally different setups.

Connection Watchdog Auto-reconnect

IBKR disconnects and news WebSocket drops are detected instantly. The watchdog reconnects automatically and resumes scanning — no manual restart needed.

Live Automation Status

The main window shows every decision the system makes in real time — so you can monitor without intervening.

AutoTrader — Automation Active  ●  Session P&L: +$214.30 (+21.4%)
Time P Ticker Activity Log R:R Status
08:31 A AIXI flag_breakout: impulse +9.4%, flag 4 bars / 6.1% range, breakout vol 1.3× 1.8 ✓ BOUGHT @ $2.14
08:35 A AIXI Measured-move target hit — trailing stop armed (1% below highs) ⏳ HOLDING +28%
08:37 A AIXI Trailing stop hit — position closed SOLD @ $3.06 +43.0%
08:42 A SOAR flag forming — range 9.1% > 8% cap; re-checking each bar 0.4 ⏱ WAIT
08:44 A LABX Breakout vol 0.8× < 1.0× gate — entry rejected ✗ Skipped — volume too low

Trade Momentum by the Rules
— Premarket and Intraday

AutoTrader runs on your machine against your own IBKR account. flag_breakout is the validated default; every gate, window, and risk limit is yours to configure.

✓ Python 3.13.2 ✓ IB Gateway / TWS ✓ flag_breakout · Personalities A & B ✓ Bar-for-bar backtest replay ✓ AI-assisted analytics