From 2d24c65ddad2b71d4f0c8a12be08d486dc5846e5 Mon Sep 17 00:00:00 2001 From: Hadi Khazaee Asl Date: Tue, 29 Apr 2025 02:57:02 +0330 Subject: [PATCH] last ... --- XCAEA/Libraries/xcaea.signaller.lib.mq5 | 91 ++++++++++++++++++++++++- 1 file changed, 89 insertions(+), 2 deletions(-) diff --git a/XCAEA/Libraries/xcaea.signaller.lib.mq5 b/XCAEA/Libraries/xcaea.signaller.lib.mq5 index d90d6cce..c17c6532 100644 --- a/XCAEA/Libraries/xcaea.signaller.lib.mq5 +++ b/XCAEA/Libraries/xcaea.signaller.lib.mq5 @@ -741,6 +741,34 @@ bool DetectXCAEAConditions( double pSwingHigh = conditions.swingHighBuffer[pIDX]; double p2SwingHigh = conditions.swingHighBuffer[p2IDX]; + // + // TREND ... + double zTrend = conditions.trendBuffer[zIDX]; + double cTrend = conditions.trendBuffer[cIDX]; + double pTrend = conditions.trendBuffer[pIDX]; + double p2Trend = conditions.trendBuffer[p2IDX]; + + // + // KI ... + double zKI = conditions.kiBuffer[zIDX]; + double cKI = conditions.kiBuffer[cIDX]; + double pKI = conditions.kiBuffer[pIDX]; + double p2KI = conditions.kiBuffer[p2IDX]; + + // + // TKI ... + double zTKI = conditions.tkiBuffer[zIDX]; + double cTKI = conditions.tkiBuffer[cIDX]; + double pTKI = conditions.tkiBuffer[pIDX]; + double p2TKI = conditions.tkiBuffer[p2IDX]; + + // + // VIDYA ... + double zVIDYA = conditions.vidyaBuffer[zIDX]; + double cVIDYA = conditions.vidyaBuffer[cIDX]; + double pVIDYA = conditions.vidyaBuffer[pIDX]; + double p2VIDYA = conditions.vidyaBuffer[p2IDX]; + // // X3MA ... @@ -797,6 +825,58 @@ bool DetectXCAEAConditions( double x3maBearishGapUpper = c3MASlow; double x3maBearishGapLower = c3MAMedium; + // + double cTrendValues[7] = { + cKI, + cTKI, + cTrend, + cVIDYA, + c3MAFast, + c3MASlow, + c3MAMedium, + }; + double pTrendValues[7] = { + pKI, + pTKI, + pTrend, + pVIDYA, + p3MAFast, + p3MASlow, + p3MAMedium, + }; + + // + double minCTrendValue = GetMin(cTrendValues); + double maxCTrendValue = GetMax(cTrendValues); + + // + double minPTrendValue = GetMin(pTrendValues); + double maxPTrendValue = GetMax(pTrendValues); + + // + double cTrendValuesRange = (maxCTrendValue - minCTrendValue); + double cTrendValuesRangePoint = (cTrendValuesRange / points); + + // + double pTrendValuesRange = (maxPTrendValue - minPTrendValue); + double pTrendValuesRangePoint = (pTrendValuesRange / points); + + // + bool isLowOverMax = cBar.low > maxCTrendValue; + bool isHighUnderMin = cBar.high < minCTrendValue; + bool isCloseOverMax = cBar.close > maxCTrendValue; + bool isCloseUnderMin = cBar.close < minCTrendValue; + + // + bool isCTrendRangeValid = cTrendValuesRangePoint <= 50; + bool isPTrendRangeValid = pTrendValuesRangePoint <= 50; + + // + bool isTrendRangeSwitchedToValid = isCTrendRangeValid && + !isPTrendRangeValid; + bool isTrendRangeFinishedFromValid = !isCTrendRangeValid && + isPTrendRangeValid; + // // Create Conditions ... @@ -928,7 +1008,7 @@ bool DetectXCAEAConditions( // bool isCond1Bullish = // - // false && // TODO: Remove this ... + false && // TODO: Remove this ... isVolumeOverAvg && isVolumeOverLast && conditions.isSarBullish && @@ -941,7 +1021,7 @@ bool DetectXCAEAConditions( // bool isCond1Bearish = // - // false && // TODO: Remove this ... + false && // TODO: Remove this ... isVolumeOverAvg && isVolumeOverLast && conditions.isSarBearish && @@ -977,12 +1057,17 @@ bool DetectXCAEAConditions( // // false && // + isVolumeOverAvg && + isVolumeBullish && + isVolumeOverLast && c3MASlowState > 0 && c3MAMediumState > 0 && cBar.GetUp() > pSar && conditions.isFastOverSlow && conditions.isVidyaBullish && conditions.isFastOverMedium && + isTrendRangeFinishedFromValid && + conditions.isSwingHighOverLast && conditions.isSarSwitchedToBullish // // @@ -1214,6 +1299,8 @@ bool DetectXCAEAConditions( p2Bar.Clean(); p3Bar.Clean(); p4Bar.Clean(); + Clean(cTrendValues); + Clean(pTrendValues); Clean(insidePivots); pConditions.Clean(); rejectedPivot.Clean();