Skip to content

Commit 696644d

Browse files
authored
Variable 1-10 splits, any-symbol support, MCP server, tests + Python CI (#2)
tp_levels accepts 1-10 levels with optional validated volume_split (legacy 5-level behavior preserved via the default 60/10/10/10/10). Any-symbol support: volumes snap to broker lot step, prices normalize to symbol digits. New MCP server (FastMCP stdio) wrapping the REST bridge with trading tools gated behind MT5_MCP_ENABLE_TRADING. 12 pytest cases + ci-python.yml workflow. Fixes a latent liveness bug where pending orders were treated as closed positions, self-destructing group tracking one tick after placement (trailing/safe-shutdown silently dead for unfilled groups). Adds docs/ROADMAP.md. Verified: MetaEditor 0/0, 12/12 tests, MCP imports both modes.
1 parent 4576a8d commit 696644d

11 files changed

Lines changed: 1247 additions & 106 deletions

File tree

‎.github/workflows/ci-python.yml‎

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Python tests
2+
3+
# Unit-tests the FastAPI/TCP bridge (server.py) and the MCP wrapper with pytest
4+
# so a change that breaks the API contract, request routing, timeout/abandon
5+
# handling, or validation can't be merged. The MQL5 EA is guarded separately by
6+
# compile-ea.yml.
7+
8+
on:
9+
push:
10+
paths:
11+
- "server.py"
12+
- "mcp_server.py"
13+
- "tests/**"
14+
- "requirements*.txt"
15+
- ".github/workflows/ci-python.yml"
16+
pull_request:
17+
paths:
18+
- "server.py"
19+
- "mcp_server.py"
20+
- "tests/**"
21+
- "requirements*.txt"
22+
- ".github/workflows/ci-python.yml"
23+
workflow_dispatch:
24+
25+
jobs:
26+
test:
27+
runs-on: ubuntu-latest
28+
timeout-minutes: 10
29+
steps:
30+
- uses: actions/checkout@v4
31+
32+
- name: Set up Python
33+
uses: actions/setup-python@v5
34+
with:
35+
python-version: "3.11"
36+
37+
- name: Install dependencies
38+
run: |
39+
python -m pip install --upgrade pip
40+
pip install -r requirements.txt -r requirements-dev.txt
41+
42+
- name: Run tests
43+
run: pytest -q

‎README.md‎

Lines changed: 187 additions & 19 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)