Warrior_EA/System
Repository files (latest commit first)
Filename Latest commit message Latest commit date
AnimateDread b035ea29e5 feat(ai): cross-asset currency strength - the first feature not derived from one price series
Every feature the network sees today is a function of the traded symbol's own OHLCV:
returns, ranges, oscillators, cloud distances, swing structure. Measured end to end that
whole family sits at the noise floor (research/test_classic.py, and the mutual-information
verdict before it). EURUSD moving is a statement about EUR and about USD, and which one
moved is invisible from EURUSD alone - but plainly visible if you also look at EURJPY,
GBPUSD and the rest.

System\CrossAsset.mqh builds a currency-strength panel from the FX pairs in Market Watch:
per bar, each currency's index is the average log return across every available pair
containing it, signed so "up" always means that currency strengthened. Six features - base
and quote strength at 1 and 20 bars, the DIVERGENCE between the pair and what its two
currencies separately did, and the cross-sectional dispersion of currency moves as a
regime term. The divergence is the thesis: it is the one value here that cannot be derived
from the traded series at all, being defined only relative to the rest of the market.

Built ONCE per training run against the traded symbol's bar grid, not per bar - a per-bar
cross-symbol lookup would be pairs x 178k iBarShift calls.

Correctness work, all of it driven by what MT5 actually guarantees rather than by what the
API surface suggests:

- Alignment is by TIMESTAMP, never by index. Bars do not open together across symbols, and
  in the tester each symbol gets its own generated tick sequence, so index k on GBPUSD and
  index k on USDJPY are not the same instant. Each traded bar takes the last reference bar
  at or BEFORE its timestamp - never after, which would be lookahead - and anything more
  than one bar period stale is treated as absent rather than carried forward across a
  holiday gap.
- SeriesReady() gates every pair on SymbolSelect + SymbolIsSynchronized + the PER-TIMEFRAME
  SERIES_SYNCHRONIZED. The symbol-wide and per-timeframe flags can disagree because the
  terminal builds series on separate threads, so checking only the first is not enough.
  Non-blocking by design: an unready pair is skipped and picked up on a later build.
- Failure is never fatal. Fewer than two usable pairs logs why and every Features() call
  0-fills, so a missing reference symbol costs the context block rather than the whole run.

Fingerprint: the flag goes in, the DISCOVERED REFERENCE SET does not. Which pairs exist in
Market Watch is a measured property of the terminal, exactly like the bar count the
existing comment warns about - keying the weights filename on it would orphan a trained
model the moment the user adds a symbol, silently, because a missing cache reads as a
normal first run.

Defaults ON, which re-keys existing databases on first run. That is intended: the input
vector genuinely changed shape.

Deliberately NOT built, having checked what the platform actually provides:
- swap/carry. SYMBOL_SWAP_LONG/SHORT have no history - "last values will be used for the
  whole test period" - so a backtest over 2020-2026 applies 2026 carry to 2020 bars.
- signed order flow. TICK_FLAG_BUY/SELL and volume_real are empty on Forex; any feature
  assuming trade direction would silently be all zeros.
- depth of market. Unavailable on retail FX symbols and never replayed in the tester.
- calendar actual-vs-forecast surprise. MqlCalendarValue.actual_value is the FINAL,
  post-revision figure and the calendar keeps no as-of-release snapshot, so a surprise
  feature for a 2019 bar is built from a number nobody had in 2019. Needs a live recorder,
  not a historical read.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-01 17:16:13 -04:00
..
AtomicFile.mqh fix: make sidecar writes atomic; extract shared AtomicFile helper 2026-07-29 00:31:29 -04:00
CrossAsset.mqh feat(ai): cross-asset currency strength - the first feature not derived from one price series 2026-08-01 17:16:13 -04:00
NewBar.mqh fix: add error logging for buffer failures and reject trades on invalid stop loss 2026-07-26 12:12:14 -04:00
NewsRelevance.mqh fix(SignalNewsFilter): scope calendar veto to the traded symbol's own currencies 2026-07-18 17:22:33 -04:00
PrintVerbose.mqh convert 2025-05-30 16:35:54 +02:00
README.md refactor(ai): extract Layer.mqh and deduplicate AI config 2026-08-01 11:27:28 -04:00
StatusLabel.mqh fix: correct metric label in training output and improve status panel comments 2026-07-17 21:53:09 -04:00
TradeChecks.mqh fix: correct inference-only new-bar detection and add stop validation 2026-07-27 11:51:45 -04:00

System Subsystem (System/)

Overview

The System/ directory contains utility and infrastructure code for the Warrior EA. These modules provide essential services such as new bar detection, conditional logging, crash-safe file writes and trade validation, supporting robust and maintainable EA operation.

Key Components

NewBar.mqh

  • Function: NewBar()
  • Purpose: Detects the arrival of a new bar (candle) on the chart.
  • Logic: Compares the current bar's time with the last seen bar time. Returns true if a new bar is detected.
  • Integration: Used for event-driven logic, e.g., only executing logic once per bar.

PrintVerbose.mqh

  • Function: PrintVerbose(string message)
  • Purpose: Conditional logging based on a VerboseMode flag. Prints messages only if verbose mode is enabled.
  • Integration: Useful for debugging and development without cluttering logs in production.

Documented April 2026. For further details, see the main project documentation.