From 0a4859982b4043eb9eade32c42ed85229386a26b Mon Sep 17 00:00:00 2001 From: Hadi Khazaee Asl Date: Wed, 25 Dec 2024 00:11:25 +0330 Subject: [PATCH] implement all props ... --- Classes/x-saherelm.x-expert.class.mq5 | 28 + Experts/x-saherelm.x-121.smc.ea.mq5 | 86 +- .../x-121.smc.x-tradehandler.class.mq5 | 385 ++++---- X121SMCEA/Experts/x-121.smc.expert.class.mq5 | 842 ++++++++++++++---- 4 files changed, 981 insertions(+), 360 deletions(-) diff --git a/Classes/x-saherelm.x-expert.class.mq5 b/Classes/x-saherelm.x-expert.class.mq5 index 824931e3..35017ea8 100644 --- a/Classes/x-saherelm.x-expert.class.mq5 +++ b/Classes/x-saherelm.x-expert.class.mq5 @@ -79,7 +79,9 @@ class XCBaseExpert : public XCBaseAlert */ void MagicNumber(long value) { + // mMagicNumber = value; + InitEA(); } /** @@ -99,7 +101,9 @@ class XCBaseExpert : public XCBaseAlert */ void Slippage(int value) { + // mSlippage = value; + InitEA(); } /** @@ -119,7 +123,9 @@ class XCBaseExpert : public XCBaseAlert */ void TagPrefix(string value) { + // mTagPrefix = value; + InitEA(); } // @@ -142,7 +148,9 @@ class XCBaseExpert : public XCBaseAlert */ void SetPeriod(ENUM_TIMEFRAMES value) { + // mPeriod = value; + InitEA(); } /** @@ -162,7 +170,9 @@ class XCBaseExpert : public XCBaseAlert */ void SetSymbol(string value) { + // mSymbol = value; + InitEA(); } /** @@ -182,7 +192,9 @@ class XCBaseExpert : public XCBaseAlert */ void MultiSymbol(bool value) { + // mMultiSymbol = value; + InitEA(); } /** @@ -202,7 +214,9 @@ class XCBaseExpert : public XCBaseAlert */ void Symbols(string value) { + // mSymbols = value; + InitEA(); } // @@ -225,7 +239,9 @@ class XCBaseExpert : public XCBaseAlert */ void Disabled(bool value) { + // mDisabled = value; + InitEA(); } /** @@ -245,7 +261,9 @@ class XCBaseExpert : public XCBaseAlert */ void AllowLong(bool value) { + // mAllowLong = value; + InitEA(); } /** @@ -265,7 +283,9 @@ class XCBaseExpert : public XCBaseAlert */ void AllowShort(bool value) { + // mAllowShort = value; + InitEA(); } // @@ -288,7 +308,9 @@ class XCBaseExpert : public XCBaseAlert */ void ReportNewMonths(bool value) { + // mReportNewMonths = value; + InitEA(); } /** @@ -308,7 +330,9 @@ class XCBaseExpert : public XCBaseAlert */ void ReportNewWeeks(bool value) { + // mReportNewWeeks = value; + InitEA(); } /** @@ -328,7 +352,9 @@ class XCBaseExpert : public XCBaseAlert */ void ReportNewDays(bool value) { + // mReportNewDays = value; + InitEA(); } /** @@ -348,7 +374,9 @@ class XCBaseExpert : public XCBaseAlert */ void ReportNewHours(bool value) { + // mReportNewHours = value; + InitEA(); } // diff --git a/Experts/x-saherelm.x-121.smc.ea.mq5 b/Experts/x-saherelm.x-121.smc.ea.mq5 index e0f9a0f3..590ce01c 100644 --- a/Experts/x-saherelm.x-121.smc.ea.mq5 +++ b/Experts/x-saherelm.x-121.smc.ea.mq5 @@ -41,22 +41,40 @@ input group "Symbols"; input bool eaMultiSymbol = false; // Use Multi Symbol input string eaSymbols = "EURUSDb,GBPUSDb,USDJPYb,USDCHFb"; // Trading Symbols -// -// Volume ... -input group "Volume"; -input double eaR2R = 3.0; // Risk to Reward Ratio -input bool eaUseDynamicVolume = false; // Use Dynamic Volume -input double eaDynamicVolumeStep = 0.01; // Increase Volume Step -input double eaDynamicVolumeBalanceFactor = 200; // Balance Factor for Generate Dynamic Volume -input double eaVolume = 0.05; // Static Volume -input bool eaDynamicRiskManagement = false; // Dynamic Risk Management -input double eaRiskPercentPerBalance = 0; // Risk Percent Per Balance on Each Trade - // // Signalling ... input group "Signalling"; -input bool eaAllowLong = true; // Allow Long Signals -input bool eaAllowShort = true; // Allow Short Signals +input bool eaAllowLong = true; // Allow Long Signals +input bool eaAllowShort = true; // Allow Short Signals +input int eaMaxAllowedLongs = 5; // Max Allowed Long Signals +input int eaMaxAllowedShorts = 5; // Max Allowed Short Signals +input bool eaUseMaxAllowedSignalsPerSymbol = true; // Use Max Allowed Signal Types Per Symbol +input double eaLastPositionProfitForAcceptNextInPoint = 0; // Last Position Profit In Points for Accept new Signal +input int eaDelaysBetweenTwoSignalsInBar = 7; // Delay between two Signals in Bars +input double eaMaxAllowedSpread = 25; // Max Allowed Spread for Signalling +input int eaMinRequiredVerificationForSpreadPass = 20; // Minimum Spread Verification for Signalling + +// +// Risk Management ... +input group "Risk Management"; +input double eaR2R = 6; // Signallers Risk to Reward Ratio +input double eaVolume = 0.05; // Static Volume +input double eaRiskPercentPerBalance = 0.5; // Risk Percent Per Balance in Each Trade +input bool eaDynamicRiskManagement = false; // Dynamic Risk Management +input bool eaUseDynamicVolume = false; // Use Dynamic Volume +input double eaDynamicVolumeStep = 0.01; // Increase Volume Step +input double eaDynamicVolumeBalanceFactor = 200; // Balance Factor for Generate Dynamic Volume +input double eaMaxAllowedDrawdownToOpenTrades = 3; // Max Allowed Drawdown for Open Trades +input int eaMaxAllowedSLToPauseSignallingPerSymbol = 2; // Max Allowed SL for Pause Signalling Per Symbol +input int eaPauseSignallingAfterReachesMaxAllowedSLInSecconds = 14400; // Pause Signalling Per Symbol afte Max Allowed SL Reached In Seconds + +// +// Protection ... +input group "Protection"; +input bool eaAllowHedging = false; // Allow Hedge Positions +input int eaMinOpenTradesFroHedging = 3; // Minimum Open Positions for Hedging +input double eaHedgingMinVolumeStep = 0.01; // Minimum Volume Step for Hedging +input double eaHedgeingMinRequiredProfitPerVolumeStep = 0.5; // Minimum Required Profit Per Volume Step for Hedging // // Alert ... @@ -108,6 +126,7 @@ int OnInit() // Configure EA Expert Class ... // + // Event Handlers ... eaExpert.OnSignalEventListener = OnSignalRecieved; eaExpert.OnDealsChangedEventListener = OnDealsChanged; eaExpert.OnOrdersChangedEventListener = OnOrdersChanged; @@ -117,21 +136,52 @@ int OnInit() eaExpert.OnPositionForceCloseEventListener = OnPositionForceClosed; // + // Common ... eaExpert.MagicNumber(eaMagicNumber); eaExpert.Slippage(eaSlippage); eaExpert.TagPrefix(eaLogSuffix); // + // Symbol ... eaExpert.SetSymbol(_Symbol); eaExpert.SetPeriod(_Period); eaExpert.Symbols(eaSymbols); eaExpert.MultiSymbol(eaMultiSymbol); // + // Signalling ... eaExpert.AllowLong(eaAllowLong); eaExpert.AllowShort(eaAllowShort); + eaExpert.MaxAllowedLongs(eaMaxAllowedLongs); + eaExpert.MaxAllowedShorts(eaMaxAllowedShorts); + eaExpert.UseMaxAllowedSignalsPerSymbol(eaUseMaxAllowedSignalsPerSymbol); + eaExpert.LastPositionProfitForAcceptNextInPoint(eaLastPositionProfitForAcceptNextInPoint); + eaExpert.DelaysBetweenTwoSignalsInBar(eaDelaysBetweenTwoSignalsInBar); + eaExpert.MaxAllowedSpread(eaMaxAllowedSpread); + eaExpert.MinRequiredVerificationForSpreadPass(eaMinRequiredVerificationForSpreadPass); // + // Risk Management ... + eaExpert.R2R(eaR2R); + eaExpert.Volume(eaVolume); + eaExpert.RiskPercentPerBalance(eaRiskPercentPerBalance); + eaExpert.DynamicRiskManagement(eaDynamicRiskManagement); + eaExpert.UseDynamicVolume(eaUseDynamicVolume); + eaExpert.DynamicVolumeStep(eaDynamicVolumeStep); + eaExpert.DynamicVolumeBalanceFactor(eaDynamicVolumeBalanceFactor); + eaExpert.MaxAllowedDrawdownToOpenTrades(eaMaxAllowedDrawdownToOpenTrades); + eaExpert.MaxAllowedSLToPauseSignallingPerSymbol(eaMaxAllowedSLToPauseSignallingPerSymbol); + eaExpert.PauseSignallingAfterReachesMaxAllowedSLInSecconds(eaPauseSignallingAfterReachesMaxAllowedSLInSecconds); + + // + // Protection ... + eaExpert.AllowHedging(eaAllowHedging); + eaExpert.MinOpenTradesFroHedging(eaMinOpenTradesFroHedging); + eaExpert.HedgingMinVolumeStep(eaHedgingMinVolumeStep); + eaExpert.HedgeingMinRequiredProfitPerVolumeStep(eaHedgeingMinRequiredProfitPerVolumeStep); + + // + // Alert ... eaExpert.SetAlertEnableAlerts(eaEnableAlerts); eaExpert.SetAlertLogAlerts(eaLogAlerts); eaExpert.SetAlertMailAlerts(eaMailAlerts); @@ -139,20 +189,12 @@ int OnInit() eaExpert.SetAlertTerminalAlerts(eaTerminalAlerts); // + // Reports ... eaExpert.ReportNewMonths(eaReportNewMonths); eaExpert.ReportNewWeeks(eaReportNewWeeks); eaExpert.ReportNewDays(eaReportNewDays); eaExpert.ReportNewHours(eaReportNewHours); - // - eaExpert.R2R(eaR2R); - eaExpert.Volume(eaVolume); - eaExpert.UseDynamicVolume(eaUseDynamicVolume); - eaExpert.DynamicVolumeStep(eaDynamicVolumeStep); - eaExpert.DynamicRiskManagement(eaDynamicRiskManagement); - eaExpert.RiskPercentPerBalance(eaRiskPercentPerBalance); - eaExpert.DynamicVolumeBalanceFactor(eaDynamicVolumeBalanceFactor); - // bool isInited = eaExpert.HandleOnInit(); if (!isInited) diff --git a/X121SMCEA/Classes/x-121.smc.x-tradehandler.class.mq5 b/X121SMCEA/Classes/x-121.smc.x-tradehandler.class.mq5 index 8b7e84e3..712a912f 100644 --- a/X121SMCEA/Classes/x-121.smc.x-tradehandler.class.mq5 +++ b/X121SMCEA/Classes/x-121.smc.x-tradehandler.class.mq5 @@ -1714,7 +1714,7 @@ class XC121SMCTradeHandler : public XCBaseAlert } // - // Signalling Properties ... + // Signalling Props ... /** * Get Allow Long Signals State ... @@ -1758,7 +1758,7 @@ class XC121SMCTradeHandler : public XCBaseAlert /** * Get Max Allowed Long Signals ... - * = 0 => Unlimited ... + * 0 => Unlimited ... * * @return ( int ) */ @@ -1769,9 +1769,9 @@ class XC121SMCTradeHandler : public XCBaseAlert /** * Set Max Allowed Long Signals ... - * = 0 => Unlimited ... * * @param value: Integer ... + * 0 => Unlimited ... */ void MaxAllowedLongs(int value) { @@ -1787,7 +1787,7 @@ class XC121SMCTradeHandler : public XCBaseAlert /** * Get Max Allowed Short Signals ... - * = 0 => Unlimited ... + * 0 => Unlimited ... * * @return ( int ) */ @@ -1798,9 +1798,9 @@ class XC121SMCTradeHandler : public XCBaseAlert /** * Set Max Allowed Short Signals ... - * = 0 => Unlimited ... * * @param value: Integer ... + * 0 => Unlimited ... */ void MaxAllowedShorts(int value) { @@ -1815,23 +1815,110 @@ class XC121SMCTradeHandler : public XCBaseAlert } /** - * Get Use Max Allowed Signals Per Symbol or at All State ... + * Get Use Max Allowed Signal Types Per Symbol State ... * * @return ( bool ) */ - bool UseMaxAllowedTradesPerSymbol() + bool UseMaxAllowedSignalsPerSymbol() { - return mUseMaxAllowedTradesPerSymbol; + return mUseMaxAllowedSignalsPerSymbol; } /** - * Set Use Max Allowed Signals Per Symbol or at All State ... + * Set Use Max Allowed Signal Types Per Symbol State ... * * @param value: Boolean ... */ - void UseMaxAllowedTradesPerSymbol(bool value) + void UseMaxAllowedSignalsPerSymbol(bool value) { - mUseMaxAllowedTradesPerSymbol = value; + mUseMaxAllowedSignalsPerSymbol = false; + } + + /** + * Get Last Position Profit In Points for Accept new Signal ... + * 0 => Accept All ... + * + * @return ( double ) + */ + double LastPositionProfitForAcceptNextInPoint() + { + return mLastPositionProfitForAcceptNextInPoint; + } + + /** + * Set Last Position Profit In Points for Accept new Signal ... + * + * @param value: Double ... + * 0 => Accept All ... + */ + void LastPositionProfitForAcceptNextInPoint(double value) + { + // + if (value < 0) + { + value = 0; + } + + // + mLastPositionProfitForAcceptNextInPoint = value; + } + + /** + * Get Delay between two Signals in Bars ... + * 0 => Accept All ... + * + * @return ( int ) + */ + int DelaysBetweenTwoSignalsInBar() + { + return mDelaysBetweenTwoSignalsInBar; + } + + /** + * Set Delay between two Signals in Bars ... + * + * @param value: Integer ... + * 0 => Accept All ... + */ + void DelaysBetweenTwoSignalsInBar(int value) + { + // + if (value < 0) + { + value = 0; + } + + // + mDelaysBetweenTwoSignalsInBar = value; + } + + /** + * Get Max Allowed Spread for Signalling ... + * 0 => Accept All ... + * + * @return ( double ) + */ + double MaxAllowedSpread() + { + return mMaxAllowedSpread; + } + + /** + * Set Max Allowed Spread for Signalling ... + * + * @param value: Double ... + * 0 => Accept All ... + */ + void MaxAllowedSpread(double value) + { + // + if (value < 0) + { + value = 0; + } + + // + mMaxAllowedSpread = value; } /** @@ -1868,53 +1955,31 @@ class XC121SMCTradeHandler : public XCBaseAlert mAdditionalVolume = value; } - /** - * Get How Many Bars Must Passed after a Signal for Accept Next ... - * 0 => Unlimited ... - * - * @return ( int ) - */ - int DelayBarBetweenTwoSignal() - { - return mDelayBarBetweenTwoSignal; - } + // + // Risk Management Props ... /** - * Set How Many Bars Must Passed after a Signal for Accept Next ... - * - * @param value: Integer ... - * 0 => Unlimited ... - */ - void DelayBarBetweenTwoSignal(int value) - { - // - if (value < 0) - { - value = 0; - } - - // - mDelayBarBetweenTwoSignal = value; - } - - /** - * Get Max Allowed Drawdown Percent for Open New Positions ... - * 0 => Unlimited ... + * Get Max Allowed Drawdown Percent for Open Trades ... + * 0 => Ignore ... + * min => 0 ... + * max => 100 ... * * @return ( double ) */ - double MaxDrawdownPercentForOpenTrades() + double MaxAllowedDrawdownToOpenTrades() { - return mMaxDrawdownPercentForOpenTrades; + return mMaxAllowedDrawdownToOpenTrades; } /** - * Set Max Allowed Drawdown Percent for Open New Positions ... + * Set Max Allowed Drawdown Percent for Open Trades ... * * @param value: Double ... - * 0 => Unlimited ... + * 0 => Ignore ... + * min => 0 ... + * max => 100 ... */ - void MaxDrawdownPercentForOpenTrades(double value) + void MaxAllowedDrawdownToOpenTrades(double value) { // if (value < 0) @@ -1923,59 +1988,33 @@ class XC121SMCTradeHandler : public XCBaseAlert } // - mMaxDrawdownPercentForOpenTrades = value; - } - - /** - * Get Accept Next Same Type Signal only When last Issued Signal is InProfit by Points ... - * - * @return ( double ) - * 0 => Accept All ... - */ - double AcceptNextSameTypeSignalWhenLastInProfit() - { - return mAcceptNextSameTypeSignalWhenLastInProfit; - } - - /** - * Set Accept Next Same Type Signal only When last Issued Signal is InProfit by Points ... - * - * @param value: Double ... - * 0 => Accept All ... - */ - void AcceptNextSameTypeSignalWhenLastInProfit(double value) - { - // - if (value < 0) + if (value > 50) { - value = 0; + value = 50; } // - mAcceptNextSameTypeSignalWhenLastInProfit = value; + mMaxAllowedDrawdownToOpenTrades = value; } - // - // Protecting Properties ... - /** - * Get Max Allower SL Per Symbol before Pausing ... + * Get Max Allowed SL for Pause Signalling Per Symbol ... * 0 => Unlimited ... * * @return ( int ) */ - int MaxAllowedSLToPause() + int MaxAllowedSLToPauseSignallingPerSymbol() { - return mMaxAllowedSLToPause; + return mMaxAllowedSLToPauseSignallingPerSymbol; } /** - * Set Max Allower SL Per Symbol before Pausing ... + * Set Max Allowed SL for Pause Signalling Per Symbol ... * * @param value: Integer ... * 0 => Unlimited ... */ - void MaxAllowedSLToPause(int value) + void MaxAllowedSLToPauseSignallingPerSymbol(int value) { // if (value < 0) @@ -1984,27 +2023,27 @@ class XC121SMCTradeHandler : public XCBaseAlert } // - mMaxAllowedSLToPause = value; + mMaxAllowedSLToPauseSignallingPerSymbol = value; } /** - * Get Specified Delay For Pause Symbol Trade if Reached Max Allowed SL in Seconds ... - * 0 => Ignored ... + * Get Pause Signalling Per Symbol afte Max Allowed SL Reached In Seconds ... + * 0 => Ignore ... * * @return ( int ) */ - int MaxAllowedSLReachedPauseDelay() + int PauseSignallingAfterReachesMaxAllowedSLInSecconds() { - return mMaxAllowedSLReachedPauseDelay; + return mPauseSignallingAfterReachesMaxAllowedSLInSecconds; } /** - * Set Specified Delay For Pause Symbol Trade if Reached Max Allowed SL in Seconds ... + * Set Pause Signalling Per Symbol afte Max Allowed SL Reached In Seconds ... * * @param value: Integer ... - * 0 => Ignored ... + * 0 => Ignore ... */ - void MaxAllowedSLReachedPauseDelay(int value) + void PauseSignallingAfterReachesMaxAllowedSLInSecconds(int value) { // if (value < 0) @@ -2013,54 +2052,79 @@ class XC121SMCTradeHandler : public XCBaseAlert } // - mMaxAllowedSLReachedPauseDelay = value; + mPauseSignallingAfterReachesMaxAllowedSLInSecconds = value; } // - // Hedge Props ... + // Protection Props ... /** - * Get Allow Hedge Position State ... + * Get Allow Hedge Positions State ... * * @return ( bool ) */ - bool AllowHedge() + bool AllowHedging() { - return mAllowHedge; + return mAllowHedging; } /** - * Set Allow Hedge Position State ... + * Set Allow Hedge Positions State ... * * @param value: Boolean ... */ - void AllowHedge(bool value) + void AllowHedging(bool value) { - mAllowHedge = value; + mAllowHedging = value; } /** - * Get Minimum Volume Steps for Hedge Requirement Calculation ... - * 0 => Ignore Hedging ... - * min => 0.01 ... - * max => 0.1 ... + * Get Minimum Open Positions for Hedging ... + * 0 => Ignore ... + * + * @return ( int ) + */ + int MinOpenTradesFroHedging() + { + return mMinOpenTradesFroHedging; + } + + /** + * Set Minimum Open Positions for Hedging ... + * + * @param value: Integer ... + * 0 => Ignore ... + */ + void MinOpenTradesFroHedging(int value) + { + // + if (value < 0) + { + value = 0; + } + + // + mMinOpenTradesFroHedging = value; + } + + /** + * Get Minimum Volume Step for Hedging ... + * 0 => Ignore ... * * @return ( double ) */ - double HedgeMinVolumeStep() + double HedgingMinVolumeStep() { - return mHedgeMinVolumeStep; + return mHedgingMinVolumeStep; } /** - * Set Minimum Volume Steps for Hedge Requirement Calculation ... + * Set Minimum Volume Step for Hedging ... * * @param value: Double ... - * 0 => Ignore Hedging ... - * min => 0.01 ... - * max => 0.1 ... + * 0 => Ignore ... */ - void HedgeMinVolumeStep(double value) + void HedgingMinVolumeStep(double value) { // if (value < 0) @@ -2081,57 +2145,27 @@ class XC121SMCTradeHandler : public XCBaseAlert } // - mHedgeMinVolumeStep = value; - } - - /** - * Get Minimum Requirement Open Positions for Hedging ... - * 0 => Ignore Hedging ... - * - * @return ( int ) - */ - int MinimumOpenPositionsForHedge() - { - return mMinimumOpenPositionsForHedge; - } - - /** - * Set Minimum Requirement Open Positions for Hedging ... - * - * @param value: Integer ... - * 0 => Ignore Hedging ... - */ - void MinimumOpenPositionsForHedge(int value) - { - // - if (value < 0) - { - value = 0; - } - - // - mMinimumOpenPositionsForHedge = value; + mHedgingMinVolumeStep = value; } /** * Get Minimum Required Profit Per Volume Step for Hedging ... - * 0 => Ignore Hedging ... + * 0 => Ignore ... * * @return ( double ) */ - double HedgeMinProfitPerVolumeStep() + double HedgeingMinRequiredProfitPerVolumeStep() { - return mHedgeMinProfitPerVolumeStep; + return mHedgeingMinRequiredProfitPerVolumeStep; } /** * Set Minimum Required Profit Per Volume Step for Hedging ... * * @param value: Double ... - * 0 => Ignore Hedging ... - * min => 0.01 ... + * 0 => Ignore ... */ - void HedgeMinProfitPerVolumeStep(double value) + void HedgeingMinRequiredProfitPerVolumeStep(double value) { // if (value < 0) @@ -2140,13 +2174,7 @@ class XC121SMCTradeHandler : public XCBaseAlert } // - if (value > 0 && value < 0.01) - { - value = 0.01; - } - - // - mHedgeMinProfitPerVolumeStep = value; + mHedgeingMinRequiredProfitPerVolumeStep = value; } // @@ -2634,8 +2662,8 @@ class XC121SMCTradeHandler : public XCBaseAlert } // - int maxAllowedSLToPause = MaxAllowedSLToPause(); - int pauseDelay = MaxAllowedSLReachedPauseDelay(); + int maxAllowedSLToPause = MaxAllowedSLToPauseSignallingPerSymbol(); + int pauseDelay = PauseSignallingAfterReachesMaxAllowedSLInSecconds(); if (maxAllowedSLToPause <= 0 || pauseDelay <= 0) { return; @@ -2796,7 +2824,7 @@ class XC121SMCTradeHandler : public XCBaseAlert // ENUM_X_POSITION_TYPES pType = ToPositionType(signal.type); - double requiredProfitForAcceptNext = AcceptNextSameTypeSignalWhenLastInProfit(); + double requiredProfitForAcceptNext = LastPositionProfitForAcceptNextInPoint(); // // Implement Same Signal Conditions ... @@ -2839,7 +2867,7 @@ class XC121SMCTradeHandler : public XCBaseAlert // Retrieve Longs and Shorts ... XPosition longs[]; XPosition shorts[]; - bool useMaxAllowedPositionsPerSymbol = UseMaxAllowedTradesPerSymbol(); + bool useMaxAllowedPositionsPerSymbol = UseMaxAllowedSignalsPerSymbol(); // // Retrieve Positions ... @@ -2895,7 +2923,7 @@ class XC121SMCTradeHandler : public XCBaseAlert // // Check Delays Bar if Provided ... - int delaysBarBetweenTwoSignal = DelayBarBetweenTwoSignal(); + int delaysBarBetweenTwoSignal = DelaysBetweenTwoSignalsInBar(); if (delaysBarBetweenTwoSignal > 0) { // @@ -2970,7 +2998,7 @@ class XC121SMCTradeHandler : public XCBaseAlert // // Check Max Drawdown Percent for Open Trades ... - double maxAllowedDrawdownPercent = MaxDrawdownPercentForOpenTrades(); + double maxAllowedDrawdownPercent = MaxAllowedDrawdownToOpenTrades(); if (maxAllowedDrawdownPercent > 0) { // @@ -3343,13 +3371,13 @@ class XC121SMCTradeHandler : public XCBaseAlert // // Checking Hedge ... - bool allowHedge = AllowHedge(); + bool allowHedge = AllowHedging(); if (allowHedge) { // - double minHedgeVolumeStep = HedgeMinVolumeStep(); - int minRequiredPositionsForHedge = MinimumOpenPositionsForHedge(); - double minRequiredProfitPerVolumeStepForHedge = HedgeMinProfitPerVolumeStep(); + double minHedgeVolumeStep = HedgingMinVolumeStep(); + int minRequiredPositionsForHedge = MinOpenTradesFroHedging(); + double minRequiredProfitPerVolumeStepForHedge = HedgeingMinRequiredProfitPerVolumeStep(); // double minRequiredAdditionalProfit = @@ -3357,7 +3385,7 @@ class XC121SMCTradeHandler : public XCBaseAlert ((volumeSummary / minHedgeVolumeStep) * minRequiredProfitPerVolumeStepForHedge); // - bool canHedge = AllowHedge() && + bool canHedge = AllowHedging() && profitSummary > 0 && minHedgeVolumeStep > 0 && minRequiredProfitPerVolumeStepForHedge > 0 && @@ -3419,26 +3447,29 @@ class XC121SMCTradeHandler : public XCBaseAlert bool mSaveConditions; // Save SL Conditions // - bool mAllowLong; // Allow Long/Buy Trade Type - bool mAllowShort; // Allow Short/Sell Trade Type - int mMaxAllowedLongs; // Max Allowe Long/Buy Trades - int mMaxAllowedShorts; // Max Allowe Short/Sell Trades - double mAdditionalVolume; // Volume Additional - int mDelayBarBetweenTwoSignal; // Delay Bars Between Two Signal - bool mUseMaxAllowedTradesPerSymbol; // Use Max Allowed Trades Per Symbol - double mMaxDrawdownPercentForOpenTrades; // Max Drawdown Percent for Open Trades - double mAcceptNextSameTypeSignalWhenLastInProfit; // Accept Next Same Type Signal When Last in Profit in Point + // Signalling Props ... + bool mAllowLong; // Allow Long Signals ... + bool mAllowShort; // Allow Short Signals ... + int mMaxAllowedLongs; // Max Allowed Long Signals ... + int mMaxAllowedShorts; // Max Allowed Short Signals ... + bool mUseMaxAllowedSignalsPerSymbol; // Use Max Allowed Signal Types Per Symbol ... + double mLastPositionProfitForAcceptNextInPoint; // Last Position Profit In Points for Accept new Signal ... + int mDelaysBetweenTwoSignalsInBar; // Delay between two Signals in Bars ... + double mMaxAllowedSpread; // Max Allowed Spread for Signalling ... + double mAdditionalVolume; // Volume Additional ... // - int mMaxAllowedSLToPause; // Max Allowed SL Per Symbol - int mMaxAllowedSLReachedPauseDelay; // Pause Symbol Trading After Max Allowed SL Reached + // Risk Management Props ... + double mMaxAllowedDrawdownToOpenTrades; // Max Allowed Drawdown for Open Trades ... + int mMaxAllowedSLToPauseSignallingPerSymbol; // Max Allowed SL for Pause Signalling Per Symbol ... + int mPauseSignallingAfterReachesMaxAllowedSLInSecconds; // Pause Signalling Per Symbol afte Max Allowed SL Reached In Seconds ... // - // Hedging Properties ... - bool mAllowHedge; // Allow Protector to Hedge Positions - double mHedgeMinVolumeStep; // Minimum Volume Step For Hedge - int mMinimumOpenPositionsForHedge; // Minimum Open Positions For Hedge - double mHedgeMinProfitPerVolumeStep; // Minimum Required Profit For Hedge Per Volume Step + // Protection Props ... + bool mAllowHedging; // Allow Hedge Positions ... + int mMinOpenTradesFroHedging; // Minimum Open Positions for Hedging ... + double mHedgingMinVolumeStep; // Minimum Volume Step for Hedging ... + double mHedgeingMinRequiredProfitPerVolumeStep; // Minimum Required Profit Per Volume Step for Hedging ... // XCBarAnalyser mBarAnalyser; diff --git a/X121SMCEA/Experts/x-121.smc.expert.class.mq5 b/X121SMCEA/Experts/x-121.smc.expert.class.mq5 index 925cc1c1..dd3c8eb5 100644 --- a/X121SMCEA/Experts/x-121.smc.expert.class.mq5 +++ b/X121SMCEA/Experts/x-121.smc.expert.class.mq5 @@ -58,6 +58,258 @@ class XC121SMCExpert : public XCBaseExpert // // Getter(s) / Setter(s) ... + // + // Signalling Props ... + + /** + * Get Allow Long Signals State ... + * + * @return ( bool ) + */ + bool AllowLong() + { + return mAllowLong; + } + + /** + * Set Allow Long Signals State ... + * + * @param value: Boolean ... + */ + void AllowLong(bool value) + { + // + mAllowLong = value; + ReConfigure(); + } + + /** + * Get Allow Short Signals State ... + * + * @return ( bool ) + */ + bool AllowShort() + { + return mAllowShort; + } + + /** + * Set Allow Short Signals State ... + * + * @param value: Boolean ... + */ + void AllowShort(bool value) + { + // + mAllowShort = value; + ReConfigure(); + } + + /** + * Get Max Allowed Long Signals ... + * 0 => Unlimited ... + * + * @return ( int ) + */ + int MaxAllowedLongs() + { + return mMaxAllowedLongs; + } + + /** + * Set Max Allowed Long Signals ... + * + * @param value: Integer ... + * 0 => Unlimited ... + */ + void MaxAllowedLongs(int value) + { + // + if (value < 0) + { + value = 0; + } + + // + mMaxAllowedLongs = value; + ReConfigure(); + } + + /** + * Get Max Allowed Short Signals ... + * 0 => Unlimited ... + * + * @return ( int ) + */ + int MaxAllowedShorts() + { + return mMaxAllowedShorts; + } + + /** + * Set Max Allowed Short Signals ... + * + * @param value: Integer ... + * 0 => Unlimited ... + */ + void MaxAllowedShorts(int value) + { + // + if (value < 0) + { + value = 0; + } + + // + mMaxAllowedShorts = value; + ReConfigure(); + } + + /** + * Get Use Max Allowed Signal Types Per Symbol State ... + * + * @return ( bool ) + */ + bool UseMaxAllowedSignalsPerSymbol() + { + return mUseMaxAllowedSignalsPerSymbol; + } + + /** + * Set Use Max Allowed Signal Types Per Symbol State ... + * + * @param value: Boolean ... + */ + void UseMaxAllowedSignalsPerSymbol(bool value) + { + // + mUseMaxAllowedSignalsPerSymbol = false; + ReConfigure(); + } + + /** + * Get Last Position Profit In Points for Accept new Signal ... + * 0 => Accept All ... + * + * @return ( double ) + */ + double LastPositionProfitForAcceptNextInPoint() + { + return mLastPositionProfitForAcceptNextInPoint; + } + + /** + * Set Last Position Profit In Points for Accept new Signal ... + * + * @param value: Double ... + * 0 => Accept All ... + */ + void LastPositionProfitForAcceptNextInPoint(double value) + { + // + if (value < 0) + { + value = 0; + } + + // + mLastPositionProfitForAcceptNextInPoint = value; + ReConfigure(); + } + + /** + * Get Delay between two Signals in Bars ... + * 0 => Accept All ... + * + * @return ( int ) + */ + int DelaysBetweenTwoSignalsInBar() + { + return mDelaysBetweenTwoSignalsInBar; + } + + /** + * Set Delay between two Signals in Bars ... + * + * @param value: Integer ... + * 0 => Accept All ... + */ + void DelaysBetweenTwoSignalsInBar(int value) + { + // + if (value < 0) + { + value = 0; + } + + // + mDelaysBetweenTwoSignalsInBar = value; + ReConfigure(); + } + + /** + * Get Max Allowed Spread for Signalling ... + * 0 => Accept All ... + * + * @return ( double ) + */ + double MaxAllowedSpread() + { + return mMaxAllowedSpread; + } + + /** + * Set Max Allowed Spread for Signalling ... + * + * @param value: Double ... + * 0 => Accept All ... + */ + void MaxAllowedSpread(double value) + { + // + if (value < 0) + { + value = 0; + } + + // + mMaxAllowedSpread = value; + ReConfigure(); + } + + /** + * Get Minimum Spread Verification for Signalling ... + * 0 => Ignore ... + * + * @return ( int ) + */ + int MinRequiredVerificationForSpreadPass() + { + return mMinRequiredVerificationForSpreadPass; + } + + /** + * Set Minimum Spread Verification for Signalling ... + * + * @param value: Integer ... + * 0 => Ignore ... + */ + void MinRequiredVerificationForSpreadPass(int value) + { + // + if (value < 0) + { + value = 0; + } + + // + mMinRequiredVerificationForSpreadPass = value; + ReConfigure(); + } + + // + // Risk Management Props ... + /** * Get Risk to Reward Ratio ... * @@ -83,128 +335,7 @@ class XC121SMCExpert : public XCBaseExpert // mR2R = value; - ReConfigureAllStrategies(); - } - - /** - * Get Use Dynamic Volume State ... - * - * @return ( bool ) - */ - bool UseDynamicVolume() - { - return mUseDynamicVolume; - } - - /** - * Set Use Dynamic Volume State ... - * - * @param value: Boolean ... - */ - void UseDynamicVolume(bool value) - { - mUseDynamicVolume = value; - } - - /** - * Get Increase Volume Step ... - * - * @return ( double ) - */ - double DynamicVolumeStep() - { - return mDynamicVolumeStep; - } - - /** - * Set Increase Volume Step ... - * - * @param value: Double ... - */ - void DynamicVolumeStep(double value) - { - // - if (value < 0.01) - { - value = 0.01; - } - - // - mDynamicVolumeStep = value; - } - - /** - * Get Balance Factor for Generate Dynamic Volume ... - * - * @return ( double ) - */ - double DynamicVolumeBalanceFactor() - { - return mDynamicVolumeBalanceFactor; - } - - /** - * Set Balance Factor for Generate Dynamic Volume ... - * - * @param value: Double ... - */ - void DynamicVolumeBalanceFactor(double value) - { - // - if (value < 0) - { - value = 0; - } - - // - mDynamicVolumeBalanceFactor = value; - } - - /** - * Get Risk Percent Per Balance in Each Trade ... - * - * @return ( double ) - */ - double RiskPercentPerBalance() - { - return mRiskPercentPerBalance; - } - - /** - * Set Risk Percent Per Balance in Each Trade ... - * - * @param value: Double - */ - void RiskPercentPerBalance(double value) - { - // - if (value < 0) - { - value = 0; - } - - // - mRiskPercentPerBalance = value; - } - - /** - * Get Dynamic Risk Management State ... - * - * @return ( bool ) - */ - bool DynamicRiskManagement() - { - return mDynamicRiskManagement; - } - - /** - * Set Dynamic Risk Management State ... - * - * @param value: Boolean ... - */ - void DynamicRiskManagement(bool value) - { - mDynamicRiskManagement = value; + ReConfigure(); } /** @@ -232,6 +363,362 @@ class XC121SMCExpert : public XCBaseExpert // mVolume = value; + ReConfigure(); + } + + /** + * Get Risk Percent Per Balance in Each Trade ... + * + * @return ( double ) + */ + double RiskPercentPerBalance() + { + return mRiskPercentPerBalance; + } + + /** + * Set Risk Percent Per Balance in Each Trade ... + * + * @param value: Double + */ + void RiskPercentPerBalance(double value) + { + // + if (value < 0) + { + value = 0; + } + + // + mRiskPercentPerBalance = value; + ReConfigure(); + } + + /** + * Get Dynamic Risk Management State ... + * + * @return ( bool ) + */ + bool DynamicRiskManagement() + { + return mDynamicRiskManagement; + } + + /** + * Set Dynamic Risk Management State ... + * + * @param value: Boolean ... + */ + void DynamicRiskManagement(bool value) + { + // + mDynamicRiskManagement = value; + ReConfigure(); + } + + /** + * Get Use Dynamic Volume State ... + * + * @return ( bool ) + */ + bool UseDynamicVolume() + { + return mUseDynamicVolume; + } + + /** + * Set Use Dynamic Volume State ... + * + * @param value: Boolean ... + */ + void UseDynamicVolume(bool value) + { + // + mUseDynamicVolume = value; + ReConfigure(); + } + + /** + * Get Increase Volume Step ... + * + * @return ( double ) + */ + double DynamicVolumeStep() + { + return mDynamicVolumeStep; + } + + /** + * Set Increase Volume Step ... + * + * @param value: Double ... + */ + void DynamicVolumeStep(double value) + { + // + if (value < 0.01) + { + value = 0.01; + } + + // + mDynamicVolumeStep = value; + ReConfigure(); + } + + /** + * Get Balance Factor for Generate Dynamic Volume ... + * + * @return ( double ) + */ + double DynamicVolumeBalanceFactor() + { + return mDynamicVolumeBalanceFactor; + } + + /** + * Set Balance Factor for Generate Dynamic Volume ... + * + * @param value: Double ... + */ + void DynamicVolumeBalanceFactor(double value) + { + // + if (value < 0) + { + value = 0; + } + + // + mDynamicVolumeBalanceFactor = value; + ReConfigure(); + } + + /** + * Get Max Allowed Drawdown Percent for Open Trades ... + * 0 => Ignore ... + * min => 0 ... + * max => 100 ... + * + * @return ( double ) + */ + double MaxAllowedDrawdownToOpenTrades() + { + return mMaxAllowedDrawdownToOpenTrades; + } + + /** + * Set Max Allowed Drawdown Percent for Open Trades ... + * + * @param value: Double ... + * 0 => Ignore ... + * min => 0 ... + * max => 100 ... + */ + void MaxAllowedDrawdownToOpenTrades(double value) + { + // + if (value < 0) + { + value = 0; + } + + // + if (value > 50) + { + value = 50; + } + + // + mMaxAllowedDrawdownToOpenTrades = value; + ReConfigure(); + } + + /** + * Get Max Allowed SL for Pause Signalling Per Symbol ... + * 0 => Unlimited ... + * + * @return ( int ) + */ + int MaxAllowedSLToPauseSignallingPerSymbol() + { + return mMaxAllowedSLToPauseSignallingPerSymbol; + } + + /** + * Set Max Allowed SL for Pause Signalling Per Symbol ... + * + * @param value: Integer ... + * 0 => Unlimited ... + */ + void MaxAllowedSLToPauseSignallingPerSymbol(int value) + { + // + if (value < 0) + { + value = 0; + } + + // + mMaxAllowedSLToPauseSignallingPerSymbol = value; + ReConfigure(); + } + + /** + * Get Pause Signalling Per Symbol afte Max Allowed SL Reached In Seconds ... + * 0 => Ignore ... + * + * @return ( int ) + */ + int PauseSignallingAfterReachesMaxAllowedSLInSecconds() + { + return mPauseSignallingAfterReachesMaxAllowedSLInSecconds; + } + + /** + * Set Pause Signalling Per Symbol afte Max Allowed SL Reached In Seconds ... + * + * @param value: Integer ... + * 0 => Ignore ... + */ + void PauseSignallingAfterReachesMaxAllowedSLInSecconds(int value) + { + // + if (value < 0) + { + value = 0; + } + + // + mPauseSignallingAfterReachesMaxAllowedSLInSecconds = value; + ReConfigure(); + } + + // + // Protection Props ... + + /** + * Get Allow Hedge Positions State ... + * + * @return ( bool ) + */ + bool AllowHedging() + { + return mAllowHedging; + } + + /** + * Set Allow Hedge Positions State ... + * + * @param value: Boolean ... + */ + void AllowHedging(bool value) + { + // + mAllowHedging = value; + ReConfigure(); + } + + /** + * Get Minimum Open Positions for Hedging ... + * 0 => Ignore ... + * + * @return ( int ) + */ + int MinOpenTradesFroHedging() + { + return mMinOpenTradesFroHedging; + } + + /** + * Set Minimum Open Positions for Hedging ... + * + * @param value: Integer ... + * 0 => Ignore ... + */ + void MinOpenTradesFroHedging(int value) + { + // + if (value < 0) + { + value = 0; + } + + // + mMinOpenTradesFroHedging = value; + ReConfigure(); + } + + /** + * Get Minimum Volume Step for Hedging ... + * 0 => Ignore ... + * + * @return ( double ) + */ + double HedgingMinVolumeStep() + { + return mHedgingMinVolumeStep; + } + + /** + * Set Minimum Volume Step for Hedging ... + * + * @param value: Double ... + * 0 => Ignore ... + */ + void HedgingMinVolumeStep(double value) + { + // + if (value < 0) + { + value = 0; + } + + // + if (value > 0 && value < 0.01) + { + value = 0.01; + } + + // + if (value > 0 && value > 0.1) + { + value = 0.1; + } + + // + mHedgingMinVolumeStep = value; + ReConfigure(); + } + + /** + * Get Minimum Required Profit Per Volume Step for Hedging ... + * 0 => Ignore ... + * + * @return ( double ) + */ + double HedgeingMinRequiredProfitPerVolumeStep() + { + return mHedgeingMinRequiredProfitPerVolumeStep; + } + + /** + * Set Minimum Required Profit Per Volume Step for Hedging ... + * + * @param value: Double ... + * 0 => Ignore ... + */ + void HedgeingMinRequiredProfitPerVolumeStep(double value) + { + // + if (value < 0) + { + value = 0; + } + + // + mHedgeingMinRequiredProfitPerVolumeStep = value; + ReConfigure(); } // @@ -541,37 +1028,7 @@ class XC121SMCExpert : public XCBaseExpert mTradeHandler.SaveConditions(true); // - // Configure Alerts ... - mTradeHandler.SetAlertPrefix(GetTag()); - mTradeHandler.SetAlertEnableAlerts(GetAlertEnableAlerts()); - mTradeHandler.SetAlertLogAlerts(GetAlertLogAlerts()); - mTradeHandler.SetAlertMailAlerts(GetAlertMailAlerts()); - mTradeHandler.SetAlertPushAlerts(GetAlertPushAlerts()); - mTradeHandler.SetAlertTerminalAlerts(GetAlertTerminalAlerts()); - - // - mTradeHandler.MaxAllowedSLToPause(0); - mTradeHandler.DelayBarBetweenTwoSignal(7); - mTradeHandler.MaxAllowedSLReachedPauseDelay(HoursToSeconds(24)); - - // - // Configure Trade Management ... - mTradeHandler.AllowLong(AllowLong()); - mTradeHandler.AllowShort(AllowShort()); - mTradeHandler.MaxAllowedLongs(0); - mTradeHandler.MaxAllowedShorts(0); - mTradeHandler.UseMaxAllowedTradesPerSymbol(true); - mTradeHandler.MaxDrawdownPercentForOpenTrades(5); - - // - // Configure Position Protector ... - - // - // Configure Hedging ... - mTradeHandler.AllowHedge(true); - mTradeHandler.HedgeMinVolumeStep(0.01); - mTradeHandler.MinimumOpenPositionsForHedge(2); - mTradeHandler.HedgeMinProfitPerVolumeStep(0.2); + ReConfigureTradeHandler(); // // Parsers ... @@ -1034,6 +1491,38 @@ class XC121SMCExpert : public XCBaseExpert } } + /** + * Re Configure Trade Handler ... + */ + void ReConfigureTradeHandler() + { + // + // Configure Alerts ... + mTradeHandler.SetAlertPrefix(GetTag()); + mTradeHandler.SetAlertEnableAlerts(GetAlertEnableAlerts()); + mTradeHandler.SetAlertLogAlerts(GetAlertLogAlerts()); + mTradeHandler.SetAlertMailAlerts(GetAlertMailAlerts()); + mTradeHandler.SetAlertPushAlerts(GetAlertPushAlerts()); + mTradeHandler.SetAlertTerminalAlerts(GetAlertTerminalAlerts()); + + // + mTradeHandler.AllowLong(AllowLong()); + mTradeHandler.AllowShort(AllowShort()); + mTradeHandler.MaxAllowedLongs(MaxAllowedLongs()); + mTradeHandler.MaxAllowedShorts(MaxAllowedShorts()); + mTradeHandler.UseMaxAllowedSignalsPerSymbol(UseMaxAllowedSignalsPerSymbol()); + mTradeHandler.LastPositionProfitForAcceptNextInPoint(LastPositionProfitForAcceptNextInPoint()); + mTradeHandler.DelaysBetweenTwoSignalsInBar(DelaysBetweenTwoSignalsInBar()); + mTradeHandler.MaxAllowedSpread(MaxAllowedSpread()); + mTradeHandler.MaxAllowedDrawdownToOpenTrades(MaxAllowedDrawdownToOpenTrades()); + mTradeHandler.MaxAllowedSLToPauseSignallingPerSymbol(MaxAllowedSLToPauseSignallingPerSymbol()); + mTradeHandler.PauseSignallingAfterReachesMaxAllowedSLInSecconds(PauseSignallingAfterReachesMaxAllowedSLInSecconds()); + mTradeHandler.AllowHedging(AllowHedging()); + mTradeHandler.MinOpenTradesFroHedging(MinOpenTradesFroHedging()); + mTradeHandler.HedgingMinVolumeStep(HedgingMinVolumeStep()); + mTradeHandler.HedgeingMinRequiredProfitPerVolumeStep(HedgeingMinRequiredProfitPerVolumeStep()); + } + // private: // @@ -1042,14 +1531,45 @@ class XC121SMCExpert : public XCBaseExpert // Props ... // - // Volume Management ... - double mR2R; // Signallers Risk to Reward Ratio ... - bool mUseDynamicVolume; // Use Dynamic Volume ... - double mDynamicVolumeStep; // Increase Volume Step ... - double mDynamicVolumeBalanceFactor; // Balance Factor for Generate Dynamic Volume ... - double mVolume; // Static Volume ... - bool mDynamicRiskManagement; // Dynamic Risk Management ... - double mRiskPercentPerBalance; // Risk Percent Per Balance in Each Trade ... + // Signalling Props ... + bool mAllowLong; // Allow Long Signals ... + bool mAllowShort; // Allow Short Signals ... + int mMaxAllowedLongs; // Max Allowed Long Signals ... + int mMaxAllowedShorts; // Max Allowed Short Signals ... + bool mUseMaxAllowedSignalsPerSymbol; // Use Max Allowed Signal Types Per Symbol ... + double mLastPositionProfitForAcceptNextInPoint; // Last Position Profit In Points for Accept new Signal ... + int mDelaysBetweenTwoSignalsInBar; // Delay between two Signals in Bars ... + double mMaxAllowedSpread; // Max Allowed Spread for Signalling ... + int mMinRequiredVerificationForSpreadPass; // Minimum Spread Verification for Signalling ... + + // + // Risk Management Props ... + double mR2R; // Signallers Risk to Reward Ratio ... + double mVolume; // Static Volume ... + double mRiskPercentPerBalance; // Risk Percent Per Balance in Each Trade ... + bool mDynamicRiskManagement; // Dynamic Risk Management ... + bool mUseDynamicVolume; // Use Dynamic Volume ... + double mDynamicVolumeStep; // Increase Volume Step ... + double mDynamicVolumeBalanceFactor; // Balance Factor for Generate Dynamic Volume ... + double mMaxAllowedDrawdownToOpenTrades; // Max Allowed Drawdown for Open Trades ... + int mMaxAllowedSLToPauseSignallingPerSymbol; // Max Allowed SL for Pause Signalling Per Symbol ... + int mPauseSignallingAfterReachesMaxAllowedSLInSecconds; // Pause Signalling Per Symbol afte Max Allowed SL Reached In Seconds ... + + // + // Protection Props ... + bool mAllowHedging; // Allow Hedge Positions ... + int mMinOpenTradesFroHedging; // Minimum Open Positions for Hedging ... + double mHedgingMinVolumeStep; // Minimum Volume Step for Hedging ... + double mHedgeingMinRequiredProfitPerVolumeStep; // Minimum Required Profit Per Volume Step for Hedging ... + + // + // Reconfigure Class On Properties Change ... + void ReConfigure() + { + // + ReConfigureTradeHandler(); + ReConfigureAllStrategies(); + } // double CalculateAdditionalVolumeMultiplier(XSignal &signal)