From 22605f46b65184b991f368077010aedee35bf095 Mon Sep 17 00:00:00 2001 From: Hadi Khazaee Asl Date: Thu, 1 May 2025 12:55:43 +0330 Subject: [PATCH] last ... --- Indicators/x-saherelm.x121.xca.mq5 | 2 +- XCAEA/Classes/xcaea.x-poi.detector.class.mq5 | 18 +++ XCAEA/Libraries/xcaea.signaller.lib.mq5 | 120 +++++++++++++++---- XCAEA/Signals/xcaea.signaller.class.mq5 | 27 +++-- 4 files changed, 135 insertions(+), 32 deletions(-) diff --git a/Indicators/x-saherelm.x121.xca.mq5 b/Indicators/x-saherelm.x121.xca.mq5 index 6810e544..4169373c 100644 --- a/Indicators/x-saherelm.x121.xca.mq5 +++ b/Indicators/x-saherelm.x121.xca.mq5 @@ -704,7 +704,7 @@ int OnInit() _Period, mHCLength, 0, - MODE_EMA, + MODE_SMA, PRICE_CLOSE // ); isInited = trendHandler != INVALID_HANDLE; diff --git a/XCAEA/Classes/xcaea.x-poi.detector.class.mq5 b/XCAEA/Classes/xcaea.x-poi.detector.class.mq5 index 2edbc2ce..2a279608 100644 --- a/XCAEA/Classes/xcaea.x-poi.detector.class.mq5 +++ b/XCAEA/Classes/xcaea.x-poi.detector.class.mq5 @@ -2917,6 +2917,24 @@ class XCXCAEAPOIDetector : public XCBase } } + // + bool detectBullishSpikePivots = true; + if (detectBullishSpikePivots) { + // + // For Spike Detection ... + // [] 80% of Bars Must be Same as Direction ... + // [] Price Range of Bars Must be Passed of atr mult ... + // [] Required Volume Processing if Neccessary ... + + // + bool startCondition = false; + bool continuationCondition = false; + bool endCondition = false; + + // + // TODO: Complete this ... + } + // start++; diff --git a/XCAEA/Libraries/xcaea.signaller.lib.mq5 b/XCAEA/Libraries/xcaea.signaller.lib.mq5 index 0187c4e6..bfdff0b6 100644 --- a/XCAEA/Libraries/xcaea.signaller.lib.mq5 +++ b/XCAEA/Libraries/xcaea.signaller.lib.mq5 @@ -714,6 +714,20 @@ bool DetectXCAEAConditions( double pVale = conditions.valeBuffer[pIDX]; double p2Vale = conditions.valeBuffer[p2IDX]; + // + // PEAKGOLDEN ... + double zPeakGolden = conditions.peakGoldenBuffer[zIDX]; + double cPeakGolden = conditions.peakGoldenBuffer[cIDX]; + double pPeakGolden = conditions.peakGoldenBuffer[pIDX]; + double p2PeakGolden = conditions.peakGoldenBuffer[p2IDX]; + + // + // VALEGOLDEN ... + double zValeGolden = conditions.valeGoldenBuffer[zIDX]; + double cValeGolden = conditions.valeGoldenBuffer[cIDX]; + double pValeGolden = conditions.valeGoldenBuffer[pIDX]; + double p2ValeGolden = conditions.valeGoldenBuffer[p2IDX]; + // // SUPPORT ... double zSupport = conditions.supportBuffer[zIDX]; @@ -784,6 +798,13 @@ bool DetectXCAEAConditions( double pCCI = conditions.cciBuffer[pIDX]; double p2CCI = conditions.cciBuffer[p2IDX]; + // + // ATR ... + double zATR = conditions.atrBuffer[zIDX]; + double cATR = conditions.atrBuffer[cIDX]; + double pATR = conditions.atrBuffer[pIDX]; + double p2ATR = conditions.atrBuffer[p2IDX]; + // // ADX ... double zADX = conditions.adxBuffer[zIDX]; @@ -956,6 +977,38 @@ bool DetectXCAEAConditions( bool isADXSwitchedToBearish = isADXBearish && !isADXBearishPrev; + // + double barStrongAtrMult = 1.5; + + // + bool isCBarRangeHasStrongATR = + cBar.GetRange() > cATR * barStrongAtrMult; + + // + bool isCBarBodyHasStrongATR = + cBar.GetBody() > cATR * barStrongAtrMult; + + // + bool isCBarHasStrongATR = isCBarRangeHasStrongATR && + isCBarBodyHasStrongATR; + + // + bool isCBarIsStrongBullish = + isCBarHasStrongATR && + cBar.IsBullish(); + + // + bool isCBarIsStrongBearish = + isCBarHasStrongATR && + cBar.IsBearish(); + + // + if (isCBarHasStrongATR) + { + // + Print(ToString(cBar.GetDirection()), " ATR Growing ..."); + } + // bool isLowOverMax = cBar.low > maxCTrendValue; bool isHighUnderMin = cBar.high < minCTrendValue; @@ -972,6 +1025,16 @@ bool DetectXCAEAConditions( bool isTrendRangeFinishedFromValid = !isCTrendRangeValid && isPTrendRangeValid; + // + bool isPeakGoldenRejected = + cBar.high > cPeakGolden && + cBar.GetUp() <= cPeakGolden; + + // + bool isValeGoldenRejected = + cBar.low < cValeGolden && + cBar.GetDown() >= cValeGolden; + // bool isX3MaBullishState = // @@ -1271,20 +1334,25 @@ bool DetectXCAEAConditions( // // false && // - isPRSIOS && - isPCCIOS && - isRSIBullish && - isCCIBullish && + z3MAFastState > 0 && + isValeGoldenRejected && + isCBarBullishRejected && + conditions.isValeIsPivot + // + // isPCCIOS && + // isRSIBullish && + // conditions.isCloseUnderMal + // rciPivot.IsValid() && + // rciPivot.IsBullish() && + // isCCIBullish && + // cBar.close > c3MAFast // isADXBullish && // hasRCIContainers && - rciPivot.IsValid() && - rciPivot.IsBullish() && - // conditions.isUnderMal && // conditions.isValeIsPivot && - (conditions.isRSICrossedOverOS || - conditions.isCCICrossedOverOS) // && + // (conditions.isRSICrossedOverOS || + // conditions.isCCICrossedOverOS) // && // conditions.swingLowBuffer[cIDX] < conditions.fiboLevel3Buffer[cIDX] - // + // // ; // @@ -1292,20 +1360,27 @@ bool DetectXCAEAConditions( // // false && // - isPRSIOB && - isPCCIOB && - isRSIBearish && - isCCIBearish && + z3MAFastState < 0 && + isPeakGoldenRejected && + isCBarBullishRejected && + conditions.isPeakIsPivot + // + // isPCCIOB && + // isRSIBearish && + // c3MAFastState < 0 && + // conditions.isCloseOverMah + // rciPivot.IsValid() && + // rciPivot.IsBearish() && + // conditions.isRSIOB && + // isCCIBearish && + // cBar.close < c3MAFast // isADXBearish && // hasRCIContainers && - rciPivot.IsValid() && - rciPivot.IsBearish() && - // conditions.isOverMal && // conditions.isPeakIsPivot && - (conditions.isRSICrossedUnderOB || - conditions.isCCICrossedUnderOB) // && + // (conditions.isRSICrossedUnderOB || + // conditions.isCCICrossedUnderOB) // && // conditions.swingHighBuffer[cIDX] > conditions.fiboLevel1Buffer[cIDX] - // + // // ; // @@ -1313,7 +1388,12 @@ bool DetectXCAEAConditions( isCond2Bearish; if (isCond2) { + // pivotBox = rciPivot; + + // + isCond2Bullish = false; + isCond2Bearish = false; } // diff --git a/XCAEA/Signals/xcaea.signaller.class.mq5 b/XCAEA/Signals/xcaea.signaller.class.mq5 index 4d9f7ef2..ca02b0c7 100644 --- a/XCAEA/Signals/xcaea.signaller.class.mq5 +++ b/XCAEA/Signals/xcaea.signaller.class.mq5 @@ -215,9 +215,11 @@ class XCXCAEASignaller : XCBase // drawer.DrawFVGBullishPivots(cTime); // drawer.DrawFVGBearishPivots(cTime); // drawer.DrawRSICrossedOverOSPivots(cTime); + // drawer.DrawRSICrossedUnderOBPivots(cTime); // drawer.DrawPeakResSWHPivots(cTime); // drawer.DrawValeSupSWLPivots(cTime); - // drawer.DrawRSICrossedUnderOBPivots(cTime); + drawer.DrawRSIPeakPivots(cTime); + drawer.DrawRSIValePivots(cTime); // // Retrieve Valid Pviots ... @@ -814,7 +816,10 @@ class XCXCAEASignaller : XCBase inputs.x3maInputs.applyColor = true; // - inputs.x3maInputs.showFast = false; + inputs.x3maInputs.fastLength = 5; + + // + inputs.x3maInputs.showFast = true; inputs.x3maInputs.showSlow = false; inputs.x3maInputs.showMedium = false; @@ -836,14 +841,14 @@ class XCXCAEASignaller : XCBase inputs.caInputs.showShortCycle = false; inputs.caInputs.showMediumCycle = false; inputs.caInputs.showPeaksAndVales = true; - inputs.caInputs.showPeakAndValeGolden = false; + inputs.caInputs.showPeakAndValeGolden = true; inputs.caInputs.showSupportAndResistance = true; // // XOSCS ... - // inputs.oscsInputs.rsiLength = 4; - // inputs.oscsInputs.rsiOBLevel = 90; - // inputs.oscsInputs.rsiOSLevel = 10; + inputs.oscsInputs.rsiLength = 5; + inputs.oscsInputs.rsiOBLevel = 90; + inputs.oscsInputs.rsiOSLevel = 10; // inputs.oscsInputs.cciLength = 7; // inputs.oscsInputs.cciOBLevel = 130; // inputs.oscsInputs.cciOSLevel = -130; @@ -852,7 +857,7 @@ class XCXCAEASignaller : XCBase // // Oscillators Views ... - inputs.showRSI = false; + inputs.showRSI = true; inputs.showCCI = false; inputs.showMFI = false; inputs.showRVI = false; @@ -883,8 +888,8 @@ class XCXCAEASignaller : XCBase // Configure Detector ... detector.detectTickPivots = false; detector.detectVolumePivots = false; - detector.detectRSIPeakPivots = false; - detector.detectRSIValePivots = false; + detector.detectRSIPeakPivots = true; + detector.detectRSIValePivots = true; detector.detectCCIPeakPivots = false; detector.detectCCIValePivots = false; detector.detectFVGBullishPivots = true; @@ -911,8 +916,8 @@ class XCXCAEASignaller : XCBase drawer.drawTrendLine = false; drawer.drawTickPivots = false; drawer.drawVolumePivots = false; - drawer.drawRSIPeakPivots = false; - drawer.drawRSIValePivots = false; + drawer.drawRSIPeakPivots = true; + drawer.drawRSIValePivots = true; drawer.drawCCIPeakPivots = false; drawer.drawCCIValePivots = false; drawer.drawFVGBullishPivots = true;