2026-07-18 15:53:04 -04:00 | | | //+------------------------------------------------------------------+
|
| | | //| MoneyFixedRisk.mqh |
|
| | | //| Copyright 2000-2023, MetaQuotes Ltd. |
|
| | | //| https://www.mql5.com |
|
| | | //+------------------------------------------------------------------+
|
| | | #include "MoneyRiskBase.mqh"
|
| | | // wizard description start
|
| | | //+------------------------------------------------------------------+
|
| | | //| Description of the class |
|
| | | //| Title=Trading with fixed risk |
|
| | | //| Type=Money |
|
| | | //| Name=FixRisk |
|
| | | //| Class=CMoneyFixedRisk |
|
| | | //| Page= |
|
| | | //| Parameter=Percent,double,10.0,Risk percentage |
|
| | | //+------------------------------------------------------------------+
|
| | | // wizard description end
|
| | | //+------------------------------------------------------------------+
|
| | | //| Class CMoneyFixedRisk. |
|
| | | //| Purpose: Class of money management with fixed percent risk. |
|
| | | //| Derives from CMoneyRiskBase, which now houses the |
|
| | | //| CheckOpenLong/Short + lot-sizing core this class |
|
 refactor(trade-mgmt): remove all confidence-scaled trade management
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>
2026-08-25 10:10:20 -04:00 | | | //| used to duplicate with the since-removed |
|
| | | //| CMoneyIntelligent - no AdjustLotSize() override |
|
| | | //| needed here, the base class's plain-risk behavior |
|
| | | //| is exactly this strategy's behavior. |
|
2026-07-18 15:53:04 -04:00 | | | //+------------------------------------------------------------------+
|
| | | class CMoneyFixedRisk : public CMoneyRiskBase
|
| | | {
|
| | | };
|
| | | //+------------------------------------------------------------------+
|