diff --git a/Helpers/x-saherelm.x121.x3ma.helper.mq5 b/Helpers/x-saherelm.x121.x3ma.helper.mq5 index b03a004f..75225c3b 100644 --- a/Helpers/x-saherelm.x121.x3ma.helper.mq5 +++ b/Helpers/x-saherelm.x121.x3ma.helper.mq5 @@ -246,6 +246,34 @@ struct X121X3MAConditions bool isMediumCrossedOverSlow; bool isMediumCrossedUnderSlow; + // + bool is3MaBullishOrdered; + bool is3MaBearishOrdered; + + // + bool is3MaSwitchedToBullishOrdered; + bool is3MaSwitchedToBearishOrdered; + + // + bool is3MaBullishState; + bool is3MaBearishState; + + // + bool is3MaSwitchedToBullishState; + bool is3MaSwitchedToBearishState; + + // + bool is3MaBullish; + bool is3MaBearish; + + // + bool is3MaSwitchedToBullish; + bool is3MaSwitchedToBearish; + + // + bool is3MaFinishedFromBullish; + bool is3MaFinishedFromBearish; + // // Constructor ... X121X3MAConditions() @@ -312,6 +340,34 @@ struct X121X3MAConditions // isMediumCrossedOverSlow = false; isMediumCrossedUnderSlow = false; + + // + is3MaBullishOrdered = false; + is3MaBearishOrdered = false; + + // + is3MaSwitchedToBullishOrdered = false; + is3MaSwitchedToBearishOrdered = false; + + // + is3MaBullishState = false; + is3MaBearishState = false; + + // + is3MaSwitchedToBullishState = false; + is3MaSwitchedToBearishState = false; + + // + is3MaBullish = false; + is3MaBearish = false; + + // + is3MaSwitchedToBullish = false; + is3MaSwitchedToBearish = false; + + // + is3MaFinishedFromBullish = false; + is3MaFinishedFromBearish = false; } /** @@ -360,6 +416,36 @@ struct X121X3MAConditions bullishScore += score; } + // + if (is3MaBullish) + { + bullishScore += minScore; + } + if (is3MaBullishState) + { + bullishScore += minScore; + } + if (is3MaBullishOrdered) + { + bullishScore += minScore; + } + if (is3MaSwitchedToBullish) + { + bullishScore += minScore; + } + if (is3MaFinishedFromBearish) + { + bullishScore += minScore; + } + if (is3MaSwitchedToBullishState) + { + bullishScore += minScore; + } + if (is3MaSwitchedToBullishOrdered) + { + bullishScore += minScore; + } + // if (isFastUnderSlow) { @@ -385,6 +471,36 @@ struct X121X3MAConditions { bearishScore += score; } + + // + if (is3MaBearish) + { + bearishScore += minScore; + } + if (is3MaBearishState) + { + bearishScore += minScore; + } + if (is3MaBearishOrdered) + { + bearishScore += minScore; + } + if (is3MaSwitchedToBearish) + { + bearishScore += minScore; + } + if (is3MaFinishedFromBullish) + { + bearishScore += minScore; + } + if (is3MaSwitchedToBearishState) + { + bearishScore += minScore; + } + if (is3MaSwitchedToBearishOrdered) + { + bearishScore += minScore; + } } /** @@ -453,6 +569,20 @@ struct X121X3MAConditions ToString("isMediumUnderSlow", isMediumUnderSlow, ignoreFalseConditions, separator) + ToString("isMediumCrossedOverSlow", isMediumCrossedOverSlow, ignoreFalseConditions, separator) + ToString("isMediumCrossedUnderSlow", isMediumCrossedUnderSlow, ignoreFalseConditions, separator) + + ToString("is3MaBullishOrdered", is3MaBullishOrdered, ignoreFalseConditions, separator) + + ToString("is3MaBearishOrdered", is3MaBearishOrdered, ignoreFalseConditions, separator) + + ToString("is3MaSwitchedToBullishOrdered", is3MaSwitchedToBullishOrdered, ignoreFalseConditions, separator) + + ToString("is3MaSwitchedToBearishOrdered", is3MaSwitchedToBearishOrdered, ignoreFalseConditions, separator) + + ToString("is3MaBullishState", is3MaBullishState, ignoreFalseConditions, separator) + + ToString("is3MaBearishState", is3MaBearishState, ignoreFalseConditions, separator) + + ToString("is3MaSwitchedToBullishState", is3MaSwitchedToBullishState, ignoreFalseConditions, separator) + + ToString("is3MaSwitchedToBearishState", is3MaSwitchedToBearishState, ignoreFalseConditions, separator) + + ToString("is3MaBullish", is3MaBullish, ignoreFalseConditions, separator) + + ToString("is3MaBearish", is3MaBearish, ignoreFalseConditions, separator) + + ToString("is3MaSwitchedToBullish", is3MaSwitchedToBullish, ignoreFalseConditions, separator) + + ToString("is3MaSwitchedToBearish", is3MaSwitchedToBearish, ignoreFalseConditions, separator) + + ToString("is3MaFinishedFromBullish", is3MaFinishedFromBullish, ignoreFalseConditions, separator) + + ToString("is3MaFinishedFromBearish", is3MaFinishedFromBearish, ignoreFalseConditions, separator) + // "" // @@ -1151,18 +1281,108 @@ class XCX121X3MAHelper : public XCBaseHelper !isMediumUnderSlowPrev; // + bool is3MaBullishOrdered = + isFastOverMedium && + isMediumOverSlow; + bool is3MaBullishOrderedPrev = + isFastOverMediumPrev && + isMediumOverSlowPrev; + + // + bool is3MaBearishOrdered = + isFastUnderMedium && + isMediumUnderSlow; + bool is3MaBearishOrderedPrev = + isFastUnderMediumPrev && + isMediumUnderSlowPrev; + + // + bool is3MaSwitchedToBullishOrdered = is3MaBullishOrdered && + !is3MaBullishOrderedPrev; + bool is3MaSwitchedToBearishOrdered = is3MaBearishOrdered && + !is3MaBearishOrderedPrev; + + // + bool is3MaBullishState = + cFastState > 0 && + cMediumState > 0 && + cSlowState > 0; + bool is3MaBullishStatePrev = + pFastState > 0 && + pMediumState > 0 && + pSlowState > 0; + + // + bool is3MaBearishState = + cFastState < 0 && + cMediumState < 0 && + cSlowState < 0; + bool is3MaBearishStatePrev = + pFastState < 0 && + pMediumState < 0 && + pSlowState < 0; + + // + bool is3MaSwitchedToBullishState = is3MaBullishState && + !is3MaBullishStatePrev; + bool is3MaSwitchedToBearishState = is3MaBearishState && + !is3MaBearishStatePrev; + + // + bool is3MaBullish = + is3MaBullishState && + is3MaBullishOrdered; + bool is3MaBullishPrev = + is3MaBullishStatePrev && + is3MaBullishOrderedPrev; + + // + bool is3MaBearish = + is3MaBearishState && + is3MaBearishOrdered; + bool is3MaBearishPrev = + is3MaBearishStatePrev && + is3MaBearishOrderedPrev; + + // + bool is3MaSwitchedToBullish = is3MaBullish && + !is3MaBullishPrev; + bool is3MaSwitchedToBearish = is3MaBearish && + !is3MaBearishPrev; + + // + bool is3MaFinishedFromBullish = !is3MaBullish && + is3MaBullishPrev; + bool is3MaFinishedFromBearish = !is3MaBearish && + is3MaBearishPrev; + + // + conditions.is3MaBullish = is3MaBullish; + conditions.is3MaBearish = is3MaBearish; conditions.isFastOverSlow = isFastOverSlow; conditions.isFastUnderSlow = isFastUnderSlow; conditions.isFastOverMedium = isFastOverMedium; conditions.isMediumOverSlow = isMediumOverSlow; conditions.isFastUnderMedium = isFastUnderMedium; conditions.isMediumUnderSlow = isMediumUnderSlow; + conditions.is3MaBullishState = is3MaBullishState; + conditions.is3MaBearishState = is3MaBearishState; + conditions.is3MaBullishOrdered = is3MaBullishOrdered; + conditions.is3MaBearishOrdered = is3MaBearishOrdered; conditions.isFastCrossedOverSlow = isFastCrossedOverSlow; + conditions.is3MaSwitchedToBullish = is3MaSwitchedToBullish; + conditions.is3MaSwitchedToBearish = is3MaSwitchedToBearish; conditions.isFastCrossedUnderSlow = isFastCrossedUnderSlow; conditions.isFastCrossedOverMedium = isFastCrossedOverMedium; conditions.isMediumCrossedOverSlow = isMediumCrossedOverSlow; + conditions.is3MaFinishedFromBullish = is3MaFinishedFromBullish; + conditions.is3MaFinishedFromBearish = is3MaFinishedFromBearish; conditions.isFastCrossedUnderMedium = isFastCrossedUnderMedium; conditions.isMediumCrossedUnderSlow = isMediumCrossedUnderSlow; + conditions.is3MaSwitchedToBullishState = is3MaSwitchedToBullishState; + conditions.is3MaSwitchedToBearishState = is3MaSwitchedToBearishState; + conditions.is3MaSwitchedToBullishOrdered = is3MaSwitchedToBullishOrdered; + conditions.is3MaSwitchedToBearishOrdered = is3MaSwitchedToBearishOrdered; // Cleanup(); @@ -1226,7 +1446,7 @@ class XCX121X3MAHelper : public XCBaseHelper X121_X3MA_FAST_STATE, barIndex, maxRequiredBars, - mediumBuffer // + fastStateBuffer // ); // @@ -1238,7 +1458,7 @@ class XCX121X3MAHelper : public XCBaseHelper X121_X3MA_MEDIUM, barIndex, maxRequiredBars, - mediumStateBuffer // + mediumBuffer // ); // @@ -1247,7 +1467,7 @@ class XCX121X3MAHelper : public XCBaseHelper X121_X3MA_MEDIUM_STATE, barIndex, maxRequiredBars, - slowStateBuffer // + mediumStateBuffer // ); // @@ -1268,7 +1488,7 @@ class XCX121X3MAHelper : public XCBaseHelper X121_X3MA_SLOW_STATE, barIndex, maxRequiredBars, - fastStateBuffer // + slowStateBuffer // ); } diff --git a/Indicators/x-saherelm.x121.x3ma.mq5 b/Indicators/x-saherelm.x121.x3ma.mq5 index 249c4f6e..92966d55 100644 --- a/Indicators/x-saherelm.x121.x3ma.mq5 +++ b/Indicators/x-saherelm.x121.x3ma.mq5 @@ -65,8 +65,8 @@ input bool applyColor = false; // input bool showFast = true; // Show Fast -input bool showSlow = true; // Show Medium -input bool showMedium = true; // Show Slow +input bool showMedium = true; // Show Medium +input bool showSlow = true; // Show Slow // // Buffers ... diff --git a/XCAEA/Classes/xcaea.x-poi.detector.class.mq5 b/XCAEA/Classes/xcaea.x-poi.detector.class.mq5 index cdadc0de..9ffb58d0 100644 --- a/XCAEA/Classes/xcaea.x-poi.detector.class.mq5 +++ b/XCAEA/Classes/xcaea.x-poi.detector.class.mq5 @@ -32,34 +32,21 @@ // enum ENUM_XCA_PIVOTS { - XCA_NONE, // None - XCA_LL, // LowestLow - XCA_HH, // HighestHigh - XCA_KI, // KI - XCA_SWL, // SWL - XCA_SWH, // SWH - XCA_VALE, // VALE - XCA_PEAK, // PEAK - XCA_FVG_BULL, // FVGBull - XCA_FVG_BEAR, // FVGBear - XCA_RSI_COOS, // RSICOOS - XCA_RSI_CUOB, // RSICUOB - XCA_RSI_PEAK, // RSIPeak - XCA_RSI_VALE, // RSIVale - XCA_CCI_COOS, // CCICOOS - XCA_CCI_CUOB, // CCICUOB - XCA_CCI_PEAK, // CCIPeak - XCA_CCI_VALE, // CCIVale - XCA_KI_BULL, // KIBull - XCA_KI_BEAR, // KIBear - XCA_TKI_BULL, // TKIBull - XCA_TKI_BEAR, // TKIBear - XCA_PEAKSWHRES, // PeakSWHRes - XCA_VALESWLSUP, // ValeSWLSup - XCA_TREND_BULL, // TrendBull - XCA_TREND_BEAR, // TrendBear - XCA_TKITRND_BULL, // TKITRNDBull - XCA_TKITRND_BEAR, // TKITRNDBear + XCA_NONE, // None + XCA_FVG_BULL, // FVGBull + XCA_FVG_BEAR, // FVGBear + XCA_RSI_COOS, // RSICOOS + XCA_RSI_CUOB, // RSICUOB + XCA_RSI_PEAK, // RSIPeak + XCA_RSI_VALE, // RSIVale + XCA_CCI_COOS, // CCICOOS + XCA_CCI_CUOB, // CCICUOB + XCA_CCI_PEAK, // CCIPeak + XCA_CCI_VALE, // CCIVale + XCA_PEAKSWHRES, // PeakSWHRes + XCA_VALESWLSUP, // ValeSWLSup + XCA_TREND_BULL, // TrendBull + XCA_TREND_BEAR, // TrendBear }; // @@ -88,6 +75,81 @@ string ToString(ENUM_XCA_PIVOTS value) return result; } +// +ENUM_X_DIRECTION GetDirection(ENUM_XCA_PIVOTS value) +{ + // + ENUM_X_DIRECTION result = X_DIRECTION_NONE; + + // + switch (value) + { + // + case XCA_FVG_BULL: + case XCA_RSI_COOS: + case XCA_RSI_VALE: + case XCA_CCI_COOS: + case XCA_CCI_VALE: + case XCA_TREND_BULL: + case XCA_VALESWLSUP: + result = X_DIRECTION_BULLISH; + break; + + // + case XCA_FVG_BEAR: + case XCA_RSI_CUOB: + case XCA_RSI_PEAK: + case XCA_CCI_CUOB: + case XCA_CCI_PEAK: + case XCA_TREND_BEAR: + case XCA_PEAKSWHRES: + result = X_DIRECTION_BEARISH; + break; + } + + // + return result; +} + +// +string GetBoxType(ENUM_XCA_PIVOTS value) +{ + // + string result = NULL; + + // + switch (value) + { + // + case XCA_RSI_COOS: + case XCA_RSI_VALE: + case XCA_CCI_COOS: + case XCA_CCI_VALE: + case XCA_RSI_CUOB: + case XCA_RSI_PEAK: + case XCA_CCI_CUOB: + case XCA_CCI_PEAK: + case XCA_VALESWLSUP: + case XCA_PEAKSWHRES: + result = ToString(value); + break; + // + case XCA_FVG_BULL: + case XCA_FVG_BEAR: + result = "XCA_FVG"; + break; + + // + case XCA_TREND_BULL: + case XCA_TREND_BEAR: + result = "XCA_TREND"; + break; + } + + // + return result; +} + // struct XCAPivot { @@ -329,43 +391,7 @@ struct XCAPivot } // - ENUM_X_DIRECTION iDir = X_DIRECTION_NONE; - switch (type) - { - // - case XCA_LL: - case XCA_SWL: - case XCA_VALE: - case XCA_KI_BULL: - case XCA_FVG_BULL: - case XCA_RSI_COOS: - case XCA_RSI_VALE: - case XCA_CCI_COOS: - case XCA_CCI_VALE: - case XCA_TKI_BULL: - case XCA_TREND_BULL: - case XCA_VALESWLSUP: - case XCA_TKITRND_BULL: - iDir = X_DIRECTION_BULLISH; - break; - - // - case XCA_HH: - case XCA_SWH: - case XCA_PEAK: - case XCA_KI_BEAR: - case XCA_FVG_BEAR: - case XCA_RSI_CUOB: - case XCA_RSI_PEAK: - case XCA_CCI_CUOB: - case XCA_CCI_PEAK: - case XCA_TKI_BEAR: - case XCA_TREND_BEAR: - case XCA_PEAKSWHRES: - case XCA_TKITRND_BEAR: - iDir = X_DIRECTION_BEARISH; - break; - } + ENUM_X_DIRECTION iDir = GetDirection(type); // result = HasDirection(iDir); @@ -400,49 +426,7 @@ struct XCAPivot box.period = period; // - string typeStr = ToString(type); - if (type == XCA_KI_BULL || - type == XCA_KI_BEAR) - { - // - typeStr = "XCA_KI"; - } - else if (type == XCA_FVG_BULL || - type == XCA_FVG_BEAR) - { - // - typeStr = "XCA_FVG"; - } - else if (type == XCA_RSI_COOS || - type == XCA_RSI_CUOB) - { - // - typeStr = "XCA_RSI"; - } - else if (type == XCA_CCI_COOS || - type == XCA_CCI_CUOB) - { - // - typeStr = "XCA_CCI"; - } - else if (type == XCA_TKI_BULL || - type == XCA_TKI_BEAR) - { - // - typeStr = "XCA_TKI"; - } - else if (type == XCA_TREND_BULL || - type == XCA_TREND_BEAR) - { - // - typeStr = "XCA_TREND"; - } - else if (type == XCA_TKITRND_BULL || - type == XCA_TKITRND_BEAR) - { - // - typeStr = "XCA_TKITRND"; - } + string typeStr = GetBoxType(type); box.type = typeStr; // @@ -470,16 +454,14 @@ struct XCAPivot }; // -struct XCAPVFVG +struct XCATRENDFVG { // - double value; - datetime from; + XBoxZone trend; XBoxZone fvgs[]; - ENUM_X_DIRECTION dir; // - XCAPVFVG() + XCATRENDFVG() { Clean(); } @@ -491,10 +473,8 @@ struct XCAPVFVG void Clean() { // - value = 0; Clean(fvgs); - from = NULL; - dir = X_DIRECTION_NONE; + trend.Clean(); } // @@ -504,10 +484,7 @@ struct XCAPVFVG bool result = false; // - result = value > 0 && - IsValid(from) && - HasChild(fvgs) && - HasDirection(dir); + result = trend.IsValid(); // return result; @@ -517,8 +494,9 @@ struct XCAPVFVG void AddFVG(XBoxZone &fvg) { // - bool has = fvg.IsValid() && - fvg.dir == dir; + bool has = trend.IsValid() && + fvg.IsValid() && + fvg.dir == trend.dir; if (!has) { return; @@ -547,14 +525,14 @@ struct XCAPVFVG bool IsBullish() { return IsValid() && - IsBullish(dir); + trend.IsBullish(); } // bool IsBearish() { return IsValid() && - IsBearish(dir); + trend.IsBearish(); } // @@ -603,7 +581,7 @@ struct XCAPVFVG }; // -int GetOldest(XCAPVFVG &items[]) +int GetOldest(XCATRENDFVG &items[]) { // int result = -1; @@ -616,27 +594,27 @@ int GetOldest(XCAPVFVG &items[]) } // - XCAPVFVG item; + XCATRENDFVG item; int count = ArraySize(items); for (int i = 0; i < count; i++) { // - XCAPVFVG iPVFVG = items[i]; + XCATRENDFVG iTrendFVG = items[i]; // bool canSet = !item.IsValid() ? true - : item.from > iPVFVG.from; + : item.trend.from > iTrendFVG.trend.from; if (canSet) { // result = i; - item = iPVFVG; + item = iTrendFVG; } // - iPVFVG.Clean(); + iTrendFVG.Clean(); } // @@ -756,20 +734,24 @@ class XCXCAEAPOIDetector : public XCBase bool newPeakResSWHPivotDetected; // - // XPVFVG Bullish ... + // TREND Bullish ... // - bool detectPVFVGBullishPivots; - XCAPVFVG pvFVGBullishPivots[]; - bool newPVFVGBullishPivotDetected; + XCAPivot trendBullishPivot; + XBoxZone trendBullishFVGs[]; + bool detectTrendBullishPivots; + XCATRENDFVG trendBullishPivots[]; + bool newTrendBullishPivotDetected; // - // XPVFVG Bearish ... + // TREND Bearish ... // - bool detectPVFVGBearishPivots; - XCAPVFVG pvFVGBearishPivots[]; - bool newPVFVGBearishPivotDetected; + XCAPivot trendBearishPivot; + XBoxZone trendBearishFVGs[]; + bool detectTrendBearishPivots; + XCATRENDFVG trendBearishPivots[]; + bool newTrendBearishPivotDetected; // // RSI Crossed Over OS Pivot ... @@ -826,6 +808,14 @@ class XCXCAEAPOIDetector : public XCBase valeSupSWLPivot.Clean(); peakResSWHPivot.Clean(); + // + Clean(trendBullishFVGs); + trendBullishPivot.Clean(); + + // + Clean(trendBearishFVGs); + trendBearishPivot.Clean(); + // trendPivotP.Clean(); trendPivotC.Clean(); @@ -867,8 +857,8 @@ class XCXCAEAPOIDetector : public XCBase detectFVGBearishPivots = true; detectValeSupSWLPivots = true; detectPeakResSWHPivots = true; - detectPVFVGBullishPivots = true; - detectPVFVGBearishPivots = true; + detectTrendBullishPivots = true; + detectTrendBearishPivots = true; detectRSICrossedOverOSPivots = true; detectRSICrossedUnderOBPivots = true; detectCCICrossedOverOSPivots = true; @@ -907,8 +897,8 @@ class XCXCAEAPOIDetector : public XCBase newFVGBearishPivotDetected = false; newValeSupSWLPivotDetected = false; newPeakResSWHPivotDetected = false; - newPVFVGBullishPivotDetected = false; - newPVFVGBearishPivotDetected = false; + newTrendBullishPivotDetected = false; + newTrendBearishPivotDetected = false; newRSICrossedOverOSPivotDetected = false; newRSICrossedUnderOBPivotDetected = false; newCCICrossedOverOSPivotDetected = false; @@ -935,7 +925,8 @@ class XCXCAEAPOIDetector : public XCBase start, 5 // ); - if (!has) { + if (!has) + { conditions.Clean(); continue; } @@ -1133,6 +1124,178 @@ class XCXCAEAPOIDetector : public XCBase pCCI < p2CCI && pCCI < zCCI; + // + // Extracting Required Data about Trending ... + + // + double zFast = conditions.fastBuffer[zIDX]; + double cFast = conditions.fastBuffer[cIDX]; + double pFast = conditions.fastBuffer[pIDX]; + double p2Fast = conditions.fastBuffer[p2IDX]; + + // + double zMedium = conditions.mediumBuffer[zIDX]; + double cMedium = conditions.mediumBuffer[cIDX]; + double pMedium = conditions.mediumBuffer[pIDX]; + double p2Medium = conditions.mediumBuffer[p2IDX]; + + // + double zSlow = conditions.slowBuffer[zIDX]; + double cSlow = conditions.slowBuffer[cIDX]; + double pSlow = conditions.slowBuffer[pIDX]; + double p2Slow = conditions.slowBuffer[p2IDX]; + + // + double z3Mas[] = { + zFast, + zMedium, + zSlow, + }; + double z3MasMin = GetMin(z3Mas); + double z3MasMax = GetMax(z3Mas); + + // + double c3Mas[] = { + cFast, + cMedium, + cSlow, + }; + double c3MasMin = GetMin(c3Mas); + double c3MasMax = GetMax(c3Mas); + + // + double p3Mas[] = { + pFast, + pMedium, + pSlow, + }; + double p3MasMin = GetMin(p3Mas); + double p3MasMax = GetMax(p3Mas); + + // + double p23Mas[] = { + p2Fast, + p2Medium, + p2Slow, + }; + double p23MasMin = GetMin(p23Mas); + double p23MasMax = GetMax(p23Mas); + + // + // Try to Custom Mechanism for Trend Detection ... + + // + bool is3MaBullish = + cFast > cSlow && + cMedium > cSlow; + bool is3MaBullishPrev = + pFast > pSlow && + pMedium > pSlow; + + // + bool is3MaBearish = + cFast < cSlow && + cMedium < cSlow; + bool is3MaBearishPrev = + pFast < pSlow && + pMedium < pSlow; + + // + bool is3MaSwitchedToBullish = is3MaBullish && + !is3MaBullishPrev; + bool is3MaSwitchedToBearish = is3MaBearish && + !is3MaBearishPrev; + + // + bool is3MaFinishedFromBullish = !is3MaBullish && + is3MaBullishPrev; + bool is3MaFinishedFromBearish = !is3MaBearish && + is3MaBearishPrev; + + // + // TREND BULLISH Conditions ... + + // + bool trendBullishStartPivotCondition = + // + // One ... + // conditions.is3MaFinishedFromBullish + // // + // || + // + // Two ... + is3MaFinishedFromBullish + // + ; + + // + bool trendBullishPivotContinuationCondition = + // + // One ... + // conditions.is3MaBullish + // // + // || + // + // Two ... + is3MaBullish + // + ; + + // + bool trendBullisPivothFinishedCondition = + // + // One ... + // conditions.is3MaSwitchedToBullish + // // + // || + // + // Two ... + is3MaSwitchedToBullish + // + ; + + // + // TREND BEARISH Conditions ... + + // + bool trendBearishStartPivotCondition = + // + // One ... + // conditions.is3MaFinishedFromBearish + // // + // || + // + // Two ... + is3MaFinishedFromBearish + // + ; + + // + bool trendBearishPivotContinuationCondition = + // + // One ... + // conditions.is3MaBearish + // // + // || + // + // Two ... + is3MaBearish + // + ; + + // + bool trendBearishivothFinishedCondition = + // + // One ... + // conditions.is3MaSwitchedToBearish + // // + // || + // + // Two ... + is3MaSwitchedToBearish + // + ; + // // Checking Pivots ... @@ -1814,176 +1977,224 @@ class XCXCAEAPOIDetector : public XCBase } // - // PVFVG Bullish ... - if (detectPVFVGBullishPivots) + // TREND Bullish ... + if (detectTrendBullishPivots) { // - if (conditions.isValeIsPivot && isBullishFVG) + if (trendBullishStartPivotCondition) { // - idx = -1; - has = HasPVFVGBullishPivots(); - if (has) - { - // - count = CountPVFVGBullishPivots(); - for (int i = 0; i < count; i++) - { - // - XCAPVFVG iPVFVG = pvFVGBullishPivots[i]; - - // - if (iPVFVG.value == cVale && iPVFVG.IsBullish()) - { - // - idx = i; - iPVFVG.Clean(); - - // - break; - } - - // - iPVFVG.Clean(); - } - } + Clean(trendBullishFVGs); + trendBullishPivot.Clean(); // - has = IsValidIndex(idx); + trendBullishPivot.type = XCA_TREND_BULL; + trendBullishPivot.symbol = conditions.symbol; + trendBullishPivot.period = conditions.period; + + // + trendBullishPivot.to = pBar.time; + trendBullishPivot.from = pBar.time; + trendBullishPivot.value = p3MasMin; + trendBullishPivot.reserve = p3MasMax; + } + + // + if (trendBullishPivotContinuationCondition) + { + // + trendBullishPivot.from = pBar.time; + + // + Add( + p3MasMin, + trendBullishPivot.values // + ); + Add( + p3MasMax, + trendBullishPivot.values // + ); + + // + trendBullishPivot.reserve = + trendBullishPivot.reserve == 0 + ? p3MasMax + : MathMax(trendBullishPivot.reserve, p3MasMax); + + // + // Handling FVGs Here ... + if (isBullishFVG) + { + // + AddBox( + fvgBox, + trendBullishFVGs // + ); + } + } + + // + if (trendBullisPivothFinishedCondition) + { + // + // Update Values ... + trendBullishPivot.value = GetMin(trendBullishPivot.values); + trendBullishPivot.reserve = GetMax(trendBullishPivot.values); + + // + has = + trendBullishPivot.IsValid() && + trendBullishPivot.GetAge() >= pivotVerifications; if (has) { // - // Add FVG to Exists PVFVG ... - - // - XBoxZone iFVG = fvgBox; - iFVG.type = "XCA_FVG"; - - // - pvFVGBullishPivots[idx].AddFVG(iFVG); - } - else - { - // - // Add New PVFVG ... - - // - newPVFVGBullishPivotDetected = true; - - // - XCAPVFVG iPVFVG; - XBoxZone iFVG = fvgBox; - iFVG.type = "XCA_FVG"; - - // - iPVFVG.value = cVale; - iPVFVG.dir = X_DIRECTION_BULLISH; - - // - iPVFVG.AddFVG(iFVG); - - // - has = iPVFVG.IsValid(); + XBoxZone iBox; + has = trendBullishPivot.AsBox(iBox); if (has) { // - AddRef( - iPVFVG, - pvFVGBullishPivots // + XCATRENDFVG iTrendFVG; + + // + iTrendFVG.trend = iBox; + Copy( + trendBullishFVGs, + iTrendFVG.fvgs // ); + + // + newTrendBullishPivotDetected = iTrendFVG.IsValid(); + if (newTrendBullishPivotDetected) + { + // + AddRef( + iTrendFVG, + trendBullishPivots // + ); + } + + // + iTrendFVG.Clean(); } // - iFVG.Clean(); - iPVFVG.Clean(); + iBox.Clean(); } + + // + Clean(trendBullishFVGs); + trendBullishPivot.Clean(); } } // - // PVFVG Bearish ... - if (detectPVFVGBearishPivots) + // TREND Bearish ... + if (detectTrendBearishPivots) { // - if (conditions.isPeakIsPivot && isBearishFVG) + if (trendBearishStartPivotCondition) { // - idx = -1; - has = HasPVFVGBearishPivots(); - if (has) - { - // - count = CountPVFVGBearishPivots(); - for (int i = 0; i < count; i++) - { - // - XCAPVFVG iPVFVG = pvFVGBearishPivots[i]; - - // - if (iPVFVG.value == cPeak && iPVFVG.IsBearish()) - { - // - idx = i; - iPVFVG.Clean(); - - // - break; - } - - // - iPVFVG.Clean(); - } - } + Clean(trendBearishFVGs); + trendBearishPivot.Clean(); // - has = IsValidIndex(idx); + trendBearishPivot.type = XCA_TREND_BEAR; + trendBearishPivot.symbol = conditions.symbol; + trendBearishPivot.period = conditions.period; + + // + trendBearishPivot.to = pBar.time; + trendBearishPivot.from = pBar.time; + trendBearishPivot.value = p3MasMax; + trendBearishPivot.reserve = p3MasMin; + } + + // + if (trendBearishPivotContinuationCondition) + { + // + trendBearishPivot.from = pBar.time; + + // + Add( + p3MasMin, + trendBearishPivot.values // + ); + Add( + p3MasMax, + trendBearishPivot.values // + ); + + // + trendBearishPivot.reserve = + trendBearishPivot.reserve == 0 + ? p3MasMin + : MathMin(trendBearishPivot.reserve, p3MasMin); + + // + // Handling FVGs Here ... + if (isBearishFVG) + { + // + AddBox( + fvgBox, + trendBearishFVGs // + ); + } + } + + // + if (trendBearishivothFinishedCondition) + { + // + // Update Values ... + trendBearishPivot.value = GetMax(trendBearishPivot.values); + trendBearishPivot.reserve = GetMin(trendBearishPivot.values); + + // + has = + trendBearishPivot.IsValid() && + trendBearishPivot.GetAge() >= pivotVerifications; if (has) { // - // Add FVG to Exists PVFVG ... - - // - XBoxZone iFVG = fvgBox; - iFVG.type = "XCA_FVG"; - - // - pvFVGBearishPivots[idx].AddFVG(iFVG); - } - else - { - // - // Add New PVFVG ... - - // - newPVFVGBearishPivotDetected = true; - - // - XCAPVFVG iPVFVG; - XBoxZone iFVG = fvgBox; - iFVG.type = "XCA_FVG"; - - // - iPVFVG.value = cPeak; - iPVFVG.dir = X_DIRECTION_BEARISH; - - // - iPVFVG.AddFVG(iFVG); - - // - has = iPVFVG.IsValid(); + XBoxZone iBox; + has = trendBearishPivot.AsBox(iBox); if (has) { // - AddRef( - iPVFVG, - pvFVGBearishPivots // + XCATRENDFVG iTrendFVG; + + // + iTrendFVG.trend = iBox; + Copy( + trendBearishFVGs, + iTrendFVG.fvgs // ); + + // + newTrendBearishPivotDetected = iTrendFVG.IsValid(); + if (newTrendBearishPivotDetected) + { + // + AddRef( + iTrendFVG, + trendBearishPivots // + ); + } + + // + iTrendFVG.Clean(); } // - iFVG.Clean(); - iPVFVG.Clean(); + iBox.Clean(); } + + // + Clean(trendBearishFVGs); + trendBearishPivot.Clean(); } } @@ -2298,6 +2509,12 @@ class XCXCAEAPOIDetector : public XCBase // start++; + // + Clean(z3Mas); + Clean(c3Mas); + Clean(p3Mas); + Clean(p23Mas); + // zBar.Clean(); cBar.Clean(); @@ -2370,7 +2587,8 @@ class XCXCAEAPOIDetector : public XCBase // ApplyValidationOnBox( rsiPeakPivots, - unAvailableBoxes // + unAvailableBoxes, + barIndex // ); } @@ -2384,7 +2602,8 @@ class XCXCAEAPOIDetector : public XCBase // ApplyValidationOnBox( rsiValePivots, - unAvailableBoxes // + unAvailableBoxes, + barIndex // ); } @@ -2398,7 +2617,8 @@ class XCXCAEAPOIDetector : public XCBase // ApplyValidationOnBox( cciPeakPivots, - unAvailableBoxes // + unAvailableBoxes, + barIndex // ); } @@ -2412,7 +2632,8 @@ class XCXCAEAPOIDetector : public XCBase // ApplyValidationOnBox( cciValePivots, - unAvailableBoxes // + unAvailableBoxes, + barIndex // ); } @@ -2426,7 +2647,8 @@ class XCXCAEAPOIDetector : public XCBase // ApplyValidationOnBox( fvgBullishPivots, - unAvailableBoxes // + unAvailableBoxes, + barIndex // ); } @@ -2440,7 +2662,8 @@ class XCXCAEAPOIDetector : public XCBase // ApplyValidationOnBox( fvgBearishPivots, - unAvailableBoxes // + unAvailableBoxes, + barIndex // ); } @@ -2454,7 +2677,8 @@ class XCXCAEAPOIDetector : public XCBase // ApplyValidationOnBox( valeSupSWLPivots, - unAvailableBoxes // + unAvailableBoxes, + barIndex // ); } @@ -2468,106 +2692,39 @@ class XCXCAEAPOIDetector : public XCBase // ApplyValidationOnBox( peakResSWHPivots, - unAvailableBoxes // + unAvailableBoxes, + barIndex // ); } // - // PVFVG Bullish ... + // TREND Bullish ... // - has = HasPVFVGBullishPivots(); + has = HasTrendBullishPivots(); if (has) { // - XCAPVFVG tmpPVFVG[]; - - // - // Copy Items and Cleanup Collection ... - Copy( - pvFVGBullishPivots, - tmpPVFVG // + ApplyValidationOnTrendFVG( + trendBullishPivots, + unAvailableBoxes, + barIndex // ); - Clean(pvFVGBullishPivots); - - // - // Do Validation ... - while (HasChild(tmpPVFVG)) - { - // - XCAPVFVG iPVFVG = tmpPVFVG[0]; - ArrayRemove( - tmpPVFVG, - 0, - 1 // - ); - ApplyValidationOnBox( - iPVFVG.fvgs, - unAvailableBoxes // - ); - - // - if (iPVFVG.IsValid()) - { - // - AddRef( - iPVFVG, - pvFVGBullishPivots // - ); - } - } - - // - Clean(tmpPVFVG); } // - // PVFVG Bearish ... + // TREND Bearish ... // - has = HasPVFVGBearishPivots(); + has = HasTrendBearishPivots(); if (has) { // - XCAPVFVG tmpPVFVG[]; - - // - // Copy Items and Cleanup Collection ... - Copy( - pvFVGBearishPivots, - tmpPVFVG // + ApplyValidationOnTrendFVG( + trendBearishPivots, + unAvailableBoxes, + barIndex // ); - Clean(pvFVGBearishPivots); - - // - // Do Validation ... - while (HasChild(tmpPVFVG)) - { - // - XCAPVFVG iPVFVG = tmpPVFVG[0]; - ArrayRemove( - tmpPVFVG, - 0, - 1 // - ); - ApplyValidationOnBox( - iPVFVG.fvgs, - unAvailableBoxes // - ); - - // - if (iPVFVG.IsValid()) - { - // - AddRef( - iPVFVG, - pvFVGBearishPivots // - ); - } - } - - // - Clean(tmpPVFVG); } // @@ -2580,7 +2737,8 @@ class XCXCAEAPOIDetector : public XCBase // ApplyValidationOnBox( rsiCrossedOverOSPivots, - unAvailableBoxes // + unAvailableBoxes, + barIndex // ); } @@ -2594,7 +2752,8 @@ class XCXCAEAPOIDetector : public XCBase // ApplyValidationOnBox( rsiCrossedUnderOBPivots, - unAvailableBoxes // + unAvailableBoxes, + barIndex // ); } @@ -2608,7 +2767,8 @@ class XCXCAEAPOIDetector : public XCBase // ApplyValidationOnBox( cciCrossedOverOSPivots, - unAvailableBoxes // + unAvailableBoxes, + barIndex // ); } @@ -2622,7 +2782,8 @@ class XCXCAEAPOIDetector : public XCBase // ApplyValidationOnBox( cciCrossedUnderOBPivots, - unAvailableBoxes // + unAvailableBoxes, + barIndex // ); } @@ -2709,16 +2870,16 @@ class XCXCAEAPOIDetector : public XCBase ); // - has = HasPVFVGBullishPivots(); + has = HasTrendBullishPivots(); if (has) { // - count = CountPVFVGBullishPivots(); + count = CountTrendBullishPivots(); for (int i = 0; i < count; i++) { // XBoxZone iBox; - has = pvFVGBullishPivots[i].GetSelectedFVG(iBox); + has = trendBullishPivots[i].GetSelectedFVG(iBox); if (has) { // @@ -2781,16 +2942,16 @@ class XCXCAEAPOIDetector : public XCBase ); // - has = HasPVFVGBearishPivots(); + has = HasTrendBearishPivots(); if (has) { // - count = CountPVFVGBearishPivots(); + count = CountTrendBearishPivots(); for (int i = 0; i < count; i++) { // XBoxZone iBox; - has = pvFVGBearishPivots[i].GetSelectedFVG(iBox); + has = trendBearishPivots[i].GetSelectedFVG(iBox); if (has) { // @@ -3000,33 +3161,33 @@ class XCXCAEAPOIDetector : public XCBase } // - // PVFVG Bullish ... + // TREND Bullish ... // - bool HasPVFVGBullishPivots() + bool HasTrendBullishPivots() { - return HasChild(pvFVGBullishPivots); + return HasChild(trendBullishPivots); } // - int CountPVFVGBullishPivots() + int CountTrendBullishPivots() { - return ArraySize(pvFVGBullishPivots); + return ArraySize(trendBullishPivots); } // - // PVFVG Bearish ... + // TREND Bearish ... // - bool HasPVFVGBearishPivots() + bool HasTrendBearishPivots() { - return HasChild(pvFVGBearishPivots); + return HasChild(trendBearishPivots); } // - int CountPVFVGBearishPivots() + int CountTrendBearishPivots() { - return ArraySize(pvFVGBearishPivots); + return ArraySize(trendBearishPivots); } // @@ -3348,8 +3509,8 @@ class XCXCAEAPOIDetector : public XCBase Clean(fvgBearishPivots); Clean(valeSupSWLPivots); Clean(peakResSWHPivots); - Clean(pvFVGBullishPivots); - Clean(pvFVGBearishPivots); + Clean(trendBullishPivots); + Clean(trendBearishPivots); Clean(rsiCrossedOverOSPivots); Clean(rsiCrossedUnderOBPivots); Clean(cciCrossedOverOSPivots); @@ -3428,18 +3589,18 @@ class XCXCAEAPOIDetector : public XCBase // // PVFVG Bullish ... - has = HasPVFVGBullishPivots(); + has = HasTrendBullishPivots(); if (has) { - ApplySortOnPVFVG(pvFVGBullishPivots); + ApplySortOnTrendFVG(trendBullishPivots); } // // PVFVG Bearish ... - has = HasPVFVGBearishPivots(); + has = HasTrendBearishPivots(); if (has) { - ApplySortOnPVFVG(pvFVGBearishPivots); + ApplySortOnTrendFVG(trendBearishPivots); } // @@ -3541,6 +3702,77 @@ class XCXCAEAPOIDetector : public XCBase Clean(tmp); } + // + void ApplyValidationOnTrendFVG( + XCATRENDFVG &items[], + XBoxZone &unAvailableItems[], + int barIndex = 0 // + ) + { + // + bool has = false; + + // + has = HasChild(items); + if (!has) + { + return; + } + + // + XCATRENDFVG tmp[]; + Copy( + items, + tmp // + ); + Clean(items); + while (HasChild(tmp)) + { + // + XCATRENDFVG iTrendFVG = tmp[0]; + ArrayRemove( + tmp, + 0, + 1 // + ); + + // + // Validate TMP Trend Box ... + has = ValidateBox( + iTrendFVG.trend, + unAvailableItems, + barIndex // + ); + if (has) + { + // + // Now we Have to Validate FVGS ... + ApplyValidationOnBox( + iTrendFVG.fvgs, + unAvailableItems, + barIndex // + ); + + // + has = iTrendFVG.IsValid(); + if (has) + { + // + AddRef( + iTrendFVG, + items // + ); + } + } + + // + iTrendFVG.Clean(); + } + + // + Clean(tmp); + } + // void ApplySortOnBox( XBoxZone &items[] // @@ -3602,8 +3834,8 @@ class XCXCAEAPOIDetector : public XCBase } // - void ApplySortOnPVFVG( - XCAPVFVG &items[] // + void ApplySortOnTrendFVG( + XCATRENDFVG &items[] // ) { // @@ -3618,7 +3850,7 @@ class XCXCAEAPOIDetector : public XCBase } // - XCAPVFVG tmp[]; + XCATRENDFVG tmp[]; Copy( items, tmp // @@ -3629,7 +3861,7 @@ class XCXCAEAPOIDetector : public XCBase while (HasChild(tmp)) { // - idx = GetOldest(items); + idx = GetOldest(tmp); has = IsValidIndex(idx); if (!has) { @@ -3637,7 +3869,7 @@ class XCXCAEAPOIDetector : public XCBase } // - XCAPVFVG iPVFVG = tmp[idx]; + XCATRENDFVG iTrendFVG = tmp[idx]; ArrayRemove( tmp, idx, @@ -3646,7 +3878,7 @@ class XCXCAEAPOIDetector : public XCBase // AddRef( - iPVFVG, + iTrendFVG, items // ); } diff --git a/XCAEA/Classes/xcaea.x-poi.drawer.class.mq5 b/XCAEA/Classes/xcaea.x-poi.drawer.class.mq5 index c68e7c78..c3205985 100644 --- a/XCAEA/Classes/xcaea.x-poi.drawer.class.mq5 +++ b/XCAEA/Classes/xcaea.x-poi.drawer.class.mq5 @@ -40,6 +40,7 @@ class XCXCAEAPOIDrawer : public XCBase // bool ignoreUpdateOSCTos; + bool drawTrendPivotsOnlySelectedFVG; // // Drawers ... @@ -54,8 +55,8 @@ class XCXCAEAPOIDrawer : public XCBase bool drawFVGBearishPivots; bool drawValeSupSWLPivots; bool drawPeakResSWHPivots; - bool drawPVFVGBullishPivots; - bool drawPVFVGBearishPivots; + bool drawTrendBullishPivots; + bool drawTrendBearishPivots; bool drawRSICrossedOverOSPivots; bool drawRSICrossedUnderOBPivots; bool drawCCICrossedOverOSPivots; @@ -81,13 +82,13 @@ class XCXCAEAPOIDrawer : public XCBase color peakResSWHPivotsColor; color trendLineBullishColor; color trendLineBearishColor; - color pvFVGBullishPivotsColor; - color pvFVGBearishPivotsColor; + color trendBullishPivotsColor; + color trendBearishPivotsColor; color rsiCrossedOverOSPivotsColor; color rsiCrossedUnderOBPivotsColor; color cciCrossedOverOSPivotsColor; color cciCrossedUnderOBPivotsColor; - + // // Width ... @@ -108,8 +109,8 @@ class XCXCAEAPOIDrawer : public XCBase int peakResSWHPivotsWidth; int trendLineBullishWidth; int trendLineBearishWidth; - int pvFVGBullishPivotsWidth; - int pvFVGBearishPivotsWidth; + int trendBullishPivotsWidth; + int trendBearishPivotsWidth; int rsiCrossedOverOSPivotsWidth; int rsiCrossedUnderOBPivotsWidth; int cciCrossedOverOSPivotsWidth; @@ -135,8 +136,8 @@ class XCXCAEAPOIDrawer : public XCBase ENUM_LINE_STYLE peakResSWHPivotsStyle; ENUM_LINE_STYLE trendLineBullishStyle; ENUM_LINE_STYLE trendLineBearishStyle; - ENUM_LINE_STYLE pvFVGBullishPivotsStyle; - ENUM_LINE_STYLE pvFVGBearishPivotsStyle; + ENUM_LINE_STYLE trendBullishPivotsStyle; + ENUM_LINE_STYLE trendBearishPivotsStyle; ENUM_LINE_STYLE rsiCrossedOverOSPivotsStyle; ENUM_LINE_STYLE rsiCrossedUnderOBPivotsStyle; ENUM_LINE_STYLE cciCrossedOverOSPivotsStyle; @@ -188,6 +189,7 @@ class XCXCAEAPOIDrawer : public XCBase { // ignoreUpdateOSCTos = true; + drawTrendPivotsOnlySelectedFVG = true; // drawTrendLine = false; @@ -201,8 +203,8 @@ class XCXCAEAPOIDrawer : public XCBase drawFVGBearishPivots = false; drawValeSupSWLPivots = false; drawPeakResSWHPivots = false; - drawPVFVGBullishPivots = false; - drawPVFVGBearishPivots = false; + drawTrendBullishPivots = false; + drawTrendBearishPivots = false; drawRSICrossedOverOSPivots = false; drawRSICrossedUnderOBPivots = false; drawCCICrossedOverOSPivots = false; @@ -222,73 +224,73 @@ class XCXCAEAPOIDrawer : public XCBase fvgBullishPivotsColor = defaultBullishColor; valeSupSWLPivotsColor = defaultBullishColor; trendLineBullishColor = defaultBullishColor; - pvFVGBullishPivotsColor = defaultBullishColor; + trendBullishPivotsColor = defaultBullishColor; rsiCrossedOverOSPivotsColor = defaultBullishColor; cciCrossedOverOSPivotsColor = defaultBullishColor; - + // rsiPeakPivotsColor = defaultBearishColor; cciPeakPivotsColor = defaultBearishColor; fvgBearishPivotsColor = defaultBearishColor; peakResSWHPivotsColor = defaultBearishColor; trendLineBearishColor = defaultBearishColor; - pvFVGBearishPivotsColor = defaultBearishColor; + trendBearishPivotsColor = defaultBearishColor; rsiCrossedUnderOBPivotsColor = defaultBearishColor; cciCrossedUnderOBPivotsColor = defaultBearishColor; - + // defaultBullishWidth = 1; defaultBearishWidth = 1; - + // tickPivotsWidth = defaultBullishWidth; volumePivotsWidth = defaultBearishWidth; - + // rsiValePivotsWidth = defaultBullishWidth; cciValePivotsWidth = defaultBullishWidth; fvgBullishPivotsWidth = defaultBullishWidth; valeSupSWLPivotsWidth = defaultBullishWidth; trendLineBullishWidth = defaultBullishWidth; - pvFVGBullishPivotsWidth = defaultBullishWidth; + trendBullishPivotsWidth = defaultBullishWidth; rsiCrossedOverOSPivotsWidth = defaultBullishWidth; cciCrossedOverOSPivotsWidth = defaultBullishWidth; - + // rsiPeakPivotsWidth = defaultBearishWidth; cciPeakPivotsWidth = defaultBearishWidth; fvgBearishPivotsWidth = defaultBearishWidth; peakResSWHPivotsWidth = defaultBearishWidth; trendLineBearishWidth = defaultBearishWidth; - pvFVGBearishPivotsWidth = defaultBearishWidth; + trendBearishPivotsWidth = defaultBearishWidth; rsiCrossedUnderOBPivotsWidth = defaultBearishWidth; cciCrossedUnderOBPivotsWidth = defaultBearishWidth; - + // defaultBullishStyle = STYLE_SOLID; defaultBearishStyle = STYLE_SOLID; - + // tickPivotsStyle = defaultBullishStyle; volumePivotsStyle = defaultBearishStyle; - + // rsiValePivotsStyle = defaultBullishStyle; cciValePivotsStyle = defaultBullishStyle; fvgBullishPivotsStyle = defaultBullishStyle; valeSupSWLPivotsStyle = defaultBullishStyle; trendLineBullishStyle = defaultBullishStyle; - pvFVGBullishPivotsStyle = defaultBullishStyle; + trendBullishPivotsStyle = defaultBullishStyle; rsiCrossedOverOSPivotsStyle = defaultBullishStyle; cciCrossedOverOSPivotsStyle = defaultBullishStyle; - + // rsiPeakPivotsStyle = defaultBearishStyle; cciPeakPivotsStyle = defaultBearishStyle; fvgBearishPivotsStyle = defaultBearishStyle; peakResSWHPivotsStyle = defaultBearishStyle; trendLineBearishStyle = defaultBearishStyle; - pvFVGBearishPivotsStyle = defaultBearishStyle; + trendBearishPivotsStyle = defaultBearishStyle; rsiCrossedUnderOBPivotsStyle = defaultBearishStyle; cciCrossedUnderOBPivotsStyle = defaultBearishStyle; } @@ -308,8 +310,8 @@ class XCXCAEAPOIDrawer : public XCBase DrawFVGBearishPivots(to); DrawValeSupSWLPivots(to); DrawPeakResSWHPivots(to); - DrawPVFVGBullishPivots(to); - DrawPVFVGBearishPivots(to); + DrawTrendBullishPivots(to); + DrawTrendBearishPivots(to); DrawRSICrossedOverOSPivots(to); DrawRSICrossedUnderOBPivots(to); DrawCCICrossedOverOSPivots(to); @@ -331,8 +333,8 @@ class XCXCAEAPOIDrawer : public XCBase mFVGBearishPivotObjects.Clear(); mValeSupSWLPivotObjects.Clear(); mPeakResSWHPivotObjects.Clear(); - mPVFVGBullishPivotObjects.Clear(); - mPVFVGBearishPivotObjects.Clear(); + mTrendBullishPivotObjects.Clear(); + mTrendBearishPivotObjects.Clear(); mRSICrossedOverOSPivotObjects.Clear(); mRSICrossedUnderOBPivotObjects.Clear(); mCCICrossedOverOSPivotObjects.Clear(); @@ -1035,17 +1037,17 @@ class XCXCAEAPOIDrawer : public XCBase } // - void DrawPVFVGBullishPivots(datetime to = NULL) + void DrawTrendBullishPivots(datetime to = NULL) { // - bool has = drawPVFVGBullishPivots; + bool has = drawTrendBullishPivots; if (!has) { return; } // - has = detector.HasPVFVGBullishPivots(); + has = detector.HasTrendBullishPivots(); if (!has) { return; @@ -1055,64 +1057,148 @@ class XCXCAEAPOIDrawer : public XCBase bool canUpdateTo = IsValid(to); // - int count = detector.CountPVFVGBullishPivots(); + int count = detector.CountTrendBullishPivots(); for (int i = 0; i < count; i++) { // - XBoxZone iBox; - has = detector.pvFVGBullishPivots[i].GetSelectedFVG(iBox); - if (!has) - { - // - iBox.Clean(); - continue; - } + XCATRENDFVG iTrendFVG = detector.trendBullishPivots[i]; + + // + // Draw Trend Box ... // if (canUpdateTo) { - iBox.to = to; + iTrendFVG.trend.to = to; } // - XCBoxObject *iObj; + XCBoxObject *iTrendBoxObj; has = drawer.DrawBox( - iBox, - iObj // + iTrendFVG.trend, + iTrendBoxObj // ); - - // if (has) { // // Style Object ... - iObj.BoxColor(pvFVGBullishPivotsColor); - iObj.BoxWidth(pvFVGBullishPivotsWidth); - iObj.BoxStyle(pvFVGBullishPivotsStyle); + iTrendBoxObj.BoxColor(trendBullishPivotsColor); + iTrendBoxObj.BoxWidth(trendBullishPivotsWidth); + iTrendBoxObj.BoxStyle(trendBullishPivotsStyle); // // Store Object ... - mPVFVGBullishPivotObjects.Add(iObj); + mTrendBullishPivotObjects.Add(iTrendBoxObj); } // - iBox.Clean(); - ZeroMemory(iObj); + // Draw ITrendFVG FVGS ... + if (drawTrendPivotsOnlySelectedFVG) + { + // + XBoxZone iBox; + has = iTrendFVG.GetSelectedFVG(iBox); + if (!has) + { + // + iBox.Clean(); + continue; + } + + // + if (canUpdateTo) + { + iBox.to = to; + } + + // + XCBoxObject *iObj; + has = drawer.DrawBox( + iBox, + iObj // + ); + + // + if (has) + { + // + // Style Object ... + iObj.BoxColor(fvgBullishPivotsColor); + iObj.BoxWidth(fvgBullishPivotsWidth); + iObj.BoxStyle(fvgBullishPivotsStyle); + + // + // Store Object ... + mTrendBullishPivotObjects.Add(iObj); + } + + // + iBox.Clean(); + ZeroMemory(iObj); + } + else + { + // + // Draw All FVGs ... + has = HasChild(iTrendFVG.fvgs); + if (has) + { + // + int jCount = ArraySize(iTrendFVG.fvgs); + for (int j = 0; j < jCount; j++) + { + // + XBoxZone iBox = iTrendFVG.fvgs[j]; + + // + if (canUpdateTo) { + iBox.to = to; + } + + // + XCBoxObject *iObj; + has = drawer.DrawBox( + iBox, + iObj // + ); + if (has) + { + // + // Style Object ... + iObj.BoxColor(fvgBullishPivotsColor); + iObj.BoxWidth(fvgBullishPivotsWidth); + iObj.BoxStyle(fvgBullishPivotsStyle); + + // + // Store Object ... + mTrendBullishPivotObjects.Add(iObj); + } + + // + iBox.Clean(); + ZeroMemory(iObj); + } + } + } + + // + iTrendFVG.Clean(); + ZeroMemory(iTrendBoxObj); } } // - void DrawPVFVGBearishPivots(datetime to = NULL) + void DrawTrendBearishPivots(datetime to = NULL) { // - bool has = drawPVFVGBearishPivots; + bool has = drawTrendBearishPivots; if (!has) { return; } // - has = detector.HasPVFVGBearishPivots(); + has = detector.HasTrendBearishPivots(); if (!has) { return; @@ -1122,54 +1208,138 @@ class XCXCAEAPOIDrawer : public XCBase bool canUpdateTo = IsValid(to); // - int count = detector.CountPVFVGBearishPivots(); + int count = detector.CountTrendBearishPivots(); for (int i = 0; i < count; i++) { // - XBoxZone iBox; - has = detector.pvFVGBearishPivots[i].GetSelectedFVG(iBox); - if (!has) - { - // - iBox.Clean(); - continue; - } + XCATRENDFVG iTrendFVG = detector.trendBearishPivots[i]; + + // + // Draw Trend Box ... // if (canUpdateTo) { - iBox.to = to; + iTrendFVG.trend.to = to; } // - XCBoxObject *iObj; + XCBoxObject *iTrendBoxObj; has = drawer.DrawBox( - iBox, - iObj // + iTrendFVG.trend, + iTrendBoxObj // ); - - // if (has) { // // Style Object ... - iObj.BoxColor(pvFVGBearishPivotsColor); - iObj.BoxWidth(pvFVGBearishPivotsWidth); - iObj.BoxStyle(pvFVGBearishPivotsStyle); + iTrendBoxObj.BoxColor(trendBearishPivotsColor); + iTrendBoxObj.BoxWidth(trendBearishPivotsWidth); + iTrendBoxObj.BoxStyle(trendBearishPivotsStyle); // // Store Object ... - mPVFVGBearishPivotObjects.Add(iObj); + mTrendBearishPivotObjects.Add(iTrendBoxObj); } // - iBox.Clean(); - ZeroMemory(iObj); + // Draw ITrendFVG FVGS ... + if (drawTrendPivotsOnlySelectedFVG) + { + // + XBoxZone iBox; + has = iTrendFVG.GetSelectedFVG(iBox); + if (!has) + { + // + iBox.Clean(); + continue; + } + + // + if (canUpdateTo) + { + iBox.to = to; + } + + // + XCBoxObject *iObj; + has = drawer.DrawBox( + iBox, + iObj // + ); + + // + if (has) + { + // + // Style Object ... + iObj.BoxColor(fvgBearishPivotsColor); + iObj.BoxWidth(fvgBearishPivotsWidth); + iObj.BoxStyle(fvgBearishPivotsStyle); + + // + // Store Object ... + mTrendBearishPivotObjects.Add(iObj); + } + + // + iBox.Clean(); + ZeroMemory(iObj); + } + else + { + // + // Draw All FVGs ... + has = HasChild(iTrendFVG.fvgs); + if (has) + { + // + int jCount = ArraySize(iTrendFVG.fvgs); + for (int j = 0; j < jCount; j++) + { + // + XBoxZone iBox = iTrendFVG.fvgs[j]; + + // + if (canUpdateTo) { + iBox.to = to; + } + + // + XCBoxObject *iObj; + has = drawer.DrawBox( + iBox, + iObj // + ); + if (has) + { + // + // Style Object ... + iObj.BoxColor(fvgBearishPivotsColor); + iObj.BoxWidth(fvgBearishPivotsWidth); + iObj.BoxStyle(fvgBearishPivotsStyle); + + // + // Store Object ... + mTrendBearishPivotObjects.Add(iObj); + } + + // + iBox.Clean(); + ZeroMemory(iObj); + } + } + } + + // + iTrendFVG.Clean(); + ZeroMemory(iTrendBoxObj); } } // - void DrawRSICrossedOverOSPivots(datetime to = NULL) + void DrawRSICrossedOverOSPivots(datetime to = NULL) { // bool has = drawRSICrossedOverOSPivots; @@ -1301,7 +1471,7 @@ class XCXCAEAPOIDrawer : public XCBase } // - void DrawCCICrossedOverOSPivots(datetime to = NULL) + void DrawCCICrossedOverOSPivots(datetime to = NULL) { // bool has = drawCCICrossedOverOSPivots; @@ -1460,8 +1630,8 @@ class XCXCAEAPOIDrawer : public XCBase CArrayObj mFVGBearishPivotObjects; CArrayObj mValeSupSWLPivotObjects; CArrayObj mPeakResSWHPivotObjects; - CArrayObj mPVFVGBullishPivotObjects; - CArrayObj mPVFVGBearishPivotObjects; + CArrayObj mTrendBullishPivotObjects; + CArrayObj mTrendBearishPivotObjects; CArrayObj mRSICrossedOverOSPivotObjects; CArrayObj mRSICrossedUnderOBPivotObjects; CArrayObj mCCICrossedOverOSPivotObjects; diff --git a/XCAEA/Helpers/xcaea.helper.mq5 b/XCAEA/Helpers/xcaea.helper.mq5 index 14f669f0..496fa5b2 100644 --- a/XCAEA/Helpers/xcaea.helper.mq5 +++ b/XCAEA/Helpers/xcaea.helper.mq5 @@ -25,10 +25,10 @@ #include "../../Classes/x-saherelm.x-bar.analyser.class.mq5" #include "../../Classes/x-saherelm.x-poi.class.mq5" #include "../../Classes/x-saherelm.x-poi.drawer.class.mq5" +#include "../../Helpers/x-saherelm.x121.x3ma.helper.mq5" #include "../../Helpers/x-saherelm.x121.xca.helper.mq5" #include "../../Helpers/x-saherelm.x121.xcc.helper.mq5" #include "../../Helpers/x-saherelm.x121.xct.helper.mq5" -#include "../../Helpers/x-saherelm.x121.x3ma.helper.mq5" #include "../../Helpers/x-saherelm.x121.xoscs.helper.mq5" // @@ -124,7 +124,7 @@ struct XCAEAInputs ccInputs.IsValid() && caInputs.IsValid() && x3maInputs.IsValid() && - oscsInputs.IsValid() + oscsInputs.IsValid() // ; @@ -215,6 +215,34 @@ struct XCAEAConditions bool isMediumCrossedOverSlow; bool isMediumCrossedUnderSlow; + // + bool is3MaBullishOrdered; + bool is3MaBearishOrdered; + + // + bool is3MaSwitchedToBullishOrdered; + bool is3MaSwitchedToBearishOrdered; + + // + bool is3MaBullishState; + bool is3MaBearishState; + + // + bool is3MaSwitchedToBullishState; + bool is3MaSwitchedToBearishState; + + // + bool is3MaBullish; + bool is3MaBearish; + + // + bool is3MaSwitchedToBullish; + bool is3MaSwitchedToBearish; + + // + bool is3MaFinishedFromBullish; + bool is3MaFinishedFromBearish; + // // XCA ... @@ -770,6 +798,34 @@ struct XCAEAConditions isMediumCrossedOverSlow = false; isMediumCrossedUnderSlow = false; + // + is3MaBullishOrdered = false; + is3MaBearishOrdered = false; + + // + is3MaSwitchedToBullishOrdered = false; + is3MaSwitchedToBearishOrdered = false; + + // + is3MaBullishState = false; + is3MaBearishState = false; + + // + is3MaSwitchedToBullishState = false; + is3MaSwitchedToBearishState = false; + + // + is3MaBullish = false; + is3MaBearish = false; + + // + is3MaSwitchedToBullish = false; + is3MaSwitchedToBearish = false; + + // + is3MaFinishedFromBullish = false; + is3MaFinishedFromBearish = false; + // // XCA ... @@ -910,7 +966,7 @@ struct XCAEAConditions // isSarFinishedFromBullish = false; isSarFinishedFromBearish = false; - + // // PEAK ... @@ -1287,6 +1343,36 @@ struct XCAEAConditions bullishScore += score; } + // + if (is3MaBullish) + { + bullishScore += minScore; + } + if (is3MaBullishState) + { + bullishScore += minScore; + } + if (is3MaBullishOrdered) + { + bullishScore += minScore; + } + if (is3MaSwitchedToBullish) + { + bullishScore += minScore; + } + if (is3MaFinishedFromBearish) + { + bullishScore += minScore; + } + if (is3MaSwitchedToBullishState) + { + bullishScore += minScore; + } + if (is3MaSwitchedToBullishOrdered) + { + bullishScore += minScore; + } + // if (isFastUnderSlow) { @@ -1313,6 +1399,35 @@ struct XCAEAConditions bearishScore += score; } + // + if (is3MaBearish) + { + bearishScore += minScore; + } + if (is3MaBearishState) + { + bearishScore += minScore; + } + if (is3MaBearishOrdered) + { + bearishScore += minScore; + } + if (is3MaSwitchedToBearish) + { + bearishScore += minScore; + } + if (is3MaFinishedFromBullish) + { + bearishScore += minScore; + } + if (is3MaSwitchedToBearishState) + { + bearishScore += minScore; + } + if (is3MaSwitchedToBearishOrdered) + { + bearishScore += minScore; + } // // KI ... @@ -2099,6 +2214,20 @@ struct XCAEAConditions ToString("isMediumUnderSlow", isMediumUnderSlow, ignoreFalseConditions, separator) + ToString("isMediumCrossedOverSlow", isMediumCrossedOverSlow, ignoreFalseConditions, separator) + ToString("isMediumCrossedUnderSlow", isMediumCrossedUnderSlow, ignoreFalseConditions, separator) + + ToString("is3MaBullishOrdered", is3MaBullishOrdered, ignoreFalseConditions, separator) + + ToString("is3MaBearishOrdered", is3MaBearishOrdered, ignoreFalseConditions, separator) + + ToString("is3MaSwitchedToBullishOrdered", is3MaSwitchedToBullishOrdered, ignoreFalseConditions, separator) + + ToString("is3MaSwitchedToBearishOrdered", is3MaSwitchedToBearishOrdered, ignoreFalseConditions, separator) + + ToString("is3MaBullishState", is3MaBullishState, ignoreFalseConditions, separator) + + ToString("is3MaBearishState", is3MaBearishState, ignoreFalseConditions, separator) + + ToString("is3MaSwitchedToBullishState", is3MaSwitchedToBullishState, ignoreFalseConditions, separator) + + ToString("is3MaSwitchedToBearishState", is3MaSwitchedToBearishState, ignoreFalseConditions, separator) + + ToString("is3MaBullish", is3MaBullish, ignoreFalseConditions, separator) + + ToString("is3MaBearish", is3MaBearish, ignoreFalseConditions, separator) + + ToString("is3MaSwitchedToBullish", is3MaSwitchedToBullish, ignoreFalseConditions, separator) + + ToString("is3MaSwitchedToBearish", is3MaSwitchedToBearish, ignoreFalseConditions, separator) + + ToString("is3MaFinishedFromBullish", is3MaFinishedFromBullish, ignoreFalseConditions, separator) + + ToString("is3MaFinishedFromBearish", is3MaFinishedFromBearish, ignoreFalseConditions, separator) + "-----------------------" + separator + "XCA: " + separator + "-----------------------" + separator + @@ -2758,8 +2887,8 @@ class XCXCAEAHelper : XCBase */ bool Get3MAConditions( X121X3MAConditions &conditions, // - int barIndex = 0, // - int loopback = 5 // + int barIndex = 0, // + int loopback = 5 // ) { // @@ -2896,7 +3025,7 @@ class XCXCAEAHelper : XCBase result = result && zBar.GetPreviousBar(cBar); - result = + result = result && cBar.GetPreviousBar(pBar); result = @@ -2975,59 +3104,73 @@ class XCXCAEAHelper : XCBase // // Buffers ... - + // - Copy ( + Copy( x3maConditions.fastBuffer, conditions.fastBuffer // ); - + // - Copy ( + Copy( x3maConditions.mediumBuffer, conditions.mediumBuffer // ); - + // - Copy ( + Copy( x3maConditions.slowBuffer, conditions.slowBuffer // ); - + // - Copy ( + Copy( x3maConditions.fastStateBuffer, conditions.fastStateBuffer // ); - + // - Copy ( + Copy( x3maConditions.mediumStateBuffer, conditions.mediumStateBuffer // ); - + // - Copy ( + Copy( x3maConditions.slowStateBuffer, conditions.slowStateBuffer // - ); - + ); + // // Conditions ... // + conditions.is3MaBullish = x3maConditions.is3MaBullish; + conditions.is3MaBearish = x3maConditions.is3MaBearish; conditions.isFastOverSlow = x3maConditions.isFastOverSlow; conditions.isFastUnderSlow = x3maConditions.isFastUnderSlow; conditions.isFastOverMedium = x3maConditions.isFastOverMedium; conditions.isMediumOverSlow = x3maConditions.isMediumOverSlow; conditions.isFastUnderMedium = x3maConditions.isFastUnderMedium; conditions.isMediumUnderSlow = x3maConditions.isMediumUnderSlow; + conditions.is3MaBullishState = x3maConditions.is3MaBullishState; + conditions.is3MaBearishState = x3maConditions.is3MaBearishState; + conditions.is3MaBullishOrdered = x3maConditions.is3MaBullishOrdered; + conditions.is3MaBearishOrdered = x3maConditions.is3MaBearishOrdered; conditions.isFastCrossedOverSlow = x3maConditions.isFastCrossedOverSlow; + conditions.is3MaSwitchedToBullish = x3maConditions.is3MaSwitchedToBullish; + conditions.is3MaSwitchedToBearish = x3maConditions.is3MaSwitchedToBearish; conditions.isFastCrossedUnderSlow = x3maConditions.isFastCrossedUnderSlow; conditions.isFastCrossedOverMedium = x3maConditions.isFastCrossedOverMedium; conditions.isMediumCrossedOverSlow = x3maConditions.isMediumCrossedOverSlow; + conditions.is3MaFinishedFromBullish = x3maConditions.is3MaFinishedFromBullish; + conditions.is3MaFinishedFromBearish = x3maConditions.is3MaFinishedFromBearish; conditions.isFastCrossedUnderMedium = x3maConditions.isFastCrossedUnderMedium; conditions.isMediumCrossedUnderSlow = x3maConditions.isMediumCrossedUnderSlow; + conditions.is3MaSwitchedToBullishState = x3maConditions.is3MaSwitchedToBullishState; + conditions.is3MaSwitchedToBearishState = x3maConditions.is3MaSwitchedToBearishState; + conditions.is3MaSwitchedToBullishOrdered = x3maConditions.is3MaSwitchedToBullishOrdered; + conditions.is3MaSwitchedToBearishOrdered = x3maConditions.is3MaSwitchedToBearishOrdered; // // XCA ... @@ -3551,4 +3694,4 @@ class XCXCAEAHelper : XCBase int stochasticHandler; }; -// \ No newline at end of file +// \ No newline at end of file diff --git a/XCAEA/Libraries/xcaea.signaller.lib.mq5 b/XCAEA/Libraries/xcaea.signaller.lib.mq5 index c9ff8a81..299a9204 100644 --- a/XCAEA/Libraries/xcaea.signaller.lib.mq5 +++ b/XCAEA/Libraries/xcaea.signaller.lib.mq5 @@ -666,17 +666,98 @@ bool DetectXCAEAConditions( // Conditions ... // + // PEAK ... double zPeak = conditions.peakBuffer[zIDX]; double cPeak = conditions.peakBuffer[cIDX]; double pPeak = conditions.peakBuffer[pIDX]; double p2Peak = conditions.peakBuffer[p2IDX]; // + // VALE ... double zVale = conditions.valeBuffer[zIDX]; double cVale = conditions.valeBuffer[cIDX]; double pVale = conditions.valeBuffer[pIDX]; double p2Vale = conditions.valeBuffer[p2IDX]; + // + // X3MA ... + + // + // FAST ... + + // + double z3MAFast = conditions.fastBuffer[zIDX]; + double c3MAFast = conditions.fastBuffer[cIDX]; + double p3MAFast = conditions.fastBuffer[pIDX]; + double p23MAFast = conditions.fastBuffer[p2IDX]; + + // + double z3MAFastState = conditions.fastStateBuffer[zIDX]; + double c3MAFastState = conditions.fastStateBuffer[cIDX]; + double p3MAFastState = conditions.fastStateBuffer[pIDX]; + double p23MAFastState = conditions.fastStateBuffer[p2IDX]; + + // + // MEDIUM ... + + // + double z3MAMedium = conditions.mediumBuffer[zIDX]; + double c3MAMedium = conditions.mediumBuffer[cIDX]; + double p3MAMedium = conditions.mediumBuffer[pIDX]; + double p23MAMedium = conditions.mediumBuffer[p2IDX]; + + // + double z3MAMediumState = conditions.mediumStateBuffer[zIDX]; + double c3MAMediumState = conditions.mediumStateBuffer[cIDX]; + double p3MAMediumState = conditions.mediumStateBuffer[pIDX]; + double p23MAMediumState = conditions.mediumStateBuffer[p2IDX]; + + // + // SLOW ... + + // + double z3MASlow = conditions.slowBuffer[zIDX]; + double c3MASlow = conditions.slowBuffer[cIDX]; + double p3MASlow = conditions.slowBuffer[pIDX]; + double p23MASlow = conditions.slowBuffer[p2IDX]; + + // + double z3MASlowState = conditions.slowStateBuffer[zIDX]; + double c3MASlowState = conditions.slowStateBuffer[cIDX]; + double p3MASlowState = conditions.slowStateBuffer[pIDX]; + double p23MASlowState = conditions.slowStateBuffer[p2IDX]; + + // + double x3maBullishGapUpper = c3MAMedium; + double x3maBullishGapLower = c3MASlow; + + // + double x3maBearishGapUpper = c3MASlow; + double x3maBearishGapLower = c3MAMedium; + + // + // Create Conditions ... + + // + bool isX3MABullishState = + z3MAFast > c3MAFast && + isCBarValidForBullish && + c3MAFast > c3MAMedium && + isCBarBullishRejected && + c3MAMedium > c3MASlow && + cBar.low < x3maBullishGapLower && + cBar.GetDown() > x3maBullishGapLower; + + // + bool isX3MABearishState = + z3MAFast < c3MAFast && + isCBarValidForBearish && + c3MAFast < c3MAMedium && + isCBarBearishRejected && + c3MAMedium < c3MASlow && + cBar.high > x3maBearishGapLower && + cBar.GetUp() < x3maBearishGapLower; + // // Parsing Pivots ... diff --git a/XCAEA/Signals/xcaea.signaller.class.mq5 b/XCAEA/Signals/xcaea.signaller.class.mq5 index 863e6e0e..83ed95f4 100644 --- a/XCAEA/Signals/xcaea.signaller.class.mq5 +++ b/XCAEA/Signals/xcaea.signaller.class.mq5 @@ -813,12 +813,12 @@ class XCXCAEASignaller : XCBase // // XOSCS ... - inputs.oscsInputs.rsiLength = 4; - inputs.oscsInputs.rsiOBLevel = 90; - inputs.oscsInputs.rsiOSLevel = 10; - inputs.oscsInputs.cciLength = 7; - inputs.oscsInputs.cciOBLevel = 130; - inputs.oscsInputs.cciOSLevel = -130; + // inputs.oscsInputs.rsiLength = 4; + // inputs.oscsInputs.rsiOBLevel = 90; + // inputs.oscsInputs.rsiOSLevel = 10; + // inputs.oscsInputs.cciLength = 7; + // inputs.oscsInputs.cciOBLevel = 130; + // inputs.oscsInputs.cciOSLevel = -130; // inputs.oscsInputs.mfiLength = 5; // inputs.oscsInputs.rviLength = 5; @@ -861,21 +861,24 @@ class XCXCAEASignaller : XCBase detector.detectCCIValePivots = false; detector.detectFVGBullishPivots = false; detector.detectFVGBearishPivots = false; - detector.detectValeSupSWLPivots = true; - detector.detectPeakResSWHPivots = true; - detector.detectPVFVGBullishPivots = true; - detector.detectPVFVGBearishPivots = true; - detector.detectRSICrossedOverOSPivots = true; - detector.detectRSICrossedUnderOBPivots = true; detector.detectCCICrossedOverOSPivots = false; detector.detectCCICrossedUnderOBPivots = false; + // + detector.detectValeSupSWLPivots = true; + detector.detectPeakResSWHPivots = true; + detector.detectTrendBullishPivots = true; + detector.detectTrendBearishPivots = true; + detector.detectRSICrossedOverOSPivots = true; + detector.detectRSICrossedUnderOBPivots = true; + // // Initialize and Configure Drawer ... drawer = new XCXCAEAPOIDrawer(detector); // drawer.ignoreUpdateOSCTos = true; + drawer.drawTrendPivotsOnlySelectedFVG = true; // // Configure Drawer ... @@ -888,14 +891,16 @@ class XCXCAEASignaller : XCBase drawer.drawCCIValePivots = false; drawer.drawFVGBullishPivots = false; drawer.drawFVGBearishPivots = false; + drawer.drawCCICrossedOverOSPivots = false; + drawer.drawCCICrossedUnderOBPivots = false; + + // drawer.drawValeSupSWLPivots = true; drawer.drawPeakResSWHPivots = true; - drawer.drawPVFVGBullishPivots = true; - drawer.drawPVFVGBearishPivots = true; + drawer.drawTrendBullishPivots = true; + drawer.drawTrendBearishPivots = true; drawer.drawRSICrossedOverOSPivots = true; drawer.drawRSICrossedUnderOBPivots = true; - drawer.drawCCICrossedOverOSPivots = true; - drawer.drawCCICrossedUnderOBPivots = true; // // Configure Widths ... @@ -911,8 +916,8 @@ class XCXCAEASignaller : XCBase drawer.peakResSWHPivotsWidth = 1; drawer.trendLineBullishWidth = 4; drawer.trendLineBullishWidth = 4; - drawer.pvFVGBullishPivotsWidth = 1; - drawer.pvFVGBearishPivotsWidth = 1; + drawer.trendBullishPivotsWidth = 1; + drawer.trendBearishPivotsWidth = 1; drawer.rsiCrossedOverOSPivotsWidth = 4; drawer.rsiCrossedUnderOBPivotsWidth = 4; drawer.cciCrossedOverOSPivotsWidth = 4; @@ -926,14 +931,14 @@ class XCXCAEASignaller : XCBase drawer.rsiValePivotsColor = clrAqua; drawer.cciPeakPivotsColor = clrMagenta; drawer.cciValePivotsColor = clrAqua; - drawer.fvgBullishPivotsColor = clrLime; - drawer.fvgBearishPivotsColor = clrRed; + drawer.fvgBullishPivotsColor = clrAqua; + drawer.fvgBearishPivotsColor = clrMagenta; drawer.valeSupSWLPivotsColor = clrAqua; drawer.peakResSWHPivotsColor = clrMagenta; drawer.trendLineBullishColor = clrAqua; drawer.trendLineBullishColor = clrMagenta; - drawer.pvFVGBullishPivotsColor = clrLime; - drawer.pvFVGBearishPivotsColor = clrRed; + drawer.trendBullishPivotsColor = clrLime; + drawer.trendBearishPivotsColor = clrRed; drawer.rsiCrossedOverOSPivotsColor = clrAqua; drawer.rsiCrossedUnderOBPivotsColor = clrMagenta; drawer.cciCrossedOverOSPivotsColor = clrAqua; @@ -953,8 +958,8 @@ class XCXCAEASignaller : XCBase drawer.peakResSWHPivotsStyle = STYLE_SOLID; drawer.trendLineBullishWidth = STYLE_SOLID; drawer.trendLineBullishWidth = STYLE_SOLID; - drawer.pvFVGBullishPivotsStyle = STYLE_DASHDOTDOT; - drawer.pvFVGBearishPivotsStyle = STYLE_DASHDOTDOT; + drawer.trendBullishPivotsStyle = STYLE_DASHDOTDOT; + drawer.trendBearishPivotsStyle = STYLE_DASHDOTDOT; drawer.rsiCrossedOverOSPivotsStyle = STYLE_DASHDOTDOT; drawer.rsiCrossedUnderOBPivotsStyle = STYLE_DASHDOTDOT; drawer.cciCrossedOverOSPivotsStyle = STYLE_DASHDOTDOT;