An interactive market-analysis and strategy-backtesting toolkit built around MetaTrader 5, completed candles, and auditable Smart Money Concepts signals.
View the portfolio case study · Usage and troubleshooting
| Workflow | Launcher | Purpose |
|---|---|---|
| Market analysis | run_analysis.bat |
Display FVGs, order blocks, liquidity, structure, sessions, and confluence on an interactive chart. |
| Strategy backtest | run_backtest.bat |
Apply a strategy file and inspect its entries, exits, stop-losses, take-profits, balance, and trade history. |
Both launchers ask for an MT5 instrument and an execution timeframe in the terminal. M15, H1, and H4 are supported, and custom broker symbol names can be entered.
Requirements:
- Windows;
- MetaTrader 5 installed, open, logged in, and connected;
- Python 3.13;
- a virtual environment named
.venv.
Install the dependencies:
.venv\Scripts\python.exe -m pip install -r requirements.txtThen double-click either run_analysis.bat or run_backtest.bat.
The analysis dashboard uses completed MT5 candles and refreshes after a newly completed candle is available. It can display:
- fair value gaps and whether they have been mitigated;
- bullish and bearish order blocks;
- buy-side and sell-side liquidity;
- liquidity sweeps;
- BOS and CHoCH structure events;
- swing structure and the active dealing range;
- previous daily and four-hour levels;
- London and New York sessions;
- retracement, confluence, and live-session panels.
In the screenshot above, green and red zones represent bullish and bearish FVGs, hatched blue and orange zones represent order blocks, dashed horizontal levels represent liquidity or reference levels, and labeled swing points explain the detected structure.
Choose the instrument, execution timeframe, and one of the retained strategy files:
| Strategy | Main idea |
|---|---|
strategies/mtf_trend_pullback.py |
Align higher-timeframe trends, then enter an execution-timeframe pullback with momentum confirmation. |
strategies/ict_liquidity_fvg.py |
Look for liquidity and fair-value-gap conditions before entering. |
strategies/confirmed_smc_pullback.py |
Require confirmed SMC structure and a valid pullback before entering. |
The report includes:
- numbered entries and exits on the same chart style as the analysis workflow;
- each trade's initial stop-loss and take-profit;
- overall win rate, balance, net P&L, profit factor, and drawdown;
- complete trade history;
- indicator values captured when each entry was taken;
- CSV export for an independent audit.
Backtests use completed candles and modeled execution costs. Historical results are simulations, not guarantees of future performance.
- Both web interfaces bind to
127.0.0.1; they are not published as internet services. - MT5 account credentials are neither requested nor stored by this repository.
- Generated candles, reports, CSV files, Plotly assets, logs, caches, and lock files stay under ignored local paths.
- Strategy files contain research rules only. Nothing in this project places a live order.
Before publishing a fork, review its Git history and never commit broker credentials, account exports, or generated market-data files.
The launchers also accept arguments for repeatable runs:
run_analysis.bat --symbol EURUSD --timeframe H1
run_backtest.bat --symbol XAUUSD --timeframe M15 --strategy strategies\ict_liquidity_fvg.pyBacktest-only options:
--use-cachereuses the latest cached candles;--no-browserdoes not open the report automatically;--oncewrites the result and exits without keeping a local service open.
gold_smc/ Shared chart, MT5, indicator, dashboard, and backtest code
strategies/ Editable strategy definitions
tests/ Automated regression tests
docs/images/ README screenshots and trading-chart examples
run_analysis.bat Market-analysis launcher
run_backtest.bat Strategy-backtest launcher
Runtime files are written to outputs/ and excluded from Git. The local Plotly
runtime is generated automatically when it is missing.
Run the regression suite with:
.venv\Scripts\python.exe -m unittest discover -s tests -vThe GitHub Actions workflow runs the same suite on Windows and Python 3.13.
metatrader5 · smart-money-concepts · algorithmic-trading · backtesting
· technical-analysis · price-action · forex · xauusd · plotly ·
python
See docs/USAGE.md for detailed usage and troubleshooting.

