| Filename | Latest commit message | Latest commit date |
|---|---|---|
Five modes went, all of them staking real risk on the model's confidence: Intelligent entry (ENTRY_INTELLIGENT), stop (SL_INTELLIGENT), target (TP_INTELLIGENT), trailing (CTrailingIntelligent) and lot size (CMoneyIntelligent's quarter-Kelly). With them, the Confidence_Source input and the CONFIDENCE_SOURCE enum, whose only job was choosing which number those five read. The reason is calibration, not correctness: the confidence magnitude is known to be miscalibrated against the label prior, so every one of these modes multiplied money by a quantity whose units were never established. The DB arm had a second, independent defect - since the tester DB guard (SignalDatabaseActive) it reads 0 in tester and optimizer but non-zero live, so any backtest of CONF_DB/CONF_BLENDED could not reproduce live trading. And what the DB produces is a filter-RANKING win rate, not a per-trade win probability. Both confidence numbers are still recorded per trade (aiConfidence / dbConfidence) and still bucketed against outcome in TradeJournalReport. Recording is what keeps the question answerable; acting on it was the part with no evidence behind it. ConfidenceBridge.mqh now carries an explicit telemetry-only rule at the top. ENUM ORDINALS PINNED. Removing a member vacated a value in four enums at once and MT5 does not validate an enum input replayed from a saved .set or a stored optimization pass. TRAILING_STRATEGY and MONEY_MANAGEMENT_STRATEGY now carry explicit values so the survivors keep the numbers they were saved as, and ValidateBarrierInputs is widened into ValidateTradeManagementInputs covering SL_Mode, TP_Mode, Entry_Multiplier, TrailingStrategy and MM_STRATEGY. Without that gate a chart saved with the Intelligent stop would feed SL_Mode = -1 into a multiplier now used verbatim, placing the stop on the wrong side of entry. RETRAIN-NEUTRAL: neither SL_Mode nor TP_Mode appears in BuildModelFingerprint() or ComputeDbConfigFingerprint() since the swing-pivot target replaced the barrier labels. No .nnw, .cfg or .db re-keys. Also drops the now-dead g_TradeRewardRiskRatio bridge, the CMoneyRiskBase::AdjustRiskAmount hook and the unsigned AIConfidence(). Compile-verified in _claude_stage: 0 errors, 0 warnings. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> |
||
| .. | ||
| Money.mqh | ||
| MoneyFixedLot.mqh | ||
| MoneyFixedRisk.mqh | ||
| MoneyRiskBase.mqh | ||
| README.md | ||
Money Management Subsystem (Money/)
Overview
The Money/ directory contains all money management logic for the Warrior EA. It provides multiple strategies for position sizing, ranging from simple fixed lots to adaptive, streak-based approaches. Each strategy is encapsulated in its own class and can be selected/configured as needed.
Components
Money.mqh
- Aggregates all money management strategies.
- Includes: MoneyFixedRisk, MoneyFixedLot, MoneyIntelligent.
- Entry point for money management logic selection.
MoneyFixedLot.mqh
- Class:
CMoneyFixedLot - Purpose: Fixed lot size per trade.
- Key Features:
- User-defined lot size (
m_lots). - Validates lot size against symbol min/max/step constraints.
- Simple, robust, suitable for static position sizing.
- User-defined lot size (
MoneyFixedRisk.mqh
- Class:
CMoneyFixedRisk - Purpose: Risk-based position sizing.
- Key Features:
- Calculates lot size based on account balance and risk percentage (
m_percent). - Ensures risk per trade is controlled.
- Handles both long and short positions.
- Validates margin and volume constraints.
- Calculates lot size based on account balance and risk percentage (
MoneyIntelligent.mqh
- Class:
CMoneyIntelligent - Purpose: Edge-based, AI-confidence-driven money management (selected via
MM_STRATEGY = INTELLIGENT; AI lot scaling is always on). - Key Features:
- Scales risk% via a quarter-Kelly criterion: uses the empirically calibrated AI/DB
confidence magnitude as the win-probability estimate (
p) and the specific trade's real reward:risk ratio (bridged fromOpenParams()) as the payoff ratio (b). - Only ever scales the configured
Money_Risk_Percentdown from its input ceiling, never above it. - Suitable for advanced, AI/ML-driven strategies.
- Scales risk% via a quarter-Kelly criterion: uses the empirically calibrated AI/DB
confidence magnitude as the win-probability estimate (
Integration Notes
- All strategies derive from a common base (
CExpertMoneyCustom). - Designed for modularity and easy extension.
- Can be further enhanced with AI/ML-driven logic for dynamic risk and position sizing.
Documented April 2026. For modernization and AI/ML integration, see AI_NETWORK.md and project roadmap.