AI Expert Advisor
  • MQL5 79.6%
  • Python 7.8%
  • HTML 6.2%
  • C 3.4%
  • C++ 2.8%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
AnimateDread bfc1da9de1 fix: the sequence models were reading the window backwards
BuildFeatureWindow() replaces eight hand-rolled copies of the same loop
and feeds the window OLDEST BAR FIRST. Every copy fed it newest-first,
because MQL5 timeseries indices run backwards and `r + b` with b ascending
walks into the past.

Harmless for PAI and CONV - a dense layer learns a weight per position
either way, a conv learns time-mirrored kernels. Not harmless for the
recurrent stacks:

  - LSTM_SeqStepForward reads `inputs + t*Iw`, so step t is block t.
  - It writes output[] only when t == steps-1: the visible output IS the
    last hidden state.
  - c_t = f*c_{t-1} + i*g decays toward the start of the sequence.
    lstm_seq_flowcheck.cpp measured block 0's influence on the output at
    1.2e-2 of block T-1's, at the shipped forget bias of 1.0.

So the bar being PREDICTED sat at the far end of the decay and the output
was handed to the OLDEST bar in the window - the exact inverse of what the
window is for. ~80x backwards on LSTM and HYBRID, on all three tiers
(OpenCL kernel, CPU DLL, pure-MQL5 inference), which is why it never
surfaced as a backend discrepancy.

This does not create edge - the MI diagnostics read at the noise floor
(p=0.4975) with a working positive control. It makes the one hypothesis
those diagnostics explicitly do NOT cover testable: they are marginal and
per-bar, and state they "cannot rule out one that only exists in
combination or across time". The sequence model is the instrument for
across-time structure and it has been crippled, so that hypothesis has
never been honestly tested.

Fingerprint gets an unconditional |WIN:2 - the vector keeps its shape and
its features, so a stale .nnw would load cleanly and run a model fitted to
one ordering against the other, silently. Re-keying every config is the
point, not collateral damage. FORCES A FULL RETRAIN.

Also: the now-relative bar caches are re-keyed on the two live paths.
EnsureBarCachesCapacity() was only ever called from training paths, but
once m_trainingComplete is set ScheduleTrainingIfNeeded() routes every bar
to RefreshConvergedSignal() and Train() is never re-entered - so nothing
cleared the feature cache again for the life of the process. A chart that
trained to convergence kept replaying the rows computed for the last
training era's bar grid: the live signal froze at its convergence-time
value, and OnlineLearnStep() backpropped those stale features against
freshly resolved labels. Backtests were never affected (an inference-only
process never allocates the arrays, so every read recomputes).

Compiles clean: 0 errors, 0 warnings.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-07 18:28:44 -04:00
.claude . 2026-07-18 17:43:29 -04:00
.clinerules feat: suppress noisy performance warnings unless VerboseMode 2026-07-27 10:58:29 -04:00
AI Add new research scripts for trading strategy analysis 2026-08-02 12:25:20 -04:00
Database feat: expectancy stop - halt when the measured result says the strategy loses 2026-08-07 14:20:00 -04:00
DirectML fix: improve error messages and suppress false sharing-violation logs 2026-08-02 01:09:18 -04:00
Enumerations Add new research scripts for trading strategy analysis 2026-08-02 12:25:20 -04:00
Expert fix: the sequence models were reading the window backwards 2026-08-07 18:28:44 -04:00
Market Descriptions Add new research scripts for trading strategy analysis 2026-08-02 12:25:20 -04:00
Marketing/Logo refactor(AI): clean up comments and add conditional compilation guards 2026-07-22 17:17:23 -04:00
Money Add new research scripts for trading strategy analysis 2026-08-02 12:25:20 -04:00
Panel fix: add error logging for buffer failures and reject trades on invalid stop loss 2026-07-26 12:12:14 -04:00
references feat: add SGD+momentum optimizer and input-driven hyperparameters 2026-07-18 14:56:41 -04:00
research Add new research scripts for trading strategy analysis 2026-08-02 12:25:20 -04:00
Scripts fix(research): calendar recorder - separate LIVE from BACKFILL, fix seen-set key 2026-08-01 20:22:12 -04:00
Signals Add new research scripts for trading strategy analysis 2026-08-02 12:25:20 -04:00
Structures feat: Enhance README and documentation for Warrior_EA project 2026-04-20 19:28:34 -04:00
System feat(ai): cross-asset currency strength - the first feature not derived from one price series 2026-08-01 17:16:13 -04:00
Trailing feat(trade): implement trade safety checks per Article 2555 and resource limits 2026-07-26 23:08:32 -04:00
Variables feat: expectancy stop - halt when the measured result says the strategy loses 2026-08-07 14:20:00 -04:00
.gitignore chore: keep the reference PDFs out of the repository 2026-08-01 22:18:18 -04:00
AI_NETWORK.md refactor(ai): extract Layer.mqh and deduplicate AI config 2026-08-01 11:27:28 -04:00
cpu_directml.log feat(opencl): add feedback alignment support to weight update kernels 2026-07-28 15:01:40 -04:00
DATABASE.md feat: add max-pooling and convolution OpenCL kernels, clean up barrier and signal code 2026-07-13 03:23:39 -04:00
EXPERIMENTS.md feat: make batch normalization mandatory, and record the run-3 results 2026-07-30 08:51:10 -04:00
opencl.log feat(opencl): add feedback alignment support to weight update kernels 2026-07-28 15:01:40 -04:00
profiling.csv fix: handle legacy neuron classes in BlendWeightsFrom to avoid UB 2026-07-26 14:45:08 -04:00
README.md feat: Enhance README and documentation for Warrior_EA project 2026-04-20 19:28:34 -04:00
REFACTOR_NOTES.md refactor(ai): extract Layer.mqh and deduplicate AI config 2026-08-01 11:27:28 -04:00
SIGNALS.md feat(signals): add MACD/Ichimoku presets and Vote_Close disabled option 2026-07-26 18:33:12 -04:00
Warrior_EA.md feat: Enhance README and documentation for Warrior_EA project 2026-04-20 19:28:34 -04:00
Warrior_EA.mq5 feat: expectancy stop - halt when the measured result says the strategy loses 2026-08-07 14:20:00 -04:00
Warrior_EA.mqproj Add new research scripts for trading strategy analysis 2026-08-02 12:25:20 -04:00
Warrior_EA_System_Overview.md refactor(ai): extract Layer.mqh and deduplicate AI config 2026-08-01 11:27:28 -04:00

Warrior_EA Project Overview

Description

Warrior_EA is a modular, AI/ML-ready MetaTrader 5 Expert Advisor designed for robust, production-grade trading. It integrates traditional and AI-driven signals, advanced money management, trailing stops, and a database/statistics subsystem for adaptive optimization.

Key Features

  • AI/ML Integration: LSTM, PAI, and CONV neural network signals, with configurable feature pipelines and training options.
  • Traditional Signals: Modular support for classic indicators (MA, MACD, RSI, etc.) and price action patterns.
  • Money Management: Fixed lot, fixed risk, and intelligent/adaptive strategies.
  • Trailing Stops: ATR-based, MA-based, Parabolic SAR, and more.
  • Database/Statistics: Tracks trades, signals, and performance for optimization and research.
  • Configurable Inputs: All major features and strategies are user-configurable via Inputs.mqh.
  • Robust Initialization: Retry logic and error handling for all critical subsystems.
  • Production-Ready: Designed for institutional and advanced retail use, with a focus on maintainability and extensibility.

Directory Structure

  • AI/: Neural network and ML logic
  • Database/: Database and statistics management
  • Enumerations/: Enum and type definitions
  • Expert/: Main EA orchestration and custom logic
  • Money/: Money management strategies
  • Signals/: Signal generation (AI and traditional)
  • Structures/: Data structures for signals and trades
  • System/: Utility and infrastructure modules
  • Trailing/: Trailing stop strategies
  • Variables/: Global input parameters and runtime variables

Getting Started

  1. Configure your desired strategies and features in Variables/Inputs.mqh.
  2. Compile Warrior_EA.mq5 in MetaEditor.
  3. Attach to a chart and enable Algo Trading.
  4. Monitor logs and database/statistics for performance and optimization.

Modernization & AI/ML Roadmap

  • Migrate all hard-coded signals to a configurable, feature-driven pipeline.
  • Expand AI/ML subsystem with new models and training options.
  • Enhance database/statistics for deeper analytics and automated optimization.
  • Introduce unit and integration tests for all modules.

Documented April 2026. For subsystem details, see each directory's README.md and AI_NETWORK.md.