diff --git a/Classes/x-saherelm.x121.xtrade.handler.class.mq5 b/Classes/x-saherelm.x121.xtrade.handler.class.mq5 index 21044ed4..641df2a6 100644 Binary files a/Classes/x-saherelm.x121.xtrade.handler.class.mq5 and b/Classes/x-saherelm.x121.xtrade.handler.class.mq5 differ diff --git a/Experts/x-saherelm.x121.ea.mq5 b/Experts/x-saherelm.x121.ea.mq5 index f3c429c2..57882902 100644 --- a/Experts/x-saherelm.x121.ea.mq5 +++ b/Experts/x-saherelm.x121.ea.mq5 @@ -93,7 +93,8 @@ input double eaMaxDrawdownPercentForOpenTrades = 3; // Max Drawdown Percent for // Protector ... input group "Protector"; input bool eaUseForceMomentumsInProtection = false; // Use Force Momentums In Protection; -input int eaDelayBarBetweenTwoSameSignal = 5; // Delay Bars Between Two Same Type Signal +input int eaDelayBarBetweenTwoSignal = 5; // Delay Bars Between Two Signal +input double mAcceptNextSameTypeSignalWhenLastInProfit = 50; // Accept Next Same Type Signal When Last in Profit in Point // // Protector > Hedging Properties ... @@ -114,6 +115,7 @@ input group "Trail"; input bool eaAllowTrail = true; // Allow Trail Stop for Positions input double eaTrailStartDistance = 35; // Specify Trail Start in Point input double eaTrailStep = 10; // Trail Step in Point +input int eaRemoveTPAfterTrailedLevel = 4; // Remove Trailed Position TP after Level input bool eaOnlyTrailUnprotected = true; // Only Trail Unprotected Positionss // @@ -586,7 +588,7 @@ bool InitEA() // eaTradeHandler.UseForceMomentumsInProtection(eaUseForceMomentumsInProtection); - eaTradeHandler.DelayBarBetweenTwoSameSignal(eaDelayBarBetweenTwoSameSignal); + eaTradeHandler.DelayBarBetweenTwoSignal(eaDelayBarBetweenTwoSignal); // // Configure Hedging ... @@ -602,9 +604,10 @@ bool InitEA() // // Trail ... eaTradeHandler.AllowTrail(eaAllowTrail); - eaTradeHandler.TrailStartDistance(eaTrailStartDistance); eaTradeHandler.TrailStep(eaTrailStep); + eaTradeHandler.TrailStartDistance(eaTrailStartDistance); eaTradeHandler.OnlyTrailUnprotected(eaOnlyTrailUnprotected); + eaTradeHandler.RemoveTPAfterTrailedLevel(eaRemoveTPAfterTrailedLevel); // // Partial Close (In Profit) ... @@ -816,15 +819,15 @@ bool InitEA() // // Register XICHWAP Strategy ... - // - bool isEURUSD = _symbolParser.IsEURUSD(_Symbol); - bool isGBPUSD = _symbolParser.IsGBPUSD(_Symbol); - bool isUSDCHF = _symbolParser.IsUSDCHF(_Symbol); - bool isUSDJPY = _symbolParser.IsUSDJPY(_Symbol); - bool canRegisterICHWAP = isEURUSD || - isGBPUSD || - isUSDCHF || - isUSDJPY; + // + bool isEURUSD = _symbolParser.IsEURUSD(_Symbol); + bool isGBPUSD = _symbolParser.IsGBPUSD(_Symbol); + bool isUSDCHF = _symbolParser.IsUSDCHF(_Symbol); + bool isUSDJPY = _symbolParser.IsUSDJPY(_Symbol); + bool canRegisterICHWAP = isEURUSD || + isGBPUSD || + isUSDCHF || + isUSDJPY; if (canRegisterICHWAP) { // @@ -1353,7 +1356,7 @@ void OnSignalRecieved( // // Check Signal Delay ... datetime currentTime = TimeCurrent(); - int delay = eaDelayBarBetweenTwoSameSignal; + int delay = eaDelayBarBetweenTwoSignal; bool isDelayPassed = delay <= 0 ? true : !IsValid(lastSignalOn) diff --git a/Libraries/x-saherelm.xtrade.lib.mq5 b/Libraries/x-saherelm.xtrade.lib.mq5 index 5985c04a..c0f0128a 100644 --- a/Libraries/x-saherelm.xtrade.lib.mq5 +++ b/Libraries/x-saherelm.xtrade.lib.mq5 @@ -527,26 +527,6 @@ struct XPosition return result; } - // - // Find Risk ... - double GetRisk() - { - // - double result = 0; - - // - if (!IsValid()) - { - return 0; - } - - // - result = MathAbs(entry - sl); - - // - return result; - } - // double GetPointsValue() { @@ -591,6 +571,26 @@ struct XPosition return result; } + // + // Find Risk ... + double GetRisk() + { + // + double result = 0; + + // + if (!IsValid()) + { + return 0; + } + + // + result = MathAbs(entry - sl); + + // + return result; + } + // // Find Reward ... double GetReward() @@ -611,6 +611,18 @@ struct XPosition return result; } + // + double GetRewardInPoint() { + // + double result = 0; + + // + result = GetReward() / GetPoints(); + + // + return result; + } + // // Find Risk Reward Ratio ... double GetRiskRewardRatio()