forked from animatedread/Warrior_EA
CMoneyFixedRisk and CMoneyIntelligent both derived independently from CExpertMoneyCustom and carried near-identical CalculatePotentialLoss()/ CheckOpenLong()/CheckOpenShort()/CalculateLotSize() bodies, maintained in two places. New Money/MoneyRiskBase.mqh (CMoneyRiskBase) houses the shared core, with two virtual hooks - AdjustRiskAmount()/AdjustLotSize() - at the exact two points CMoneyIntelligent's confidence-scaling and trade-history Optimize() step used to diverge. CMoneyFixedRisk now has an empty body (the base's defaults are exactly its old behavior); CMoneyIntelligent overrides only the two hooks. CMoneyFixedLot is untouched - it doesn't do risk-based sizing. Pure reorganization, no behavior change; compiled clean (MetaEditor, 0 errors/0 warnings). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
31 lines
1.9 KiB
MQL5
31 lines
1.9 KiB
MQL5
//+------------------------------------------------------------------+
|
|
//| 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 |
|
|
//| used to duplicate with CMoneyIntelligent - no |
|
|
//| AdjustRiskAmount()/AdjustLotSize() override needed |
|
|
//| here, the base class's plain-risk defaults are |
|
|
//| exactly this strategy's behavior. |
|
|
//+------------------------------------------------------------------+
|
|
class CMoneyFixedRisk : public CMoneyRiskBase
|
|
{
|
|
};
|
|
//+------------------------------------------------------------------+
|