Skip to content

APEX

APEX turns Claude Opus 4.7 into an autonomous trading-strategy optimizer for MetaTrader 5.

Core trick

Seeds parameter space with Latin-hypercube sampling, then has an LLM return bounds-checked parameter changes from each backtest result.

Tags

Description

APEX turns Claude Opus 4.7 into an autonomous trading-strategy optimizer for MetaTrader 5. Most strategy optimizers are brute-force grid searches: pick a metric, sweep N parameters, pray. The user gets a winning configuration but no idea why it won, no confidence in whether it'll generalize, and no transparency into the search process. As a forex trader, I lived this pain running backtests, screenshotting results into AI chats to ask "what does this mean?", tweaking one parameter, and repeating for hours. APEX replaces the grid with an AI loop. Claude Opus 4.7 reads each backtest result, looks at the full iteration history, considers the parameter schema and quality targets, and returns structured JSON with concrete bounds-checked parameter values, per-change reasoning, a confidence score, and a goal-status breakdown. Every change, every reason, and every Claude token streams live to a dashboard so the user watches the AI think. The pipeline runs three phases: (1) Latin-Hypercube exploration to map profitable parameter regions, (2) autonomous AI iteration toward user-set quality targets (PF / drawdown / Calmar) with stuck-detection and random-escape, (3) out-of-sample + sensitivity validation → verdict (RECOMMENDED / RISKY / NOT_RELIABLE). The point isn't a better trading strategy, it's a working pattern for AI-as-driver of a long-running optimization loop, with reasoning fully visible. That pattern transfers to ML hyperparameter tuning, A/B variant generation, ad-creative optimization, and infrastructure cost tuning.
tonnylegacy/Apex_AI_MT5_EA_Optimizer★ 10 forksPythonMITCreated Apr 13, 2026 · last push Apr 26, 2026

README excerpt

# APEX — AI‑Powered MT5 EA Optimizer

[![Built with Claude Opus 4.7](https://img.shields.io/badge/Built%20with-Claude%20Opus%204.7-7c3aed?style=flat-square)](https://www.anthropic.com/news/claude-opus-4-7) [![License: MIT](https://img.shields.io/badge/License-MIT-10b981?style=flat-square)](LICENSE) [![Demo Mode](https://img.shields.io/badge/Demo-No%20MT5%20required-00d4aa?style=flat-square)](demo/run_demo.py)

> **An AI trader thinking out loud while it tests, fails, and improves a strategy.**

> Built with **[Claude Opus 4.7](https://www.anthropic.com/news/claude-opus-4-7)** for the [Cerebral Valley × Anthropic — Built with Opus 4.7 hackathon](https://cerebralvalley.ai/e/built-with-4-7-hackathon).

APEX is an autonomous optimizer for MetaTrader 5 Expert Advisors. Instead of brute‑forcing
parameters with grid search, an LLM reads each backtest result, decides which parameter to
change and why, then runs the next backtest — iterating toward profit‑factor / drawdown /
Calmar targets you set. Every reasoning step streams live to a dashboard.

---

## Why this is different

| Traditional optimizers | APEX |
| --- | --- |
| Brute‑force grid / genetic search | AI reads each result, **decides** what to change |
| Black box — see only final winner | Live **thinking feed** + per‑iteration param diffs |
| No notion of *why* a config works | Stores AI analysis next to every run |
| Stops after N iterations | Stops when **quality targets are met** (early exit) |
| One‑shot validation | O

Team