From 806fdeb4bb4479d1c86682cf626506dfd9f3b345 Mon Sep 17 00:00:00 2001 From: Hadi Khazaee Asl Date: Mon, 28 Apr 2025 19:59:13 +0330 Subject: [PATCH] last ... --- Libraries/x-saherelm.x-poi.lib.mq5 | 50 +++++++++++++++++++++++++ XCAEA/Libraries/xcaea.signaller.lib.mq5 | 31 +++++++++++---- XCAEA/Signals/xcaea.signaller.class.mq5 | 12 ++++-- 3 files changed, 81 insertions(+), 12 deletions(-) diff --git a/Libraries/x-saherelm.x-poi.lib.mq5 b/Libraries/x-saherelm.x-poi.lib.mq5 index 01de9cee..07fd176d 100644 --- a/Libraries/x-saherelm.x-poi.lib.mq5 +++ b/Libraries/x-saherelm.x-poi.lib.mq5 @@ -5569,6 +5569,56 @@ struct XBoxZone return result; } + /** + * Calculate Box Middle Price ... + * + * @return ( double ) + */ + double GetMid() + { + // + double result = 0; + + // + if (!IsValid()) + { + return result; + } + + // + double diffAvg = (upper - lower) / 2; + result = lower + diffAvg; + + // + return result; + } + + /** + * Extract Rejection Price based on Box Direction ... + * + * @return ( double ) + */ + double GetRejection() + { + // + double result = 0; + + // + if (!IsValid()) + { + return result; + } + + // + result = + IsBullish() + ? upper + : lower; + + // + return result; + } + /** * To Bar Index ... * diff --git a/XCAEA/Libraries/xcaea.signaller.lib.mq5 b/XCAEA/Libraries/xcaea.signaller.lib.mq5 index e91b8b94..a3ee8d8e 100644 --- a/XCAEA/Libraries/xcaea.signaller.lib.mq5 +++ b/XCAEA/Libraries/xcaea.signaller.lib.mq5 @@ -867,7 +867,7 @@ bool DetectXCAEAConditions( cBar, pBar, p2Bar, - true, // Ignore Mid Rejection ... + false, // Ignore Mid Rejection ... true, true // ); @@ -1032,6 +1032,16 @@ bool DetectXCAEAConditions( sls // ); + // + if (!isRejectedOnMid) + { + // + Add( + rejectedPivot.GetMid(), + sls // + ); + } + // // // // X3MA Medium ... // if (c3MAMedium < entry) @@ -1052,6 +1062,16 @@ bool DetectXCAEAConditions( sls // ); + // + if (!isRejectedOnMid) + { + // + Add( + rejectedPivot.GetMid(), + sls // + ); + } + // // // // X3MA Medium ... // if (c3MAMedium > entry) @@ -1308,15 +1328,10 @@ bool SelectRejectedBox( bool isBearish = iBox.IsBearish(); // - double boundaryPrice = - isBullish - ? iBox.upper - : iBox.lower; + double boundaryPrice = iBox.GetRejection(); // - double midPrice = - iBox.lower + - ((iBox.upper - iBox.lower) / 2); + double midPrice = iBox.GetMid(); // bool isMidBullishRejected = cBar.IsRejected( diff --git a/XCAEA/Signals/xcaea.signaller.class.mq5 b/XCAEA/Signals/xcaea.signaller.class.mq5 index 6ac30d12..9e247546 100644 --- a/XCAEA/Signals/xcaea.signaller.class.mq5 +++ b/XCAEA/Signals/xcaea.signaller.class.mq5 @@ -210,6 +210,10 @@ class XCXCAEASignaller : XCBase // // Draw Founded Pivots ... // drawer.Draw(cTime); + drawer.DrawPeakResSWHPivots(cTime); + drawer.DrawValeSupSWLPivots(cTime); + drawer.DrawFVGBullishPivots(cTime); + drawer.DrawFVGBearishPivots(cTime); // // Retrieve Valid Pviots ... @@ -878,8 +882,8 @@ class XCXCAEASignaller : XCBase detector.detectCCIValePivots = false; detector.detectFVGBullishPivots = true; detector.detectFVGBearishPivots = true; - detector.detectValeSupSWLPivots = false; - detector.detectPeakResSWHPivots = false; + detector.detectValeSupSWLPivots = true; + detector.detectPeakResSWHPivots = true; detector.detectTrendBullishPivots = true; detector.detectTrendBearishPivots = true; detector.detectCCICrossedOverOSPivots = false; @@ -906,8 +910,8 @@ class XCXCAEASignaller : XCBase drawer.drawCCIValePivots = false; drawer.drawFVGBullishPivots = true; drawer.drawFVGBearishPivots = true; - drawer.drawValeSupSWLPivots = false; - drawer.drawPeakResSWHPivots = false; + drawer.drawValeSupSWLPivots = true; + drawer.drawPeakResSWHPivots = true; drawer.drawTrendBullishPivots = false; drawer.drawTrendBearishPivots = false; drawer.drawRSICrossedOverOSPivots = false;