mirror of
https://github.com/FXDavid-OffbeatForex/MBT.git
synced 2026-11-02 03:56:12 +00:00
Polish MBT repository landing page
This commit is contained in:
@@ -1,34 +1,25 @@
|
||||
# MBT — MT5 Backtest Toolkit (MCP Server)
|
||||
# MBT — MT5 Backtest Toolkit
|
||||
|
||||
```
|
||||
███╗ ███╗██████╗ ████████╗
|
||||
████╗ ████║██╔══██╗╚══██╔══╝
|
||||
██╔████╔██║██████╔╝ ██║
|
||||
██║╚██╔╝██║██╔══██╗ ██║
|
||||
██║ ╚═╝ ██║██████╔╝ ██║
|
||||
╚═╝ ╚═╝╚═════╝ ╚═╝
|
||||
MT5 Backtest Toolkit · replay real signals on real bars
|
||||
╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴
|
||||
```
|
||||
<p align="center">
|
||||
<img src="docs/assets/mbt-overview.svg" alt="MBT: indicator-signal replay and native MT5 Expert Advisor testing, with evidence reports" width="100%">
|
||||
</p>
|
||||
|
||||
**Backtest, build, optimize and inspect MetaTrader 5 strategies through an AI assistant — real indicator signals and native MT5 EA tests, with readable evidence reports.**
|
||||
An **MCP server for researching MetaTrader 5 strategies with an AI assistant**.
|
||||
MBT connects your assistant to MT5 price data and tester results, then turns
|
||||
recorded evidence into reports you can inspect.
|
||||
|
||||
**Requirements:** Python 3.10+ · MetaTrader 5 · an MCP-compatible AI client (the examples use Claude Code)
|
||||
**Python 3.10+** · **MetaTrader 5** · **MCP-compatible AI client** · [MIT license](LICENSE)
|
||||
|
||||
For indicators, add the logging include below. For native EA testing, use an installed Expert Advisor. Through the AI client you can:
|
||||
[Get started](#install) · [Choose a workflow](#how-it-works) · [Explore the reports](#what-the-report-contains) · [Browse MCP tools](#tools-mcp) · [Compare with MT5](#mt5-directly-versus-mbt--an-ai-assistant)
|
||||
|
||||
- **Backtest your indicator's real signals** — replayed on real broker bars, with an HTML report.
|
||||
- **Run your indicator headlessly** — MT5 executes it over a selected date range and logs its signals, subject to available price history.
|
||||
- **Build, test & verify an Expert Advisor** — compile it, run MT5's native Strategy Tester, and compare logged signals for strategy drift.
|
||||
- **Inspect and fine-tune EA inputs** — compare exposed methods, periods and other settings using MT5's complete or genetic optimizer.
|
||||
- **Check frozen candidates on later dates** — retain the in-sample winner and compare detailed in-sample/out-of-sample reports.
|
||||
- **Inspect saved EA trades on an MT5 chart** — ask your assistant to open the recorded deals, or use a button in the report.
|
||||
- **Explore trade-order and sample risk** — run limited Monte Carlo diagnostics from verified closed trades, with balance, drawdown and profit charts.
|
||||
| Indicator signals | Expert Advisors |
|
||||
| --- | --- |
|
||||
| Run an instrumented indicator in MT5, then replay **its logged signals** against broker price bars. | Compile and single-test an EA in MT5, inspect inputs, and run bounded complete or genetic optimization. |
|
||||
| Inspect entries, exits and ambiguous bars in an HTML report. | Freeze candidates, check later dates, inspect trades on a chart, and optionally resample verified closed trades. |
|
||||
|
||||
The core principle: **MBT never recalculates your indicator in Python.** Your
|
||||
indicator logs the signals *it* generated; MBT reads those real signals and
|
||||
replays real broker price bars forward to see whether each trade hit its stop
|
||||
or its target. The replay uses your indicator's logged signals rather than a Python reimplementation.
|
||||
These are different test paths: indicator replay does **not** optimize indicator
|
||||
inputs or execute an EA. EA optimization uses MT5's native tester; MBT does not
|
||||
replace it. Neither path proves future profitability.
|
||||
|
||||
---
|
||||
|
||||
@@ -48,29 +39,15 @@ the configured rule for bars that touch both stop and target.
|
||||
|
||||
## How it works
|
||||
|
||||
```
|
||||
Your MT5 indicator MBT (this toolkit)
|
||||
┌──────────────────┐ ┌────────────────────────────┐
|
||||
│ #include │ writes │ reads signals.csv │
|
||||
│ <SignalLogger> ├─ signals.csv ┤ │
|
||||
│ LogSignal(...) │ │ replays real MT5 bars │
|
||||
└──────────────────┘ │ forward → WIN / LOSS / OPEN │
|
||||
│ │
|
||||
│ tools for AI assistants: │
|
||||
│ get_ohlcv │
|
||||
│ get_signals │
|
||||
│ run_indicator (headless) │
|
||||
│ backtest (+ HTML report) │
|
||||
│ validate_signals │
|
||||
└────────────────────────────┘
|
||||
```
|
||||
**For indicator signals:** add `SignalLogger.mqh`, let the indicator write
|
||||
`signals.csv`, then ask MBT to replay those entries against MT5 bars. MBT reports
|
||||
whether the logged stop or target was reached under the chosen bar rules.
|
||||
|
||||
That's the indicator-backtest loop above. MBT also drives MT5's own toolchain to
|
||||
**build, test and verify an Expert Advisor** (`compile_ea`, `run_strategy_tester`,
|
||||
`signal_parity`) and orchestrates native optimization. These are distinct paths:
|
||||
indicator replay does not optimize indicator inputs or execute an EA. EA optimization
|
||||
executes the real EA in MT5; Monte Carlo resamples its saved trade history without
|
||||
executing the EA again. See [Use it](#use-it) for each workflow.
|
||||
**For Expert Advisors:** MBT asks MT5 to compile or test the actual EA. It can
|
||||
orchestrate native input optimization, freeze an in-sample selection, and run
|
||||
separate later-period checks. Limited Monte Carlo uses verified saved trades;
|
||||
it does not rerun the EA or model its future signals. See [Use it](#use-it)
|
||||
for the individual workflows.
|
||||
|
||||
---
|
||||
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="1200" height="320" viewBox="0 0 1200 320" role="img" aria-labelledby="title desc">
|
||||
<title id="title">MBT — MT5 Backtest Toolkit</title>
|
||||
<desc id="desc">Indicator signals flow to price-bar replay; Expert Advisor inputs flow to the native MT5 tester. Both workflows produce evidence reports.</desc>
|
||||
<defs>
|
||||
<linearGradient id="background" x2="1" y2="1"><stop stop-color="#0B1324"/><stop offset="1" stop-color="#132843"/></linearGradient>
|
||||
<linearGradient id="accent" x2="1" y2="0"><stop stop-color="#48D8C1"/><stop offset="1" stop-color="#72A6FF"/></linearGradient>
|
||||
</defs>
|
||||
<rect width="1200" height="320" rx="24" fill="url(#background)"/>
|
||||
<path d="M0 264H1200M0 184H1200M0 104H1200M80 0V320M160 0V320M240 0V320M320 0V320M400 0V320M480 0V320M560 0V320M640 0V320M720 0V320M800 0V320M880 0V320M960 0V320M1040 0V320M1120 0V320" stroke="#D5E6FF" stroke-opacity=".055"/>
|
||||
<rect x="42" y="38" width="72" height="72" rx="17" fill="#203955" stroke="#4D789B"/>
|
||||
<path d="M57 86V61L78 83L99 61V86" fill="none" stroke="url(#accent)" stroke-width="6" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
<text x="133" y="91" fill="#F5FAFF" font-family="Segoe UI, Arial, sans-serif" font-size="59" font-weight="750" letter-spacing="-2">MBT</text>
|
||||
<text x="44" y="159" fill="#A7C3DC" font-family="Segoe UI, Arial, sans-serif" font-size="19" font-weight="600" letter-spacing="2.5">MT5 BACKTEST TOOLKIT</text>
|
||||
<text x="44" y="207" fill="#F4F8FF" font-family="Segoe UI, Arial, sans-serif" font-size="27" font-weight="600">From a trading idea to inspectable evidence.</text>
|
||||
<text x="44" y="248" fill="#A7C3DC" font-family="Segoe UI, Arial, sans-serif" font-size="17">Local-first research through an AI assistant.</text>
|
||||
<rect x="615" y="35" width="545" height="250" rx="19" fill="#102239" stroke="#41617F"/>
|
||||
<text x="642" y="73" fill="#91ABC5" font-family="Segoe UI, Arial, sans-serif" font-size="13" font-weight="700" letter-spacing="2">TWO TEST PATHS</text>
|
||||
<rect x="640" y="93" width="493" height="65" rx="12" fill="#16364A"/>
|
||||
<rect x="640" y="174" width="493" height="65" rx="12" fill="#20304C"/>
|
||||
<circle cx="663" cy="125" r="6" fill="#48D8C1"/><circle cx="663" cy="206" r="6" fill="#72A6FF"/>
|
||||
<text x="680" y="130" fill="#ECFAF8" font-family="Segoe UI, Arial, sans-serif" font-size="16" font-weight="600">Indicator signals</text>
|
||||
<text x="831" y="130" fill="#7FB5AD" font-family="Segoe UI, Arial, sans-serif" font-size="16">→</text>
|
||||
<text x="855" y="130" fill="#ECFAF8" font-family="Segoe UI, Arial, sans-serif" font-size="16">Bar replay</text>
|
||||
<text x="680" y="211" fill="#EEF4FF" font-family="Segoe UI, Arial, sans-serif" font-size="16" font-weight="600">EA inputs</text>
|
||||
<text x="831" y="211" fill="#91A9D9" font-family="Segoe UI, Arial, sans-serif" font-size="16">→</text>
|
||||
<text x="855" y="211" fill="#EEF4FF" font-family="Segoe UI, Arial, sans-serif" font-size="16">MT5 tester</text>
|
||||
<rect x="1031" y="104" width="87" height="43" rx="9" fill="#254C57" stroke="#4D827D"/>
|
||||
<rect x="1031" y="185" width="87" height="43" rx="9" fill="#334669" stroke="#6176A7"/>
|
||||
<text x="1045" y="131" fill="#C9F9EB" font-family="Segoe UI, Arial, sans-serif" font-size="12" font-weight="700">REPORT</text>
|
||||
<text x="1045" y="212" fill="#DBE7FF" font-family="Segoe UI, Arial, sans-serif" font-size="12" font-weight="700">REPORT</text>
|
||||
<text x="643" y="266" fill="#8CA9C4" font-family="Segoe UI, Arial, sans-serif" font-size="13">Real inputs · saved results · explicit limits</text>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 3.5 KiB |
Reference in New Issue
Block a user