Tags

Tags give the ability to mark specific points in history as being important
  • v4.4.3

    v4.4.3 — harden mt5-httpapi skill docs with destructive-op and auth guardrails
  • v4.4.2

    v4.4.2 — publish to ClawHub via clawhub-publish.yml directly
  • v4.4.1

    v4.4.1 — ClawHub skill publishing + .agents/skills layout + skill API catch-up
  • v4.4.0

    v4.4.0: terminal instances + Strategy Tester optimization (modes 1/2/3) + .set generation
    
    Lands PR #4 from algotradingspace/feat/strategy-optimizer (Marin).
    Extends the v4.3.0 tester-mode terminal with full optimization
    support, terminal cloning by instance name, and JSON-driven .set /
    .ini generation.
    
    Why this release
    ----------------
    v4.3.0 added mode: backtest terminals but only covered single-pass
    backtests with HTML reports. Optimization runs (Tester.Optimization
    in 1, 2, 3) produce different artifacts: modes 1 and 2 emit an XML
    optimization report, mode 3 ("all symbols") emits .symbols.xml plus
    a binary .opt cache that MT5 never exposes through any documented
    API. v4.4.0 adds parsers for both and a cache-shape probe so the
    parser can adapt as MT5 ships new builds without code changes
    per build.
    
    Terminal instances also land here. The instance field on a
    terminals[] entry lets the same broker/account pair appear more than
    once (different ports, different portable data dirs) so a live
    terminal can coexist with one or more backtest terminals on the
    same login -- the exact use case that motivated the mode field in
    v4.3.0.
    
    New endpoints
    -------------
      POST /backtest/build-ini
           Now accepts optimization (0..3) + optimizationCriterion (0..7)
           alongside the v4.3.0 single-pass fields.
      POST /backtest/build-set
           Emit a Strategy Tester .set file from a JSON parameter list.
           Supports both fixed values and optimization ranges (start /
           step / stop / optimize), matching MT5's native
           name=value||... format.
      POST /backtest
           New optional topPasses field (1..500) caps how many rows are
           returned in optimizationResults. Defaults to 50.
      GET  /backtest/<jobId>
           Optimization runs now populate optimizationType (0..3),
           optimizationResults (top-N sorted passes), and
           optimizationCache (metadata about the .opt cache parse:
           profile name, byte offsets, MT5 build, symbol count). All
           None for non-optimization runs.
      GET  /backtest/<jobId>/tail?lines=N
           Live log tail across the run.log (terminal64.exe stdout),
           the MT5 terminal journal, and the Strategy Tester sub-log.
           Clamped to 10..1000 lines. Works while the job is queued,
           running, or completed -- no need to wait for the report.
    
    Config additions (config.yaml, all backwards compatible)
    --------------------------------------------------------
      terminals[].instance   Optional terminal clone name. Missing /
                             empty resolves to "default" and keeps the
                             legacy /<broker>/<account>/ route alias.
                             Multiple entries on the same broker /
                             account pair need distinct instance values
                             to avoid colliding on the per-instance
                             portable data dir at
                             terminals/<broker>/<account>/<instance>/.
    
    URL routing
    -----------
    Flat /<broker>/<account>/<instance>/... everywhere, with a clean
    /<broker>/<account>/ alias when instance is omitted (the default
    case). Mode-agnostic -- live and backtest terminals share the same
    URL shape.
    
    Cache parser
    ------------
    mt5api/backtest/cache_parser.py reverse-engineers MT5's binary .opt
    cache. The parser is profile-driven: candidate byte-offset layouts
    are scored against the file and the best match wins. As MT5 ships
    new builds with shifted layouts, append a new candidate to
    OPT_CACHE_PROFILE_CANDIDATES -- no per-build code paths needed.
    Symbol regex covers broker suffixes (EURUSD.r, GER40.cash,
    Cocoa.c, #AAPL, etc.).
    
    Warmup script
    -------------
    assets/experts/MT5SystemWarmup.mq5 (committed source, 19 lines) is
    a single-purpose MQL5 script that primes a symbol's history cache
    so the first /backtest call against it does not time out.
    scripts/compile-warmup-ea.bat compiles it into MT5SystemWarmup.ex5
    via the broker's bundled MetaEditor64.exe. The compiled .ex5 stays
    gitignored.
    
    Other fixes
    -----------
    - _kill_terminal path filter now scoped to BROKER\ACCOUNT\INSTANCE\*
      so an instance restart cannot blast a sibling instance's terminal.
    - CMD window title strips the /default suffix for default-instance
      terminals.
    - numpy<2 pin from v4.3.1 retained.
    
    Commits
    -------
      5360c4d feat(config): add terminal instance settings
      70f2aa3 feat(backtest): add optimization set parsing
      5dbe1a6 Add proper MT5 mode 3 optimization support
      63108df fix(backtest): relax symbol regex to handle broker
              suffixes in opt cache
      74070aa feat(backtest): add GET /backtest/<jobId>/tail for live
              log polling
      45f9412 fix skill (SKILL.md hardening for ClawHub SkillSpector)
      1c2767f Merge pull request #4
  • v4.3.1

    v4.3.1 -- critical trade-path fix + integration test suite
    
    Fixes silent breakage of order_send / order_check in v4.3.0. The
    MetaTrader5 wheel (5.0.5735) requires **kwargs unpacking for these
    calls; positional dict fails immediately with the misleading
      (-2, 'Unnamed arguments not allowed')
    before any terminal IPC. Read-only SDK calls were unaffected, hiding
    the regression. Fix is mechanical -- m(mt5.order_send, req) ->
    m(mt5.order_send, **req) at the five trade-path call sites in
    mt5api/handlers/{orders,positions}.py.
    
    Adds tests/real/ -- a 35-test live-API pytest suite tagged by magic
    number so it can run against a live demo account without touching
    positions/orders that aren't its own. This class of regression now
    surfaces at test time instead of in production.
    
    Also: update_order TradeOrder.expiration -> time_expiration (PUT
    /orders/<ticket> 500 -> 200), first-tick race retry on freshly
    auto-selected symbols, auto-reboot on pip changes during boot, and a
    defensive numpy<2 pin in the install scripts.
    
    Fully backwards-compatible patch. No new endpoints, no config changes.
  • v4.3.0

    v4.3.0: MT5 Strategy Tester HTTP API + per-terminal live/backtest mode
    
    Lands PR #2 from algotradingspace/backtester (Marin). The headline feature
    is a tester-mode terminal that runs alongside live trading terminals on the
    same Docker / Windows VM deployment, behind the same /<broker>/<account>/...
    nginx routing.
    
    Why mode exists
    ---------------
    MT5 is single-instance per portable data directory. A running terminal64.exe
    holds an exclusive lock on its dir; any second terminal64.exe spawned against
    the same dir exits silently with code 0. That makes it impossible to drive
    the Strategy Tester through a terminal that's also backing the live SDK.
    
    Mode declares intent at terminal-startup time:
      - mode: live (default) -- terminal64.exe stays running, SDK is initialized,
        all live trading + market data endpoints work as before.
      - mode: backtest -- portable dir is prepared but terminal64.exe is NOT
        launched and the MT5 SDK is NOT initialized; the data dir stays free for
        the tester subprocess that POST /backtest spawns on demand.
    
    A single install can run both modes side by side.
    
    New endpoints
    -------------
      POST /backtest/build-ini       -- stateless JSON -> tester.ini helper
      POST /backtest                 -- multipart submit (ini + ex5 + set), 202
      GET  /backtest/<job_id>        -- queued/running/completed/failed + summary
      GET  /backtest/<job_id>/report -- the MT5 HTML report
      GET  /backtest/<job_id>/log    -- captured terminal log for the run
      GET  /ping                     -- now echoes {"status":"ok","mode":"..."}
    
    Tester INI is re-encoded UTF-16-LE+BOM+CRLF before MT5 reads it (MT5
    silently rejects [Tester] Login under UTF-8). [Common].Login/Password/Server
    are always overwritten from the URL-selected account in config.yaml -- the
    caller cannot inject credentials. EA/.set inputs accept either inline upload
    or a host-managed name resolved against ./assets/{experts,sets}/ mounted
    read-only into the VM (path traversal in *_name is rejected).
    
    Concurrency: one tester per API process, serialized by an internal RUN_LOCK;
    additional submissions queue. Jobs left in-flight when the API restarts are
    marked failed by sweep_orphans() at next boot.
    
    Configurable backtest timeout
    -----------------------------
    Default 6h. Override chain (highest priority first):
      1. POST /backtest form field 'timeout' (e.g. "30m", "3h30m")
      2. config.yaml backtest_timeout
      3. BACKTEST_TIMEOUT env var
      4. hardcoded DEFAULT_BACKTEST_TIMEOUT="6h"
    Parsing reuses parse_duration_to_seconds (same grammar as utc_offset).
    
    Other runtime hardening (also in PR #2)
    ---------------------------------------
    - Per-terminal symbol_suffix: optional broker-specific suffix appended to
      [Tester].Symbol when missing (e.g. ".r" for RoboForex, "p" for FTMO).
      Lets the same EA/.set/.ini run against multiple terminals without
      hand-editing the symbol per broker.
    - reboot_interval=0 is now respected at startup so long backtest runs are
      not interrupted by the scheduled auto-reboot.
    - nginx generated config: client_max_body_size 25m + client_body_timeout
      120s so EA + .set uploads up to ~25MB succeed.
    - Parsed report summary now includes bars/ticks/symbols so empty-history
      failures are visible in the JSON response without opening the HTML.
    - psutil added to the base pip install (was already imported by
      mt5api/mt5client.py but missing from the install list).
    
    Compatibility
    -------------
    Fully additive. mode defaults to "live"; existing config files keep working
    verbatim. Live terminal API surface is unchanged. Multi-terminal routing,
    Docker/VM deployment, and the v4 single-file config model are unchanged.
    Host-managed asset pool is opt-in (use inline upload to skip the mount).
    
    Tests
    -----
    121 pytest cases pass, +28 new covering the backtest handler, INI builder,
    and job lifecycle. End-to-end tester run validated against a real Darwinex
    demo terminal (job completed in 114.5s, 276KB report, parsed summary
    netProfit=129.89, profitFactor=1.34, totalTrades=123).
    
    Also in this release
    --------------------
    CHANGELOG.md introduced as the readable digest of every annotated git tag
    in the project's history (v1.0.0 -> v4.3.0). Tags remain the canonical
    source of truth; CHANGELOG.md links each entry back to its tag.
    
    Files (PR #2 already on origin/master; CHANGELOG.md added in this tag's commit):
      CHANGELOG.md                        (new in this commit)
      mt5api/backtest/__init__.py
      mt5api/backtest/handler.py
      mt5api/backtest/ini_builder.py
      mt5api/backtest/jobs.py
      mt5api/config.py
      mt5api/handlers/terminal.py
      mt5api/main.py
      mt5api/server.py
      scripts/api_runner.bat
      scripts/config_helper.py
      scripts/start.bat
      run.sh
      .dockerignore .gitignore
      config/config.yaml.example docker-compose.yml.example
      assets/experts/.gitkeep assets/sets/.gitkeep
      README.md .agents/.skills/mt5-httpapi/{SKILL.md,references/setup.md}
      tests/test_backtest_handler.py
      tests/test_backtest_ini_builder.py
      tests/test_backtest_jobs.py
  • v4.2.2

    v4.2.2: sync docs + example compose to wickworks v0.3.x
    
    Wickworks v0.3.0 went primitives-only (removed divergences + the
    signals/ package); v0.3.1 made camelCase canonical and tightened
    Bar volume validation. mt5-httpapi docs and the example compose
    pin were still on the old surface.
    
    - README intro + TA section drop divergences, add primitives-only
      disclaimer; rates/ta body table shows the flat indicators shape
      and marks recentBars inert in wickworks v0.3.x.
    - SKILL.md frontmatter + intro + bbands example + full indicator
      catalog rewritten to match wickworks v0.3.x reality (real
      registry names, 8 trader-meaningful categories, divergence row
      removed, missing alt-MAs added).
    - docker-compose.yml.example pin bumped v0.2.0 -> v0.3.1 so a
      fresh install no longer ships the pre-purification image.
    - Go client RatesTAQuery doc comment fixed (flat indicator shape;
      RecentBars marked inert). No signature change.
    
    No mt5-httpapi runtime code changed.
  • v4.2.1

    v4.2.1: surface TA capability in docs + README ToC
    
    - README intro now leads with the built-in TA capability and
      links to the dedicated section
    - README gets a Table of Contents
    - SKILL.md frontmatter + intro elevate TA; new Technical Analysis
      section replaces the curl example previously buried under Symbols
    - Both docs link to github.com/psyb0t/docker-wickworks for the
      indicator catalog
    
    No code changes.
  • v4.2.0

    v4.2.0: Go client GetRatesTA
    
    - New Client.GetRatesTA(ctx, symbol, RatesTAQuery{Indicators, ...})
      matching POST /symbols/<symbol>/rates/ta from v4.1.0
    - New RatesTAQuery + RatesTAResponse types
    - README method table updated
  • v4.1.0

    v4.1.0: wickworks TA sidecar + POST /symbols/<symbol>/rates/ta
    
    - New POST /symbols/<symbol>/rates/ta combines OHLC + wickworks TA
    - New wickworks sidecar (psyb0t/wickworks:v0.2.0), netns-shared with
      mt5, no published ports, VM-reachable via 20.20.20.1:8000
    - config.yaml gains optional wickworks: { url, timeout }
    - Backwards compatible -- existing endpoints unchanged
    - Manual step on upgrade: copy wickworks: service block from
      docker-compose.yml.example into your docker-compose.yml
  • v4.0.1

    8ce9baef · fixes ·
    v4.0.1 -- post-v4.0.0 fixes
    
    - install.bat: skip install loop when every broker already has its
      base/terminal64.exe. Without this guard, v4.0.0's loop set
      NEEDS_REBOOT=1 once per boot (root cause unclear -- install_one's
      skip path logs "already installed" but :wait_done still fires),
      triggering an infinite reboot loop. Genuine first-installs still
      enter the loop because any missing terminal64.exe forces
      ALL_INSTALLED=0.
    - start.bat: switched API_TOKEN load from `for /f` over the helper
      to a tempfile read. The for/f form was occasionally returning
      empty (python crash / pyyaml fallback install / stdout buffering
      through the cmd subshell). Tempfile path is robust.
    - run.sh: added SKIP_KVM_CHECK env escape hatch for hosts that
      proxy KVM differently (CI, nested virt setups).
    - config_helper.py + run.sh: new `port_list` subcommand that prints
      individual ports space-separated. The existing `ports` subcommand
      collapses to a min-max range for the docker-compose port mapping;
      run.sh's per-port iteration needs the explicit list.
  • v4.0.0

    v4.0.0 -- single config.yaml + pinned docker images
    
    BREAKING: config/config.yaml replaces accounts.json, terminals.json,
    api_token.txt, ts_authkey.txt, ts_login_server.txt, reboot_interval.txt,
    requirements.txt. Migrate from config/config.yaml.example.
    
    Also pins all docker images to specific versions (dockurr/windows:5.14,
    nginx:1.30.0-alpine3.23, cloudflare/cloudflared:2026.3.0,
    tailscale/tailscale:v1.96.5, python:3.12-slim-bookworm) in response to
    the Trivy/KICS supply-chain incidents on Docker Hub.
  • v3.2.0

    daily log rotation sidecar with 7-day retention
  • v3.1.2

    tee Windows events into full.log alongside windows-events.log
  • v3.1.1

    Windows event log tailer for OOM / crash / BSOD visibility from outside the VM
  • v3.1.0

    per-request MT5 lock + per-call SDK timeouts + queue-depth backpressure (fixes wedge-induced connection-refused)
  • v3.0.3

    tailscale sidecar TUN mode (TS_USERSPACE=false), accurate inbound-vs-outbound isolation docs
  • v3.0.2

    wire tailscale serve via CLI (FQDN-aware), drop static serve.json — fixes headscale + bare-host dispatch
  • v3.0.1

    fix tailscale serve.json (TCP[80].HTTP=true), Cloudflare Tunnel docs
  • v3.0.0

    nginx always-on single entry point, /<broker>/<account>/ URL prefix, tailscale own-netns ACL isolation (BREAKING)