05 Gold market intelligence system · 2026

Tradew.

An automated gold-market scanner that turns live MetaTrader data into rule-based setups, optionally adds bounded AI review, and revalidates every authorized plan before protected broker submission.

Role
System design · Full-stack development
Focus
Market structure · Validation · Risk control
Status
Completed system
Case / 05

Tradew / Gold overview

Responsive dashboard
Tradew desktop dashboard with mobile automation, signal intelligence and independent market-read views
One system across wide monitoring and focused mobile actionsDesktop · Mobile · Responsive
Desktop monitoringMobile controlsResponsive dashboardPhone alerts

One pipeline.
Five guarded stages.

Tradew separates market detection, authorization and broker execution. A signal can be useful without automatically becoming an order, and every stage can stop the pipeline with a visible reason.

  1. 01
    Collect

    Build a synchronized market snapshot

    The Python service reads XAU quotes, account state, open exposure and completed candles from MetaTrader 5 across M1, M5, M15, M30, H1, H4 and D1.

    MT5 → 7 timeframes
  2. 02
    Detect

    Evaluate deterministic structure

    Confirmed pivots, supply and demand zones, ATR, breakouts, retests, pullbacks, sweeps and rejection patterns are evaluated from completed candles—without using future chart information.

    Rules → candidate setup
  3. 03
    Authorize

    Apply the selected decision mode

    Deterministic mode uses the rule-based plan directly. Independent mode lets one blind LLM propose a bounded native-limit plan. Consensus requires the deterministic direction and both AI assessments to agree.

    Mode → approval or wait
  4. 04
    Revalidate

    Check the latest broker state

    Before submission, deterministic code checks snapshot freshness, account identity, gold exposure, spread, margin, stop geometry, reward/risk, broker distances, duplicate setups and automation pause state.

    Fresh checks → broker preflight
  5. 05
    Protect

    Submit, supervise and record

    Approved entries use native MT5 limits with broker-side stops, targets and expiry. TP1 and runner positions, pending-order cancellation, break-even, trailing, phone alerts and append-only audit evidence continue after submission.

    Execution → protection + audit

Automation with
an explicit authority.

The operator chooses the authorization policy from the dashboard. Switching modes changes who may originate or approve a plan; it never removes the deterministic broker and risk checks around submission.

The selected AI provider—Gemini or GPT-6 Astra High—receives a bounded, redacted market summary and has no MetaTrader tool, account identity or direct execution authority.

01 / Deterministic

Rule-based entry

An eligible setup produced by the completed-candle engine can proceed without an LLM call, subject to every account, exposure and broker preflight.

02 / Independent

Blind AI plan

One selected model creates its own BUY_LIMIT or SELL_LIMIT thesis from candles and levels. Deterministic code validates or rejects the complete plan.

03 / Consensus

Agreement required

The deterministic direction, informed review and blind independent read must agree. WAIT, WATCH or a changed plan cannot authorize submission.

Protection is part of the system—not an afterthought.

The execution controller is isolated from analysis. It accepts only a current, fully specified plan and returns a concrete submitted, rejected or not-submitted reason to the interface.

01

Exposure-aware preflight

Tradew checks all discovered gold positions and pending orders, account mode, available margin, executable quotes and broker constraints immediately before sending.

02

Native protected orders

Entries carry broker-side stop-loss, structural objective and expiration. Three ladder levels share one risk budget rather than multiplying the intended exposure.

03

TP1 and protected runner

Broker-valid volume is divided as closely as possible into a 65% TP1 child and 35% runner. The runner can trail only after TP1 has traded.

04

Controlled stop management

Automatic management can reduce risk, move to cost-adjusted break-even and trail behind confirmed M5 structure. It never widens a stop or auto-closes exposure.

05

Idempotent and auditable

Setup references, one-submission rules, SQLite state and append-only decision records prevent duplicate actions and preserve the evidence behind each outcome.

06

Pause without losing protection

Pausing blocks new AI jobs and entries while scanning, pending-order supervision, alerts and enabled protection for existing exposure continue running.

Built as separated
operational services.

The browser is the control surface. Python owns scanning and validation, MetaTrader owns market and broker interaction, and isolated adapters handle optional AI and notifications.

01React

React 19 + Vite

Continuously refreshed dashboard, settings, authorization controls, evidence panels and responsive mobile views.

02Python

Python + Flask API

Serialized scans, setup evaluation, decision contracts, execution queues, status endpoints and audit coordination.

03MT5

MetaTrader 5 bridge

Symbol discovery, seven-timeframe candles, quotes, exposure, broker calculations, pending orders and protected submission.

04SQL

SQLite + JSONL

Transactional setup state, ticket bindings and outcomes with append-only decisions, reviews and replay evidence.

05AI

Gemini + Codex CLI

Selectable, single-flight AI adapters using a strict JSON schema, redacted input and no direct execution tools.

06PUSH

Web Push + PWA

Private, deduplicated phone notifications when a clean deterministic setup first becomes BUY or SELL.

07RPL

Walk-forward replay

Production setup rules replayed over historical multi-timeframe data with modeled spread, costs, slippage and conservative fills.

08OPS

Audit archival

Rotating compressed evidence logs with optional verified remote archival and visible storage health.

The result is a working end-to-end platform for continuous scanning, explainable setup evidence, selectable authorization, broker preflight, protected execution, phone alerts, audit history and conservative replay. It is research software—not a claim of profitable trading performance.

07Monitored timeframes
03Authorization modes
02AI providers, one selected per event

Case studies / 05

Back to the
selected work.