Warrior_EA/Expert
Repository files (latest commit first)
Filename Latest commit message Latest commit date
AnimateDread 213b3aac15 fix(chart): the reconciliation never ran - it was hooked to a sweep deployed charts do not do
cooldown-recon put the chart-wide cooldown at the end of the overlay sweep. It
executed ZERO times. This store's own header already said why: the sweep
're-arms only when an era ends. A DEPLOYED ensemble runs no further eras'. Five
of six charts were deployed, so there were zero 'Filtered view: swept' lines in
the entire session while the saved files still held 148 same-side pairs under 30
bars on XTIUSD.

Moved to the completion of the progressive vote-arrow restore, which runs on
every chart including deployed ones.

The restore thinning alone was never going to be enough either: MT5 persists
chart objects in profiles\Charts\*\chart*.chr, so arrows drawn under an older
window are ALREADY on the chart when the process starts, and a freshly-thinned
restore just adds to them. Two correctly-thinned sets still union into clusters.
The chart is the only authority.

Same construction as before: OBJ_TREND only (the line is the canonical half of a
mark, matching Snapshot()), sorted by time first because object order is not time
order, and the gap>0 guard so a mis-ordered set fails visibly by keeping rather
than silently by deleting.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-27 16:16:40 -04:00
..
AIBase fix(train): the OOS final pass ran a full epoch at an undecayed rate 2026-08-27 13:46:48 -04:00
Chart fix(chart): the reconciliation never ran - it was hooked to a sweep deployed charts do not do 2026-08-27 16:16:40 -04:00
ConfigLock refactor(config-lock): CConfigLock is a real collaborator, not a raw-include partial 2026-08-24 04:39:17 -04:00
Features feat(label): pivot-EVENT target replaces direction-to-next-pivot 2026-08-26 00:16:16 -04:00
Labeling feat(target): delete the barrier/geometry stack - the label is the verdict 2026-08-24 20:42:31 -04:00
OnlineLearning refactor(meta): remove meta-labeling entirely - RETRAIN-NEUTRAL 2026-08-25 09:44:52 -04:00
Persistence fix(vote): a resumed converged model passed the eligibility test and then abstained on every bar 2026-08-27 00:52:59 -04:00
Topology fix(gate): the payoff horizon ended before the pivot it was measuring 2026-08-27 07:19:40 -04:00
Training fix(diag): the lag profile's first-ever run produced a spectacular false positive 2026-08-26 22:02:14 -04:00
ADIndicatorTuner.mqh ditch(features): remove the eight dead feature groups from the input matrix 2026-08-24 09:21:03 -04:00
ExpertCustom.mqh feat(vote): exit-on-reversal boolean, pin the threshold, retry the atomic rename 2026-08-26 09:53:56 -04:00
ExpertMoneyCustom.mqh refactor(comments): box headers to stdlib length 2026-08-22 00:30:14 -04:00
ExpertSignalAIBase.mqh fix(train): the OOS final pass ran a full epoch at an undecayed rate 2026-08-27 13:46:48 -04:00
ExpertSignalCustom.mqh fix(chart): reconcile the cooldown over the CHART, not over one producer's record 2026-08-27 16:12:49 -04:00
README.md refactor(ai): extract Layer.mqh and deduplicate AI config 2026-08-01 11:27:28 -04:00

Expert/ Directory Documentation

Market-submission compliance (article 2555)

Every runtime check from The Checks a Trading Robot Must Pass Before Publication in the Market is implemented in System/TradeChecks.mqh (free functions, TC* prefix) and applied by the classes in this folder. Where each rule lives:

# Rule Implemented in
1 Catch/fix errors via the tester Development practice; every rejection below logs a throttled reason
2 Insufficient funds TCCheckMoneyForTrade / TCFitVolumeToFreeMargin, applied by CExpertMoneyCustom::ValidateLotForTrade
3 Invalid volumes TCCheckVolumeValue / TCNormalizeVolume, same call site
4 Pending-order count limit TCIsNewOrderAllowed, checked in CExpertSignalCustom::OpenParams and again in CExpertCustom::OpenLong/OpenShort
5 Per-symbol lot limit TCSymbolVolumeAllowed / TCApplySymbolVolumeLimit
6 SYMBOL_TRADE_STOPS_LEVEL TCCheckStops / TCAdjustStops / TCCheckPendingPrice, applied when the setup is shaped and again immediately before the order is sent
7 SYMBOL_TRADE_FREEZE_LEVEL TCFreezeOkForPosition / TCFreezeOkForOrder, gating close, reverse, trailing, order modify and order delete in CExpertCustom
8 Insufficient quote history TCHasEnoughHistory, in CExpertCustom::Refresh and CExpertSignalCustom::OpenParams
9 Array out of range TCIndexOk, plus the existing index guards (iLowest/iHighest return values, Direction()'s bounded loops)
10 Zero divide TCSafeDivide, plus explicit zero-denominator guards on every volume-step / loss division
11 Modification with no changes TCPositionModifyIsMeaningful / TCOrderModifyIsMeaningful, in the TrailingStop* / TrailingOrder* overrides
12 No DLL imports Build-time: WARRIOR_MARKET_BUILD compiles out the #import blocks in AI/NeuronDirectML.mqh
13 No external iCustom Build-time: #resource block in Warrior_EA.mq5 + WARRIOR_CI() in Variables/IndicatorResources.mqh
14 Invalid function parameters TCSymbolIsTradeable, plus the existing ValidationSettings() range checks
15 Access violation No runtime check exists by definition; the NULL-pointer and index guards above are what prevent it
16 CPU / memory consumption TCWarnIfSlow on each OnTick pass (EXPERT_TICK_BUDGET_US) and TCWarnIfMemoryAbove on each timer pass (EXPERT_MEMORY_SOFT_LIMIT_MB)

All rejections report through TCLog(), which throttles per condition so a state that persists for many ticks writes one journal line per minute instead of thousands.

Class hierarchy

CExpert          -> CExpertCustom          (event dispatch, order lifecycle, article-2555 gates)
CExpertMoney     -> CExpertMoneyCustom     (volume correction, margin fitting)
CExpertSignal    -> CExpertSignalCustom    -> CExpertSignalAIBase -> CSignalPAI/CONV/LSTM/HYBRID

ExpertCustom.mqh

Base expert. Virtual handlers for OnTick / OnTimer / OnChartEvent, trading-object setup, series refresh, and the freeze/stops-level gates applied immediately before every send, modify and delete.

ExpertMoneyCustom.mqh

  • CheckAndCorrectVolumeValue — clamps volume to the broker's min/max/step and describes each correction.
  • CheckAndAdjustMoneyForTrade — reduces lots to fit free margin rather than failing the order outright.
  • ValidateLotForTrade — the single gate for rules 2/3/5/14, with throttled logging.

ExpertSignalCustom.mqh

Shared non-AI signal machinery: database-backed signal tracking, pattern weighting, OpenParams() (which shapes SL/TP and applies the min-R:R rejection), and the filter collection. SL_Mode/TP_Mode live here — note they define the AI training target as well as the order, since the triple-barrier label is built from them.

There is no duplicate-trade detection. Three methods that implied otherwise were declared but never defined or called, and were removed in 2026-07. Do not assume the guard exists.

ExpertSignalAIBase.mqh

The AI signal base class. The declaration lives here; the method bodies are split by responsibility into Expert/AIBase/ and included at the bottom of the file, after the declaration. Include them nowhere else.

Expert/AIBase/ holds
Training.mqh era loop, plateau ladder, checkpoint selection, auto-deploy
Topology.mqh network bootstrap, derived shape, conv/LSTM/batch-norm stages
Features.mqh indicator creation, per-bar input feature vector
ChartUI.mqh arrows, arrow persistence, status panel, cleanup
Lifecycle.mqh ctor/dtor, the vote API, tick + chart-event dispatch, config lock
Persistence.mqh .stats / .cfg sidecars, CPU-inference validation
OnlineLearning.mqh live continual learning, EMA shadow, OOS simulator
Labels.mqh triple-barrier labels, async label-cache prebuild
AutoTune.mqh indicator auto-tuner
Inference.mqh softmax, prior calibration, class priors

The topology is derived, not configured — width, taper, depth, conv filters and LSTM hidden size all come from the data shape. See Topology.mqh and Variables/Inputs.mqh for which inputs were removed and why.