diff --git a/Classes/x-saherelm.x121.setup.xea.mq5 b/Classes/x-saherelm.x121.setup.xea.mq5 index 10784acf..8faf5be4 100644 --- a/Classes/x-saherelm.x121.setup.xea.mq5 +++ b/Classes/x-saherelm.x121.setup.xea.mq5 @@ -4387,11 +4387,13 @@ private: } // - double profit = SpecifiedCalculatePositionsProfit(positions); + double profit = SpecifiedIsPositionsReadyForHedge( + positions, + 0.15, + 0.01 // + ); result = - hedgingProfit > 0 - ? profit > 0 && profit > hedgingProfit - : profit <= hedgingProfit; + profit > hedgingProfit; if (!result) { return result; @@ -4528,22 +4530,22 @@ private: return; } - // - isHedged = DoEQMForceClose(0.5); - if (isHedged) - { - // - ForceState(false); - return; - } + // // + // isHedged = DoEQMForceClose(0.5); + // if (isHedged) + // { + // // + // ForceState(false); + // return; + // } - isHedged = DoEQMForceClose(0.3); - if (isHedged) - { - // - ForceState(false); - return; - } + // isHedged = DoEQMForceClose(0.3); + // if (isHedged) + // { + // // + // ForceState(false); + // return; + // } // return; diff --git a/Experts/x-saherelm.x121.ea.mq5 b/Experts/x-saherelm.x121.ea.mq5 index 2b956dec..9c02f16e 100644 --- a/Experts/x-saherelm.x121.ea.mq5 +++ b/Experts/x-saherelm.x121.ea.mq5 @@ -73,27 +73,27 @@ input double x121EANextTrailPoint = 20; // Next Trailling Step // input group "Supporting"; -input bool x121EAAllowSupport = false; // Allow Support Signals -double x121EASupportDistance = 50; // Supporting Distance -input int x121EAMaxNumberOfSupports = 1; // Max Number of Support Signals -input double x121EASupportVolumeMultiplier = 2.0; // Support Signals Volume Multiplier -input double x121EAMaxAllowedSupportVolume = 0.8; // Max Allowed Support Signals Volume +input bool x121EAAllowSupport = false; // Allow Support Signals +double x121EASupportDistance = 50; // Supporting Distance +input int x121EAMaxNumberOfSupports = 1; // Max Number of Support Signals +input double x121EASupportVolumeMultiplier = 2.0; // Support Signals Volume Multiplier +input double x121EAMaxAllowedSupportVolume = 0.04; // Max Allowed Support Signals Volume // input group "Grid"; -input bool x121EAAllowGrid = true; // Allow Grid Signals -input int x121EAMaxNumberOfGrids = 5; // Max Number of Grid Signals -input double x121EAGridDistance = 100; // Grid Distance -input double x121EAGridVolumeMultiplier = 2.0; // Grid Volume Multiplier -input double x121EAMaxAllowedGridVolume = 0.8; // Max Allowed Grid Signals Volume +input bool x121EAAllowGrid = true; // Allow Grid Signals +input int x121EAMaxNumberOfGrids = 5; // Max Number of Grid Signals +input double x121EAGridDistance = 100; // Grid Distance +input double x121EAGridVolumeMultiplier = 2.0; // Grid Volume Multiplier +input double x121EAMaxAllowedGridVolume = 0.04; // Max Allowed Grid Signals Volume // input group "Recovery"; -input bool x121EAAllowRecovery = true; // Allow Recovery Signals -input int x121EAMaxNumberOfRecoveries = 3; // Max Number of Recovery Signals -input double x121EARecoveryDistance = 100; // Recovery Distance -input double x121EARecoveryVolumeMultiplier = 2; // Recovery Volume Multiplier -input double x121EAMaxAllowedRecoveryVolume = 0.8; // Max Allowed Recovery Signals Volume +input bool x121EAAllowRecovery = true; // Allow Recovery Signals +input int x121EAMaxNumberOfRecoveries = 3; // Max Number of Recovery Signals +input double x121EARecoveryDistance = 100; // Recovery Distance +input double x121EARecoveryVolumeMultiplier = 2; // Recovery Volume Multiplier +input double x121EAMaxAllowedRecoveryVolume = 0.08; // Max Allowed Recovery Signals Volume // input group "Hedging";