AI Expert Advisor
- MQL5 79.6%
- Python 7.8%
- HTML 6.2%
- C 3.4%
- C++ 2.8%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
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>
|
||
| .claude | ||
| .clinerules | ||
| AI | ||
| Database | ||
| DirectML | ||
| Enumerations | ||
| Expert | ||
| Market Descriptions | ||
| Marketing/Logo | ||
| Money | ||
| Panel | ||
| references | ||
| research | ||
| Scripts | ||
| Signals | ||
| Structures | ||
| System | ||
| Trailing | ||
| Variables | ||
| .gitignore | ||
| AI_NETWORK.md | ||
| cpu_directml.log | ||
| DATABASE.md | ||
| EXPERIMENTS.md | ||
| opencl.log | ||
| profiling.csv | ||
| README.md | ||
| REFACTOR_NOTES.md | ||
| SIGNALS.md | ||
| Warrior_EA.md | ||
| Warrior_EA.mq5 | ||
| Warrior_EA.mqproj | ||
| Warrior_EA_System_Overview.md | ||
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
- Configure your desired strategies and features in
Variables/Inputs.mqh. - Compile
Warrior_EA.mq5in MetaEditor. - Attach to a chart and enable Algo Trading.
- 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.