diff --git a/Libraries/x-saherelm.x-poi.lib.mq5 b/Libraries/x-saherelm.x-poi.lib.mq5 index a906e266..bf8b28f4 100644 --- a/Libraries/x-saherelm.x-poi.lib.mq5 +++ b/Libraries/x-saherelm.x-poi.lib.mq5 @@ -5465,7 +5465,7 @@ struct XBoxZone // string typeStr = IsValid(type) - ? type + "_" + ? type : "XBOX"; string result = // diff --git a/XCAEA/Classes/xcaea.x-poi.detector.class.mq5 b/XCAEA/Classes/xcaea.x-poi.detector.class.mq5 index 571c4aae..f0016b6e 100644 --- a/XCAEA/Classes/xcaea.x-poi.detector.class.mq5 +++ b/XCAEA/Classes/xcaea.x-poi.detector.class.mq5 @@ -39,10 +39,16 @@ enum ENUM_XCA_PIVOTS 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 @@ -327,8 +333,11 @@ struct XCAPivot 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: @@ -341,8 +350,11 @@ struct XCAPivot 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: @@ -391,6 +403,12 @@ struct XCAPivot // 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) { @@ -520,6 +538,8 @@ class XCXCAEAPOIDetector : public XCBase bool detectValePivot; bool detectKIBullishPivot; bool detectKIBearishPivot; + bool detectFVGBullishPivot; + bool detectFVGBearishPivot; bool detectTKIBullishPivot; bool detectTKIBearishPivot; bool detectPeakSWHResPivot; @@ -530,8 +550,12 @@ class XCXCAEAPOIDetector : public XCBase bool detectTrendBearishPivot; bool detectTKITRNDBullishPivot; bool detectTKITRNDBearishPivot; + bool detectRSIPeakPivot; + bool detectRSIValePivot; bool detectRSICrossedOverOSPivot; bool detectRSICrossedUnderOBPivot; + bool detectCCIPeakPivot; + bool detectCCIValePivot; bool detectCCICrossedOverOSPivot; bool detectCCICrossedUnderOBPivot; @@ -576,6 +600,8 @@ class XCXCAEAPOIDetector : public XCBase XCAPivot hSameLLPivots[]; XCAPivot kiBullishPivots[]; XCAPivot kiBearishPivots[]; + XCAPivot fvgBullishPivots[]; + XCAPivot fvgBearishPivots[]; XCAPivot tkiBullishPivots[]; XCAPivot tkiBearishPivots[]; XCAPivot peakSWHResPivots[]; @@ -586,8 +612,14 @@ class XCXCAEAPOIDetector : public XCBase XCAPivot tkitrndBearishPivots[]; // + XCAPivot rsiPeakPivots[]; + XCAPivot rsiValePivots[]; XCAPivot rsiCrossedOverOSPivots[]; XCAPivot rsiCrossedUnderOBPivots[]; + + // + XCAPivot cciPeakPivots[]; + XCAPivot cciValePivots[]; XCAPivot cciCrossedOverOSPivots[]; XCAPivot cciCrossedUnderOBPivots[]; @@ -686,8 +718,14 @@ class XCXCAEAPOIDetector : public XCBase detectSWLPivot = true; detectPeakPivot = true; detectValePivot = true; + detectRSIPeakPivot = true; + detectRSIValePivot = true; + detectCCIPeakPivot = true; + detectCCIValePivot = true; detectKIBullishPivot = true; detectKIBearishPivot = true; + detectFVGBullishPivot = true; + detectFVGBearishPivot = true; detectTKIBullishPivot = true; detectTKIBearishPivot = true; detectPeakSWHResPivot = true; @@ -776,6 +814,23 @@ class XCXCAEAPOIDetector : public XCBase continue; } + // + XBoxZone fvgBox; + bool isFVG = barAnalyser.IsFVG( + cBar, + fvgBox // + ); + + // + bool isBullishFVG = + isFVG && + fvgBox.IsBullish(); + + // + bool isBearishFVG = + isFVG && + fvgBox.IsBearish(); + // // Provide Some Conditions ... @@ -1278,6 +1333,18 @@ class XCXCAEAPOIDetector : public XCBase double pRSI = iConditions.rsiBuffer[pIDX]; double p2RSI = iConditions.rsiBuffer[p2IDX]; + // + bool isRSIPeak = + pRSI > cRSI && + pRSI > p2RSI && + pRSI > zRSI; + + // + bool isRSIVale = + pRSI < cRSI && + pRSI < p2RSI && + pRSI < zRSI; + // bool isRSIBullishVPattern = cRSI > pRSI && @@ -1301,6 +1368,18 @@ class XCXCAEAPOIDetector : public XCBase double pCCI = iConditions.cciBuffer[pIDX]; double p2CCI = iConditions.cciBuffer[p2IDX]; + // + bool isCCIPeak = + pCCI > cCCI && + pCCI > p2CCI && + pCCI > zCCI; + + // + bool isCCIVale = + pCCI < cCCI && + pCCI < p2CCI && + pCCI < zCCI; + // bool isCCIBullishVPattern = cCCI > pCCI && @@ -1917,6 +1996,66 @@ class XCXCAEAPOIDetector : public XCBase } } + // + // FVG Bullish ... + if (detectFVGBullishPivot) + { + // + if (isBullishFVG) + { + // + XCAPivot iPivot; + + // + iPivot.to = fvgBox.to; + iPivot.from = fvgBox.from; + iPivot.type = XCA_FVG_BULL; + iPivot.value = fvgBox.upper; + iPivot.reserve = fvgBox.lower; + iPivot.symbol = fvgBox.symbol; + iPivot.period = fvgBox.period; + + // + AddPivot( + iPivot, + fvgBullishPivots // + ); + + // + iPivot.Clean(); + } + } + + // + // FVG Bearish ... + if (detectFVGBearishPivot) + { + // + if (isBearishFVG) + { + // + XCAPivot iPivot; + + // + iPivot.to = fvgBox.to; + iPivot.from = fvgBox.from; + iPivot.type = XCA_FVG_BEAR; + iPivot.value = fvgBox.lower; + iPivot.reserve = fvgBox.upper; + iPivot.symbol = fvgBox.symbol; + iPivot.period = fvgBox.period; + + // + AddPivot( + iPivot, + fvgBearishPivots // + ); + + // + iPivot.Clean(); + } + } + // // TKI Bullish ... if (detectTKIBullishPivot) @@ -3129,6 +3268,122 @@ class XCXCAEAPOIDetector : public XCBase } } + // + // RSI Peak ... + if (detectRSIPeakPivot) + { + // + if (isRSIPeak) + { + // + XCAPivot iPivot; + + // + iPivot.to = cBar.time; + iPivot.from = p2Bar.time; + iPivot.value = pBar.high; + iPivot.type = XCA_RSI_PEAK; + iPivot.symbol = cBar.symbol; + iPivot.period = cBar.period; + + // + Add( + cBar.high, + iPivot.values // + ); + Add( + pBar.high, + iPivot.values // + ); + Add( + p2Bar.high, + iPivot.values // + ); + Add( + cBar.close, + iPivot.values // + ); + Add( + pBar.close, + iPivot.values // + ); + Add( + p2Bar.close, + iPivot.values // + ); + + // + iPivot.reserve = GetMin(iPivot.values); + + // + AddPivot( + iPivot, + rsiPeakPivots // + ); + + // + iPivot.Clean(); + } + } + + // + // RSI Vale ... + if (detectRSIValePivot) + { + // + if (isRSIVale) + { + // + XCAPivot iPivot; + + // + iPivot.to = cBar.time; + iPivot.from = p2Bar.time; + iPivot.value = pBar.low; + iPivot.type = XCA_RSI_VALE; + iPivot.symbol = cBar.symbol; + iPivot.period = cBar.period; + + // + Add( + cBar.low, + iPivot.values // + ); + Add( + pBar.low, + iPivot.values // + ); + Add( + p2Bar.low, + iPivot.values // + ); + Add( + cBar.close, + iPivot.values // + ); + Add( + pBar.close, + iPivot.values // + ); + Add( + p2Bar.close, + iPivot.values // + ); + + // + iPivot.reserve = GetMax(iPivot.values); + + // + AddPivot( + iPivot, + rsiValePivots // + ); + + // + iPivot.Clean(); + } + } + // // RSI Crossed Over OS ... if (detectRSICrossedOverOSPivot) @@ -3245,6 +3500,122 @@ class XCXCAEAPOIDetector : public XCBase } } + // + // CCI Peak ... + if (detectCCIPeakPivot) + { + // + if (isCCIPeak) + { + // + XCAPivot iPivot; + + // + iPivot.to = cBar.time; + iPivot.from = p2Bar.time; + iPivot.value = pBar.high; + iPivot.type = XCA_CCI_PEAK; + iPivot.symbol = cBar.symbol; + iPivot.period = cBar.period; + + // + Add( + cBar.high, + iPivot.values // + ); + Add( + pBar.high, + iPivot.values // + ); + Add( + p2Bar.high, + iPivot.values // + ); + Add( + cBar.close, + iPivot.values // + ); + Add( + pBar.close, + iPivot.values // + ); + Add( + p2Bar.close, + iPivot.values // + ); + + // + iPivot.reserve = GetMin(iPivot.values); + + // + AddPivot( + iPivot, + cciPeakPivots // + ); + + // + iPivot.Clean(); + } + } + + // + // CCI Vale ... + if (detectCCIValePivot) + { + // + if (isCCIVale) + { + // + XCAPivot iPivot; + + // + iPivot.to = cBar.time; + iPivot.from = p2Bar.time; + iPivot.value = pBar.low; + iPivot.type = XCA_CCI_VALE; + iPivot.symbol = cBar.symbol; + iPivot.period = cBar.period; + + // + Add( + cBar.low, + iPivot.values // + ); + Add( + pBar.low, + iPivot.values // + ); + Add( + p2Bar.low, + iPivot.values // + ); + Add( + cBar.close, + iPivot.values // + ); + Add( + pBar.close, + iPivot.values // + ); + Add( + p2Bar.close, + iPivot.values // + ); + + // + iPivot.reserve = GetMax(iPivot.values); + + // + AddPivot( + iPivot, + cciValePivots // + ); + + // + iPivot.Clean(); + } + } + // // CCI Crossed Over OS ... if (detectCCICrossedOverOSPivot) @@ -3369,6 +3740,7 @@ class XCXCAEAPOIDetector : public XCBase cBar.Clean(); pBar.Clean(); p2Bar.Clean(); + fvgBox.Clean(); iConditions.Clean(); } @@ -4239,6 +4611,82 @@ class XCXCAEAPOIDetector : public XCBase Clean(tmp); } + // + has = HasRSIPeakPivots(); + if (has) + { + // + Copy( + rsiPeakPivots, + tmp // + ); + Clean(rsiPeakPivots); + while (HasChild(tmp)) + { + // + XCAPivot iPivot = tmp[0]; + ArrayRemove( + tmp, + 0, + 1 // + ); + + // + has = IsPivotBreaked( + iPivot, + unAvailableBoxes, + barIndex // + ); + if (!has) + { + // + AddRef( + iPivot, + rsiPeakPivots // + ); + } + } + Clean(tmp); + } + + // + has = HasRSIValePivots(); + if (has) + { + // + Copy( + rsiValePivots, + tmp // + ); + Clean(rsiValePivots); + while (HasChild(tmp)) + { + // + XCAPivot iPivot = tmp[0]; + ArrayRemove( + tmp, + 0, + 1 // + ); + + // + has = IsPivotBreaked( + iPivot, + unAvailableBoxes, + barIndex // + ); + if (!has) + { + // + AddRef( + iPivot, + rsiValePivots // + ); + } + } + Clean(tmp); + } + // has = HasRSICrossedOverOSPivots(); if (has) @@ -4315,6 +4763,82 @@ class XCXCAEAPOIDetector : public XCBase Clean(tmp); } + // + has = HasCCIPeakPivots(); + if (has) + { + // + Copy( + cciPeakPivots, + tmp // + ); + Clean(cciPeakPivots); + while (HasChild(tmp)) + { + // + XCAPivot iPivot = tmp[0]; + ArrayRemove( + tmp, + 0, + 1 // + ); + + // + has = IsPivotBreaked( + iPivot, + unAvailableBoxes, + barIndex // + ); + if (!has) + { + // + AddRef( + iPivot, + cciPeakPivots // + ); + } + } + Clean(tmp); + } + + // + has = HasCCIValePivots(); + if (has) + { + // + Copy( + cciValePivots, + tmp // + ); + Clean(cciValePivots); + while (HasChild(tmp)) + { + // + XCAPivot iPivot = tmp[0]; + ArrayRemove( + tmp, + 0, + 1 // + ); + + // + has = IsPivotBreaked( + iPivot, + unAvailableBoxes, + barIndex // + ); + if (!has) + { + // + AddRef( + iPivot, + cciValePivots // + ); + } + } + Clean(tmp); + } + // has = HasCCICrossedOverOSPivots(); if (has) @@ -4391,6 +4915,82 @@ class XCXCAEAPOIDetector : public XCBase Clean(tmp); } + // + has = HasFVGBullishPivots(); + if (has) + { + // + Copy( + fvgBullishPivots, + tmp // + ); + Clean(fvgBullishPivots); + while (HasChild(tmp)) + { + // + XCAPivot iPivot = tmp[0]; + ArrayRemove( + tmp, + 0, + 1 // + ); + + // + has = IsPivotBreaked( + iPivot, + unAvailableBoxes, + barIndex // + ); + if (!has) + { + // + AddRef( + iPivot, + fvgBullishPivots // + ); + } + } + Clean(tmp); + } + + // + has = HasFVGBearishPivots(); + if (has) + { + // + Copy( + fvgBearishPivots, + tmp // + ); + Clean(fvgBearishPivots); + while (HasChild(tmp)) + { + // + XCAPivot iPivot = tmp[0]; + ArrayRemove( + tmp, + 0, + 1 // + ); + + // + has = IsPivotBreaked( + iPivot, + unAvailableBoxes, + barIndex // + ); + if (!has) + { + // + AddRef( + iPivot, + fvgBearishPivots // + ); + } + } + Clean(tmp); + } + // } @@ -4584,6 +5184,31 @@ class XCXCAEAPOIDetector : public XCBase } } + // + has = HasFVGBullishPivots(); + if (has) + { + // + count = CountFVGBullishPivots(); + for (int i = 0; i < count; i++) + { + // + XBoxZone iBox; + has = fvgBullishPivots[i].AsBox(iBox); + if (has) + { + // + AddRef( + iBox, + boxes // + ); + } + + // + iBox.Clean(); + } + } + // has = HasValeSWLSupPivots(); if (has) @@ -4684,6 +5309,31 @@ class XCXCAEAPOIDetector : public XCBase } } + // + has = HasRSIValePivots(); + if (has) + { + // + count = CountRSIValePivots(); + for (int i = 0; i < count; i++) + { + // + XBoxZone iBox; + has = rsiValePivots[i].AsBox(iBox); + if (has) + { + // + AddRef( + iBox, + boxes // + ); + } + + // + iBox.Clean(); + } + } + // has = HasRSICrossedOverOSPivots(); if (has) @@ -4709,6 +5359,31 @@ class XCXCAEAPOIDetector : public XCBase } } + // + has = HasCCIValePivots(); + if (has) + { + // + count = CountCCIValePivots(); + for (int i = 0; i < count; i++) + { + // + XBoxZone iBox; + has = cciValePivots[i].AsBox(iBox); + if (has) + { + // + AddRef( + iBox, + boxes // + ); + } + + // + iBox.Clean(); + } + } + // has = HasCCICrossedOverOSPivots(); if (has) @@ -4931,6 +5606,31 @@ class XCXCAEAPOIDetector : public XCBase } } + // + has = HasFVGBearishPivots(); + if (has) + { + // + count = CountFVGBearishPivots(); + for (int i = 0; i < count; i++) + { + // + XBoxZone iBox; + has = fvgBearishPivots[i].AsBox(iBox); + if (has) + { + // + AddRef( + iBox, + boxes // + ); + } + + // + iBox.Clean(); + } + } + // has = HasPeakSWHResPivots(); if (has) @@ -5031,6 +5731,31 @@ class XCXCAEAPOIDetector : public XCBase } } + // + has = HasRSIPeakPivots(); + if (has) + { + // + count = CountRSIPeakPivots(); + for (int i = 0; i < count; i++) + { + // + XBoxZone iBox; + has = rsiPeakPivots[i].AsBox(iBox); + if (has) + { + // + AddRef( + iBox, + boxes // + ); + } + + // + iBox.Clean(); + } + } + // has = HasRSICrossedUnderOBPivots(); if (has) @@ -5056,6 +5781,31 @@ class XCXCAEAPOIDetector : public XCBase } } + // + has = HasCCIPeakPivots(); + if (has) + { + // + count = CountCCIPeakPivots(); + for (int i = 0; i < count; i++) + { + // + XBoxZone iBox; + has = cciPeakPivots[i].AsBox(iBox); + if (has) + { + // + AddRef( + iBox, + boxes // + ); + } + + // + iBox.Clean(); + } + } + // has = HasCCICrossedUnderOBPivots(); if (has) @@ -5208,6 +5958,33 @@ class XCXCAEAPOIDetector : public XCBase return ArraySize(kiBearishPivots); } + // + // FVG ... + + // + bool HasFVGBullishPivots() + { + return HasChild(fvgBullishPivots); + } + + // + int CountFVGBullishPivots() + { + return ArraySize(fvgBullishPivots); + } + + // + bool HasFVGBearishPivots() + { + return HasChild(fvgBearishPivots); + } + + // + int CountFVGBearishPivots() + { + return ArraySize(fvgBearishPivots); + } + // // TKI ... @@ -5388,6 +6165,30 @@ class XCXCAEAPOIDetector : public XCBase return ArraySize(hSameHHPivots); } + // + bool HasRSIPeakPivots() + { + return HasChild(rsiPeakPivots); + } + + // + int CountRSIPeakPivots() + { + return ArraySize(rsiPeakPivots); + } + + // + bool HasRSIValePivots() + { + return HasChild(rsiValePivots); + } + + // + int CountRSIValePivots() + { + return ArraySize(rsiValePivots); + } + // bool HasRSICrossedOverOSPivots() { @@ -5412,6 +6213,30 @@ class XCXCAEAPOIDetector : public XCBase return ArraySize(rsiCrossedUnderOBPivots); } + // + bool HasCCIPeakPivots() + { + return HasChild(cciPeakPivots); + } + + // + int CountCCIPeakPivots() + { + return ArraySize(cciPeakPivots); + } + + // + bool HasCCIValePivots() + { + return HasChild(cciValePivots); + } + + // + int CountCCIValePivots() + { + return ArraySize(cciValePivots); + } + // bool HasCCICrossedOverOSPivots() { diff --git a/XCAEA/Classes/xcaea.x-poi.drawer.class.mq5 b/XCAEA/Classes/xcaea.x-poi.drawer.class.mq5 index 37828176..5cd7f85c 100644 --- a/XCAEA/Classes/xcaea.x-poi.drawer.class.mq5 +++ b/XCAEA/Classes/xcaea.x-poi.drawer.class.mq5 @@ -40,8 +40,14 @@ class XCXCAEAPOIDrawer : public XCBase bool drawSWLPivots; bool drawPeakPivots; bool drawValePivots; + bool drawRSIPeakPivots; + bool drawRSIValePivots; + bool drawCCIPeakPivots; + bool drawCCIValePivots; bool drawKIBullishPivots; bool drawKIBearishPivots; + bool drawFVGBullishPivots; + bool drawFVGBearishPivots; bool drawPeakSWHResPivots; bool drawValeSWLSupPivots; bool drawTKIBullishPivots; @@ -80,8 +86,14 @@ class XCXCAEAPOIDrawer : public XCBase mSWLPivotObjects.Clear(); mPeakPivotObjects.Clear(); mValePivotObjects.Clear(); + mRSIPeakPivotObjects.Clear(); + mRSIValePivotObjects.Clear(); + mCCIPeakPivotObjects.Clear(); + mCCIValePivotObjects.Clear(); mKIBullishPivotObjects.Clear(); mKIBearishPivotObjects.Clear(); + mFVGBullishPivotObjects.Clear(); + mFVGBearishPivotObjects.Clear(); mPeakSWHResPivotObjects.Clear(); mValeSWLSupPivotObjects.Clear(); mTKIBullishPivotObjects.Clear(); @@ -116,8 +128,14 @@ class XCXCAEAPOIDrawer : public XCBase drawSWLPivots = false; drawPeakPivots = false; drawValePivots = false; + drawRSIPeakPivots = false; + drawRSIValePivots = false; + drawCCIPeakPivots = false; + drawCCIValePivots = false; drawKIBullishPivots = false; drawKIBearishPivots = false; + drawFVGBullishPivots = false; + drawFVGBearishPivots = false; drawPeakSWHResPivots = false; drawValeSWLSupPivots = false; drawTKIBullishPivots = false; @@ -142,8 +160,14 @@ class XCXCAEAPOIDrawer : public XCBase DrawSWLPivots(to); DrawPeakPivots(to); DrawValePivots(to); + DrawRSIPeakPivots(to); + DrawRSIValePivots(to); + DrawCCIPeakPivots(to); + DrawCCIValePivots(to); DrawKIBullishPivots(to); DrawKIBearishPivots(to); + DrawFVGBullishPivots(to); + DrawFVGBearishPivots(to); DrawPeakSWHResPivots(to); DrawValeSWLSupPivots(to); DrawTKIBullishPivots(to); @@ -481,6 +505,96 @@ class XCXCAEAPOIDrawer : public XCBase iBox.Clean(); } } + + // + void DrawFVGBullishPivots(datetime to = NULL) { + // + if (!drawFVGBullishPivots) { + return; + } + + // + bool canUpdateTo = IsValid(to); + + // + bool has = detector.HasFVGBullishPivots(); + if (!has) { + return; + } + + // + int count = detector.CountFVGBullishPivots(); + for (int i = 0; i < count; i++) { + // + XBoxZone iBox; + has = detector.fvgBullishPivots[i].AsBox(iBox); + if (!has) { + // + iBox.Clean(); + continue; + } + + // + if (canUpdateTo) { + iBox.to = to; + } + + // + XCBoxObject *iObj; + has = drawer.DrawBox( + iBox, + iObj // + ); + if (has) { + mFVGBullishPivotObjects.Add(iObj); + } + } + } + + // + void DrawFVGBearishPivots(datetime to = NULL) { + // + if (!drawFVGBearishPivots) { + return; + } + + // + bool canUpdateTo = IsValid(to); + + // + bool has = detector.HasFVGBearishPivots(); + if (!has) { + return; + } + + // + int count = detector.CountFVGBearishPivots(); + for (int i = 0; i < count; i++) { + // + XBoxZone iBox; + has = detector.fvgBearishPivots[i].AsBox(iBox); + if (!has) { + // + iBox.Clean(); + continue; + } + + // + if (canUpdateTo) { + iBox.to = to; + } + + // + XCBoxObject *iObj; + has = drawer.DrawBox( + iBox, + iObj // + ); + if (has) { + mFVGBearishPivotObjects.Add(iObj); + } + } + } // void DrawPeakSWHResPivots(datetime to = NULL) @@ -1250,6 +1364,116 @@ class XCXCAEAPOIDrawer : public XCBase } } + // + void DrawRSIPeakPivots(datetime to = NULL) + { + // + if (!drawRSIPeakPivots) + { + return; + } + + // + to = NULL; + bool canUpdateTo = IsValid(to); + + // + int count = 0; + bool has = detector.HasRSIPeakPivots(); + if (has) + { + // + count = detector.CountRSIPeakPivots(); + for (int i = 0; i < count; i++) + { + // + XBoxZone iBox; + has = detector.rsiPeakPivots[i].AsBox(iBox); + if (!has) + { + // + iBox.Clean(); + continue; + } + + // + if (canUpdateTo) + { + iBox.to = to; + } + + // + XCBoxObject *iObj; + has = drawer.DrawBox( + iBox, + iObj // + ); + if (has) + { + mRSIPeakPivotObjects.Add(iObj); + } + + // + iBox.Clean(); + } + } + } + + // + void DrawRSIValePivots(datetime to = NULL) + { + // + if (!drawRSIValePivots) + { + return; + } + + // + to = NULL; + bool canUpdateTo = IsValid(to); + + // + int count = 0; + bool has = detector.HasRSIValePivots(); + if (has) + { + // + count = detector.CountRSIValePivots(); + for (int i = 0; i < count; i++) + { + // + XBoxZone iBox; + has = detector.rsiValePivots[i].AsBox(iBox); + if (!has) + { + // + iBox.Clean(); + continue; + } + + // + if (canUpdateTo) + { + iBox.to = to; + } + + // + XCBoxObject *iObj; + has = drawer.DrawBox( + iBox, + iObj // + ); + if (has) + { + mRSIValePivotObjects.Add(iObj); + } + + // + iBox.Clean(); + } + } + } + // void DrawRSICrossedOverOSPivots(datetime to = NULL) { @@ -1356,6 +1580,116 @@ class XCXCAEAPOIDrawer : public XCBase } } + // + void DrawCCIPeakPivots(datetime to = NULL) + { + // + if (!drawCCIPeakPivots) + { + return; + } + + // + to = NULL; + bool canUpdateTo = IsValid(to); + + // + int count = 0; + bool has = detector.HasCCIPeakPivots(); + if (has) + { + // + count = detector.CountCCIPeakPivots(); + for (int i = 0; i < count; i++) + { + // + XBoxZone iBox; + has = detector.cciPeakPivots[i].AsBox(iBox); + if (!has) + { + // + iBox.Clean(); + continue; + } + + // + if (canUpdateTo) + { + iBox.to = to; + } + + // + XCBoxObject *iObj; + has = drawer.DrawBox( + iBox, + iObj // + ); + if (has) + { + mCCIPeakPivotObjects.Add(iObj); + } + + // + iBox.Clean(); + } + } + } + + // + void DrawCCIValePivots(datetime to = NULL) + { + // + if (!drawCCIValePivots) + { + return; + } + + // + to = NULL; + bool canUpdateTo = IsValid(to); + + // + int count = 0; + bool has = detector.HasCCIValePivots(); + if (has) + { + // + count = detector.CountCCIValePivots(); + for (int i = 0; i < count; i++) + { + // + XBoxZone iBox; + has = detector.cciValePivots[i].AsBox(iBox); + if (!has) + { + // + iBox.Clean(); + continue; + } + + // + if (canUpdateTo) + { + iBox.to = to; + } + + // + XCBoxObject *iObj; + has = drawer.DrawBox( + iBox, + iObj // + ); + if (has) + { + mCCIValePivotObjects.Add(iObj); + } + + // + iBox.Clean(); + } + } + } + // void DrawCCICrossedOverOSPivots(datetime to = NULL) { @@ -1483,8 +1817,14 @@ class XCXCAEAPOIDrawer : public XCBase CArrayObj mSWLPivotObjects; CArrayObj mPeakPivotObjects; CArrayObj mValePivotObjects; + CArrayObj mRSIPeakPivotObjects; + CArrayObj mRSIValePivotObjects; + CArrayObj mCCIPeakPivotObjects; + CArrayObj mCCIValePivotObjects; CArrayObj mKIBullishPivotObjects; CArrayObj mKIBearishPivotObjects; + CArrayObj mFVGBullishPivotObjects; + CArrayObj mFVGBearishPivotObjects; CArrayObj mPeakSWHResPivotObjects; CArrayObj mValeSWLSupPivotObjects; CArrayObj mTKIBullishPivotObjects; diff --git a/XCAEA/Libraries/xcaea.signaller.lib.mq5 b/XCAEA/Libraries/xcaea.signaller.lib.mq5 index a2e50328..43e4592c 100644 --- a/XCAEA/Libraries/xcaea.signaller.lib.mq5 +++ b/XCAEA/Libraries/xcaea.signaller.lib.mq5 @@ -930,7 +930,7 @@ bool DetectXCAEAConditions( // bool isCond1Bullish = // - // false && + false && isCCIBullish && isBoxActivated && pivotBox.IsValid() && @@ -941,7 +941,7 @@ bool DetectXCAEAConditions( // bool isCond1Bearish = // - // false && + false && isCCIBearish && isBoxActivated && pivotBox.IsValid() && @@ -970,6 +970,7 @@ bool DetectXCAEAConditions( // bool isCond2Bullish = // + false && isBoxRejected && pivotBox.IsValid() && pivotBox.IsBullish() @@ -979,6 +980,7 @@ bool DetectXCAEAConditions( // bool isCond2Bearish = // + false && isBoxRejected && pivotBox.IsValid() && pivotBox.IsBearish() @@ -1000,6 +1002,26 @@ bool DetectXCAEAConditions( Print("Cond2"); } + // + // Cond3 Act Using CCi Peaks and Vales ... + + // + bool isCond3Bullish = false; + + // + bool isCond3Bearish = false; + + // + bool isCond3 = isCond3Bullish || + isCond3Bearish; + if (isCond3) + { + // + + // + Print("Cond3"); + } + // // Summarise Conditions ... diff --git a/XCAEA/Signals/xcaea.signaller.class.mq5 b/XCAEA/Signals/xcaea.signaller.class.mq5 index 7c6011ee..561808f1 100644 --- a/XCAEA/Signals/xcaea.signaller.class.mq5 +++ b/XCAEA/Signals/xcaea.signaller.class.mq5 @@ -692,7 +692,7 @@ class XCXCAEASignaller : XCBase inputs.caInputs.showKI = true; inputs.caInputs.showTKI = true; inputs.caInputs.showSar = false; - inputs.caInputs.showTrend = true; + inputs.caInputs.showTrend = false; inputs.caInputs.showSwings = false; inputs.caInputs.showLongCycle = false; inputs.caInputs.showHindCycle = false; @@ -714,7 +714,7 @@ class XCXCAEASignaller : XCBase // // Oscillators Views ... - inputs.showCCI = true; + inputs.showCCI = false; inputs.showRSI = false; inputs.showMFI = false; inputs.showRVI = false; @@ -738,10 +738,16 @@ class XCXCAEASignaller : XCBase detector.detectSWLPivot = false; detector.detectPeakPivot = false; detector.detectValePivot = false; + detector.detectRSIPeakPivot = false; + detector.detectRSIValePivot = false; + detector.detectCCIPeakPivot = true; + detector.detectCCIValePivot = true; detector.detectKIBullishPivot = false; detector.detectKIBearishPivot = false; - detector.detectPeakSWHResPivot = true; - detector.detectValeSWLSupPivot = true; + detector.detectFVGBullishPivot = true; + detector.detectFVGBearishPivot = true; + detector.detectPeakSWHResPivot = false; + detector.detectValeSWLSupPivot = false; detector.detectTKIBullishPivot = false; detector.detectCycleSameLLPivot = false; detector.detectCycleSameHHPivot = false; @@ -750,10 +756,10 @@ class XCXCAEASignaller : XCBase detector.detectTrendBearishPivot = true; detector.detectTKITRNDBullishPivot = false; detector.detectTKITRNDBearishPivot = false; - detector.detectRSICrossedOverOSPivot = true; - detector.detectRSICrossedUnderOBPivot = true; - detector.detectCCICrossedOverOSPivot = true; - detector.detectCCICrossedUnderOBPivot = true; + detector.detectRSICrossedOverOSPivot = false; + detector.detectRSICrossedUnderOBPivot = false; + detector.detectCCICrossedOverOSPivot = false; + detector.detectCCICrossedUnderOBPivot = false; // // Initialize and Configure Drawer ... @@ -765,8 +771,14 @@ class XCXCAEASignaller : XCBase drawer.drawSWLPivots = false; drawer.drawPeakPivots = false; drawer.drawValePivots = false; + drawer.drawRSIPeakPivots = false; + drawer.drawRSIValePivots = false; + drawer.drawCCIPeakPivots = false; + drawer.drawCCIValePivots = false; drawer.drawKIBullishPivots = false; drawer.drawKIBearishPivots = false; + drawer.drawFVGBullishPivots = true; + drawer.drawFVGBearishPivots = true; drawer.drawPeakSWHResPivots = true; drawer.drawValeSWLSupPivots = true; drawer.drawTKIBullishPivots = false; @@ -777,10 +789,10 @@ class XCXCAEASignaller : XCBase drawer.drawTrendBearishPivots = false; drawer.drawTKITRNDBullishPivots = false; drawer.drawTKITRNDBearishPivots = false; - drawer.drawRSICrossedOverOSPivots = true; - drawer.drawRSICrossedUnderOBPivots = true; - drawer.drawCCICrossedOverOSPivots = true; - drawer.drawCCICrossedUnderOBPivots = true; + drawer.drawRSICrossedOverOSPivots = false; + drawer.drawRSICrossedUnderOBPivots = false; + drawer.drawCCICrossedOverOSPivots = false; + drawer.drawCCICrossedUnderOBPivots = false; } /**