Commit graph

75 commits

Author SHA1 Message Date
AnimateDread
4e3c71ba5f Merge branch 'main' of forge.mql5.io, keeping ADZigZag-indicator labeling
Origin's f115453 (neuron-reduction-factor fix + fractal/deviation-based
ZigZag labeling inputs) predates and is fully superseded by the local
switch to the real ADZigZag indicator for training labels - resolved by
keeping HEAD's version throughout.
2026-07-16 08:50:51 -04:00
AnimateDread
eee45526a5 fix: remove redundant Expert.Deinit() in OnInit(); correct ADZigZag buffers
- Remove manual Expert.Deinit() calls from all failure branches in OnInit() because MQL5 automatically calls OnDeinit(REASON_INITFAILED) when returning non-INIT_SUCCEEDED, preventing double deinitialization and invalid pointer access in OnDeinit().
- Change ADZigZag buffer count from 1 to 3 to match the indicator's #property indicator_buffers (3 buffers), accounting for internal INDICATOR_CALCULATIONS buffers, consistent with other AD Wyckoff indicators.
2026-07-16 01:12:37 -04:00
AnimateDread
0bfc441139 feat: real-ZigZag training labels, HYBRID CPU-oversubscription fix, input cleanup
- Replace the hand-rolled fractal/deviation-%/ATR-trend-context ZigZag
  approximation with the actual MQL5 ZigZag indicator (rebranded as
  CustomIndicators/ADZigZag.mq5, logic untouched) as the training label
  source; bump the settle/confirmation window from 20 to 100 bars so a
  proper leg can form before being trusted, and drop the now-dead
  ZigZagDeviationPct/MinTrendATRMultiple/TrendContextBars inputs.
- Rebrand the stock Volumes indicator the same way (ADVolume.mq5).
- Fix HYBRID mode (AIType=HYBRID) oversubscribing the CPU fallback tier:
  every concurrent CNet instance was independently sizing its worker
  pool off the same global TargetCPULoad input. g_netPeerCount/
  PeerNetworkCount() now split it across however many CNet instances
  (live+shadow x active signals) are actually sharing the CPU.
- Fix NEURONS_REDUCTION_FACTOR's confusing retention-vs-reduction
  semantics so RF_70 means an actual 70% reduction; default to 4 hidden
  layers / RF_70.
- Migrate remaining free-form training/indicator inputs to enums for UI
  consistency; default news filter lookback to 1h, disable every-tick.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-16 00:56:33 -04:00
AnimateDread
f115453af2 fix: correct neuron reduction factor logic and add new configuration enums
- Fix neuron retention calculation in `BuildFreshTopology()` to use the complement of reduction percentage (retention = 100 - reduction) instead of directly applying the reduction value.
- Correct `NEURONS_REDUCTION_FACTOR` enum descriptions to accurately reflect the actual reduction percentage (e.g., RF_10 now reads "10 % Neurons Reduction Per Layer").
- Add new enums: `ZIGZAG_DEVIATION_PRESET`, `SWING_CONFIRMATION_PRESET`, `TREND_ATR_MULTIPLE_PRESET`, `TREND_CONTEXT_BARS_PRESET`, `MAX_ERAS_PRESET`, `RETRY_COOLDOWN_PRESET`, `TUNE_TRIALS_PRESET` for finer-grained configuration.
2026-07-16 00:04:25 -04:00
AnimateDread
8c66a0fb89 fix(cl): stabilize network training with tighter limits, weight decay, and sign-agreement gate
- Tighten MAX_WEIGHT from 1.0e6 to 100.0 to prevent unbounded weight growth.
- Add MIN_ACTIVATION_DERIVATIVE (1e-4) to avoid zero gradients for saturated units.
- Introduce WEIGHT_DECAY (0.01) to decouple decay from Adam updates.
- Add MAX_WEIGHT_DELTA (0.1) to clamp per-step Adam updates and prevent overshoot.
- Apply sign-agreement gate on weight updates in Adam kernel to only apply steps aligned with current gradient direction.
- Fix tanh/sigmoid derivative calculations to use the new floor instead of hard-coded edge-case values.
2026-07-15 21:47:37 -04:00
AnimateDread
c05d9d1a1f fix: correct OpenCL gradient and weight update for classification layers
- In CaclOutputGradient kernel:
  - Case 1 (sigmoid classification): removed erroneous multiplication by out*(1-out) which dampened gradients – the binary cross-entropy loss already cancels the sigmoid derivative, so direct (target-out) is correct.
  - Added default case for NONE activation (softmax classification) to compute plain error (target-out); previously unhandled, resulting in zero gradients that froze the entire network when OpenCL was active.
- In UpdateWeightsMomentum and UpdateWeightsAdam kernels: added clamp to MAX_WEIGHT when updating weights to prevent gradient spikes from producing ±Infinity and subsequent NaN propagation through dense layers (e.g., classification output head).
2026-07-15 21:47:09 -04:00
AnimateDread
ac88fc1ac5 fix(Expert/ExpertSignalAIBase): add feature cache and fix oversampling imbalance
- Introduce per-bar feature cache to avoid redundant recomputation of input vectors during training.
- Rename EnsureLabelCacheCapacity to EnsureBarCachesCapacity to reflect management of both label and feature caches.
- Fix oversampling logic to maintain balanced representation among minority classes, replacing independent 5x caps that caused relative bias.
2026-07-14 22:49:14 -04:00
AnimateDread
068495b3d7 fix: clean up EA init/deinit lifecycle and close a DirectML mutex-poisoning hang
Warrior_EA.mq5: clear Comment() and destroy the control panel before
Expert.Deinit()'s object-purge cascade runs out from under it; stop
re-registering the same signal filters on every DB retry (was causing a
double-delete of the same pointer on shutdown).

DirectML/WarriorCPU.cpp: bound the worker-thread join in ThreadPool::Stop()
instead of blocking forever - CPU_Shutdown() held g_mutex across an unbounded
join, so a watchdog-killed calling thread could leave it locked forever,
poisoning every future call into the DLL (matches reports of the EA getting
stuck on "initializing" after being removed and re-added to a chart).

Also includes prior era-0 label-cache prebuild and pullback/reversal
label-quality work in AI/Network.mqh, Expert/ExpertSignalAIBase.mqh, and
Variables/Inputs.mqh.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-14 22:36:27 -04:00
AnimateDread
ad154a4897 Merge branch 'main' of https://forge.mql5.io/animatedread/Warrior_EA 2026-07-14 18:05:43 -04:00
AnimateDread
1204b9df97 feat: add percentage-based CPU load input for fallback tier
Replace the absolute thread count input (CpuDllThreads) with a percentage-based CPU_LOAD_PRESET enum (TargetCPULoad). This allows users to specify a percentage of detected cores to use when the CPU DLL fallback is active, improving flexibility and preventing issues when multiple instances share the same CPU DLL pool. Also adds CPU_GetHardwareConcurrency() for accurate core detection.
2026-07-14 18:04:48 -04:00
AnimateDread
5a3310b5cc 2026-07-13 19:19:42 -04:00
AnimateDread
78733aa8a1 2026-07-13 18:10:22 -04:00
AnimateDread
aabc3d996b config(inputs): reduce default hidden layers and neuron reduction factor
Changed default HiddenLayersCount from LAYERS_5 to LAYERS_3 and NeuronsReduction from RF_80 to RF_60 to improve model generalization and reduce overfitting.
2026-07-13 17:55:01 -04:00
AnimateDread
06f1ffe7c6 Merge branch 'main' of https://forge.mql5.io/animatedread/Warrior_EA 2026-07-13 17:02:07 -04:00
AnimateDread
8a1fb8b43a fix: remove native compute DLL embedding and extraction due to MQL5 restriction
MQL5 refuses to compile `#resource` directives pointing to PE executables ("unsupported resource type ... executable file prohibited"). This commit removes the `#resource` lines and the `ExtractComputeDlls()` function from `AI/Network.mqh`, and updates comments in `Warrior_EA.mq5` to explain that the DLLs must be manually placed in `MQL5\Libraries\`. The call to `ExtractComputeDlls()` in `OnInit()` is also removed.
2026-07-13 16:58:00 -04:00
AnimateDread
9c43740b7b 2026-07-13 16:01:09 -04:00
AnimateDread
9464e52784 feat: embed compute DLLs as resources and extend Save/Load for training state
Add #resource directives for WarriorDML.dll and WarriorCPU.dll, and ExtractComputeDlls() to extract them on first run, enabling MQL Cloud Protector builds to ship DLLs without manual copy. Extend CNet::Save and Load with trainingComplete and indicatorParams arrays to persist AutoTune indicator param values.
2026-07-13 15:59:35 -04:00
AnimateDread
f2a30aa9cf fix: avoid TANH gradient vanishing by omitting derivative in output error and add era field to serialization
The TANH activation's derivative (1-out^2) approaches zero when the output nears ±1, stalling training exactly where convergence to extreme values (e.g., buy/sell signals) is needed. Removing the multiplication by this derivative in the output gradient calculation (both CPU OpenCL and MQL4 paths) prevents this saturation, analogous to using cross-entropy with sigmoid.

Additionally, extend `Save()` and `Load()` to include a new `era` field, enabling tracking of training generations across sessions.
2026-07-13 08:23:30 -04:00
AnimateDread
ab69bf82f8 fix: unmerged path in Expert/ExpertCustom.mqh 2026-07-13 07:31:47 -04:00
AnimateDread
74c7395127 feat: add max-pooling and convolution OpenCL kernels, clean up barrier and signal code
- Define MAX_WEIGHT constant (1.0e6) for weight limits in clusters
- Remove redundant barrier from FeedForward kernel (prevents sync issues)
- Port FeedForwardProof and CalcInputGradientProof kernels for max-pooling (no weights, sliding max)
- Port FeedForwardConv kernel for convolution layers (shared weights, multiple output channels)
- Remove unused code and refactor signal condition logic (CSignalPAI)
2026-07-13 03:23:39 -04:00
AnimateDread
2f5adb4bec 2026-07-13 03:23:07 -04:00
AnimateDread
1073262255 2026-04-20 22:35:14 -04:00
AnimateDread
8157c42314 feat: Enhance README and documentation for Warrior_EA project
- Updated README.md with project overview, key features, directory structure, getting started guide, and modernization roadmap.
- Added AI_NETWORK.md detailing the neural network and AI/ML infrastructure, including architecture, components, usage patterns, and next steps.
- Introduced DATABASE.md for the Database module, outlining key components, design highlights, usage patterns, and future enhancements.
- Created README.md files for Enumerations, Expert, Money, Signals, Structures, System, Trailing, Variables directories, detailing their purpose, key components, and integration notes.
- Documented the Signals subsystem, emphasizing modularity, extensibility, and AI/ML readiness.
- Added comprehensive descriptions for individual signal modules in Signals/ directory.
- Established clear integration notes and recommendations for future improvements across all modules.
2026-04-20 19:28:34 -04:00
super.admin
0a527b0cf9 convert 2025-05-30 16:35:54 +02:00
5ad9a96a3a Initial commit 2025-05-30 14:35:53 +00:00