From de6e6d32e95e73be21c31b1d04bfdde3db69376e Mon Sep 17 00:00:00 2001 From: Hadi Khazaee Asl Date: Thu, 30 May 2024 15:14:24 +0330 Subject: [PATCH] last ... --- Classes/x-saherelm.x121.provider.class.mq5 | 56 ++++++++--- Classes/x-saherelm.x121.xmcycle.class.mq5 | 108 +++++++++++++++++++-- 2 files changed, 139 insertions(+), 25 deletions(-) diff --git a/Classes/x-saherelm.x121.provider.class.mq5 b/Classes/x-saherelm.x121.provider.class.mq5 index dbb3a7f7..4b325d09 100644 --- a/Classes/x-saherelm.x121.provider.class.mq5 +++ b/Classes/x-saherelm.x121.provider.class.mq5 @@ -8640,35 +8640,61 @@ private: int pIndex = cIndex + 1; // - bool hasCMarketConditions = cMarket.HasX121ShortConditions(); + bool cHasX121 = cMarket.HasX121ShortConditions(); + bool sHasX121 = sMarket.HasX121ShortConditions(); + bool mHasX121 = mMarket.HasX121ShortConditions(); + bool lHasX121 = lMarket.HasX121ShortConditions(); + bool hHasX121 = hMarket.HasX121ShortConditions(); // - if (hasCMarketConditions) + if (cHasX121) { - // - XOHCL cBar = cMarket.GetBar(cIndex); - - // - r2r = 1.5; - - // - sl = cBar.FindHighest( - 3, - MODE_HIGH // - ); + sl = cMarket.mrb.GetFast(cIndex); + } + else if (sHasX121) + { + sl = sMarket.mrb.GetFast(cIndex); + } + else if (mHasX121) + { + sl = mMarket.mrb.GetFast(cIndex); + } + else if (lHasX121) + { + sl = lMarket.mrb.GetFast(cIndex); + } + else if (hHasX121) + { + sl = hMarket.mrb.GetFast(cIndex); } // result = // - hasCMarketConditions + cHasX121 + // + || + // + sHasX121 + // + || + // + mHasX121 + // + || + // + lHasX121 + // + || + // + hHasX121 // ; // if (result) { - Print("Salam"); + r2r = 1.5; } // diff --git a/Classes/x-saherelm.x121.xmcycle.class.mq5 b/Classes/x-saherelm.x121.xmcycle.class.mq5 index 9f4855db..54cbd946 100644 --- a/Classes/x-saherelm.x121.xmcycle.class.mq5 +++ b/Classes/x-saherelm.x121.xmcycle.class.mq5 @@ -6341,16 +6341,104 @@ public: // ; - // // - // result = - // // - // (isMRBFastCrossedUnderSlow && - // (isCHEBearish && - // isTrendBearish && - // isMCFastUnderSlow && - // isMCFastUnderVerifier)) - // // - // ; + // + // Combine MRB and MC ... + + // + bool isCMRBFastOverVerifier = cMRBFast > cMCVerifier; + bool isPMRBFastOverVerifier = pMRBFast > pMCVerifier; + + // + bool isCMRBFastUnderVerifier = cMRBFast < cMCVerifier; + bool isPMRBFastUnderVerifier = pMRBFast < pMCVerifier; + + // + bool isCMRBSlowOverVerifier = cMRBSlow > cMCVerifier; + bool isPMRBSlowOverVerifier = pMRBSlow > pMCVerifier; + + // + bool isCMRBSlowUnderVerifier = cMRBSlow < cMCVerifier; + bool isPMRBSlowUnderVerifier = pMRBSlow < pMCVerifier; + + // + bool isMRBFastOverVerifier = isCMRBFastOverVerifier; + bool isMRBFastUnderVerifier = isCMRBFastUnderVerifier; + + // + bool isMRBFastCrossedtOverVerifier = + // + isCMRBFastOverVerifier && + !isPMRBFastOverVerifier + // + ; + + // + bool isMRBFastCrossedUnderVerifier = + // + isCMRBFastUnderVerifier && + !isPMRBFastUnderVerifier + // + ; + + // + bool isMRBSlowOverVerifier = isCMRBSlowOverVerifier; + bool isMRBSlowUnderVerifier = isCMRBSlowUnderVerifier; + + // + bool isMRBSlowCrossedtOverVerifier = + // + isCMRBSlowOverVerifier && + !isPMRBSlowOverVerifier + // + ; + + // + bool isMRBSlowCrossedUnderVerifier = + // + isCMRBSlowUnderVerifier && + !isPMRBSlowUnderVerifier + // + ; + + // + result = + // + (isMRBFastCrossedUnderSlow && + (isCHEBearish && + isTrendBearish && + isMCFastUnderSlow)) + // + || + // + (isMRBSlowCrossedUnderVerifier && + (isCHEBearish && + isTrendBearish && + isMCFastUnderSlow && + isMRBFastUnderSlow)) + // + || + // + (isCHESwitchedToBearish && + (isTrendBearish && + isMCFastUnderSlow && + isMRBFastUnderSlow)) + // + || + // + (isTrendSwitchedToBearish && + (isCHEBearish && + isMCFastUnderSlow && + isMRBFastUnderSlow)) + // + || + // + (isMCFastCrossedUnderSlow && + (isCHEBearish && + isTrendBearish && + isMRBFastUnderSlow && + isMCSlowUnderVerifier)) + // + ; // return result;