diff --git a/Classes/x-saherelm.xtrade.class.mq5 b/Classes/x-saherelm.xtrade.class.mq5 index eba5d75c..a587b1b7 100644 --- a/Classes/x-saherelm.xtrade.class.mq5 +++ b/Classes/x-saherelm.xtrade.class.mq5 @@ -4100,6 +4100,12 @@ public: mSaveTrades = value; } + // + int MaxSameTimeTrades() + { + return maxSameTimeTrades; + } + // // Trailling ... @@ -4424,6 +4430,13 @@ public: mData[idx].Update(iPosition); } } + + // + count = Count(); + if (count > maxSameTimeTrades) + { + maxSameTimeTrades = count; + } } // @@ -4727,6 +4740,7 @@ protected: private: // // Props ... + int maxSameTimeTrades; // Max Same Time Trades // // Count Data ... diff --git a/Strategies/x-saherelm.xemrng.strategy.mq5 b/Documents/BKP/Old/Strategies/x-saherelm.xemrng.strategy.mq5 similarity index 100% rename from Strategies/x-saherelm.xemrng.strategy.mq5 rename to Documents/BKP/Old/Strategies/x-saherelm.xemrng.strategy.mq5 diff --git a/Strategies/x-saherelm.xobvg.strategy.mq5 b/Documents/BKP/Old/Strategies/x-saherelm.xobvg.strategy.mq5 similarity index 100% rename from Strategies/x-saherelm.xobvg.strategy.mq5 rename to Documents/BKP/Old/Strategies/x-saherelm.xobvg.strategy.mq5 diff --git a/Strategies/x-saherelm.xpvfmc.strategy.mq5 b/Documents/BKP/Old/Strategies/x-saherelm.xpvfmc.strategy.mq5 similarity index 100% rename from Strategies/x-saherelm.xpvfmc.strategy.mq5 rename to Documents/BKP/Old/Strategies/x-saherelm.xpvfmc.strategy.mq5 diff --git a/Strategies/x-saherelm.xsrbr.strategy.mq5 b/Documents/BKP/Old/Strategies/x-saherelm.xsrbr.strategy.mq5 similarity index 100% rename from Strategies/x-saherelm.xsrbr.strategy.mq5 rename to Documents/BKP/Old/Strategies/x-saherelm.xsrbr.strategy.mq5 diff --git a/Strategies/x-saherelm.xtdpvlmtrtm.strategy.mq5 b/Documents/BKP/Old/Strategies/x-saherelm.xtdpvlmtrtm.strategy.mq5 similarity index 100% rename from Strategies/x-saherelm.xtdpvlmtrtm.strategy.mq5 rename to Documents/BKP/Old/Strategies/x-saherelm.xtdpvlmtrtm.strategy.mq5 diff --git a/Experts/x-test-strategies.ea.mq5 b/Experts/x-test-strategies.ea.mq5 index 22194b77..bce27dc6 100644 --- a/Experts/x-test-strategies.ea.mq5 +++ b/Experts/x-test-strategies.ea.mq5 @@ -126,6 +126,10 @@ void OnDeinit(const int reason) // REASON_INITFAILED 8 The OnInit() handler returned a non-zero value // REASON_CLOSE 9 Terminal closed + // + string msg = "MaxSameTimeTrades: " + ToString(eaTradeHandler.MaxSameTimeTrades()); + eaAlert.Alert(msg); + // // De Initialize XSampleEA Providers ... delete mCTHelper; @@ -234,16 +238,23 @@ bool InitialEA() eaTrader.AddOnForceClosePositionEventHandler(OnPositionForceClosed); // + // Initialize Trade Handler ... eaTradeHandler = new XSCXTradeHandler(eaTrader); eaTradeHandler.SetAlertPrefix(ShortName + "> TradeHandler"); eaTradeHandler.SaveTrades(true); eaTradeHandler.SaveSignals(true); + // + // Configure Hedging ... + eaTradeHandler.AllowHedging(true); + eaTradeHandler.HedgeVolumeFactor(eaVolume); + eaTradeHandler.HedgeMinProfitPerVolumeFactor(0.2); + // // Configure Trailing ... eaTradeHandler.AllowTrailStops(false); - eaTradeHandler.TrailStepInPoint(10); - eaTradeHandler.TrailStartInPoint(30); + eaTradeHandler.TrailStepInPoint(15); + eaTradeHandler.TrailStartInPoint(60); eaTradeHandler.IgnoreTPOnTrail(true); eaTradeHandler.TrailBasedOnProfit(true); @@ -284,18 +295,18 @@ bool InitialEA() XSCXTestStrategy *eurusdTestStrategy; eurusdTestStrategy = new XSCXTestStrategy( eurusdSymbol, - PERIOD_M5, + PERIOD_M15, eaVolume, eaR2R, // R2R ... eaSlippage, magicNumber, - true, // Ignore Signal Execution - true, // Use TP SL Point - false, // Use Max - 50, // eaTPPoint, // TP + true, // Ignore Signal Execution + true, // Use TP SL Point + false, // Use Max + eaTPPoint, // TP eaSLPoint, // SL eaIgnoreTP, - true, // eaIgnoreSL, + eaIgnoreSL, eaAllowLong, eaAllowShort, eaMaxAllowedLongs, // Max Longs diff --git a/Strategies/x-saherelm.xtest.strategy.mq5 b/Strategies/x-saherelm.xtest.strategy.mq5 index 00e64ccc..99defb20 100644 --- a/Strategies/x-saherelm.xtest.strategy.mq5 +++ b/Strategies/x-saherelm.xtest.strategy.mq5 @@ -588,8 +588,8 @@ public: // hasLong = // - isBullishTrend && - cBar.IsBullish() && + // isBullishTrend && + // cBar.IsBullish() && hasBullishPattern && hkConditions.isSMHKBullish && chmaConditions.isFastOverSlow @@ -641,8 +641,8 @@ public: // hasShort = // - isBearishTrend && - cBar.IsBearish() && + // isBearishTrend && + // cBar.IsBearish() && hasBearishPattern && hkConditions.isSMHKBearish && chmaConditions.isFastUnderSlow