From a9e8fe04a8d2165e5933b2a3a7d2740cb3ca5b05 Mon Sep 17 00:00:00 2001 From: Hadi Khazaee Asl Date: Sat, 19 Apr 2025 16:35:21 +0330 Subject: [PATCH] last ... --- Helpers/x-saherelm.x121.xoscs.helper.mq5 | 72 ++++ XCAEA/Classes/xcaea.x-poi.detector.class.mq5 | 371 ++++++++++++++++++- XCAEA/Classes/xcaea.x-poi.drawer.class.mq5 | 232 ++++++++++++ XCAEA/Helpers/xcaea.helper.mq5 | 74 ++++ XCAEA/Libraries/xcaea.signaller.lib.mq5 | 1 + XCAEA/Signals/xcaea.signaller.class.mq5 | 75 +++- 6 files changed, 804 insertions(+), 21 deletions(-) diff --git a/Helpers/x-saherelm.x121.xoscs.helper.mq5 b/Helpers/x-saherelm.x121.xoscs.helper.mq5 index 937ee4f8..720c8d32 100644 --- a/Helpers/x-saherelm.x121.xoscs.helper.mq5 +++ b/Helpers/x-saherelm.x121.xoscs.helper.mq5 @@ -439,6 +439,30 @@ struct X121XOCSConditions double stochasticBuffer[]; double stochasticSignalBuffer[]; + // + // Values ... + + // + double adxThreshold; // Big Movement Threshold + double cciOBLevel; // Over Bought Level + double cciOSLevel; // Over Sold Level + double cciReversalLevel; // Reversal Level + double rsiOBLevel; // Over Bought Level + double rsiOSLevel; // Over Sold Level + double rsiReversalLevel; // Reversal Level + double mfiOBLevel; // Over Bought Level + double mfiOSLevel; // Over Sold Level + double mfiReversalLevel; // Reversal Level + double rviBullishLevel; // Bullish Level + double rviBearishLevel; // Bearish Level + double macdBullishLevel; // Bullish Level + double macdBearishLevel; // Bearish Level + double momentumBullishLevel; // Bullish Level + double momentumBearishLevel; // Bearish Level + double stochasticOBLevel; // Over Bought Level + double stochasticOSLevel; // Over Sold Level + double stochasticReversalLevel; // Reversal Level + // // Conditions ... @@ -706,6 +730,30 @@ struct X121XOCSConditions ArraySetAsSeries(stochasticBuffer, true); ArraySetAsSeries(stochasticSignalBuffer, true); + // + // Values ... + + // + adxThreshold = 0.0; + cciOBLevel = 0.0; + cciOSLevel = 0.0; + cciReversalLevel = 0.0; + rsiOBLevel = 0.0; + rsiOSLevel = 0.0; + rsiReversalLevel = 0.0; + mfiOBLevel = 0.0; + mfiOSLevel = 0.0; + mfiReversalLevel = 0.0; + rviBullishLevel = 0.0; + rviBearishLevel = 0.0; + macdBullishLevel = 0.0; + macdBearishLevel = 0.0; + momentumBullishLevel = 0.0; + momentumBearishLevel = 0.0; + stochasticOBLevel = 0.0; + stochasticOSLevel = 0.0; + stochasticReversalLevel = 0.0; + // // Conditions ... @@ -2684,6 +2732,30 @@ class XCX121XOCSHelper : XCBaseHelper conditions.stochasticSignalBuffer // ); + // + // Values ... + + // + conditions.adxThreshold = mInputs.adxThreshold; + conditions.cciOBLevel = mInputs.cciOBLevel; + conditions.cciOSLevel = mInputs.cciOSLevel; + conditions.cciReversalLevel = mInputs.cciReversalLevel; + conditions.rsiOBLevel = mInputs.rsiOBLevel; + conditions.rsiOSLevel = mInputs.rsiOSLevel; + conditions.rsiReversalLevel = mInputs.rsiReversalLevel; + conditions.mfiOBLevel = mInputs.mfiOBLevel; + conditions.mfiOSLevel = mInputs.mfiOSLevel; + conditions.mfiReversalLevel = mInputs.mfiReversalLevel; + conditions.rviBullishLevel = mInputs.rviBullishLevel; + conditions.rviBearishLevel = mInputs.rviBearishLevel; + conditions.macdBullishLevel = mInputs.macdBullishLevel; + conditions.macdBearishLevel = mInputs.macdBearishLevel; + conditions.momentumBullishLevel = mInputs.momentumBullishLevel; + conditions.momentumBearishLevel = mInputs.momentumBearishLevel; + conditions.stochasticOBLevel = mInputs.stochasticOBLevel; + conditions.stochasticOSLevel = mInputs.stochasticOSLevel; + conditions.stochasticReversalLevel = mInputs.stochasticReversalLevel; + // // Conditions ... diff --git a/XCAEA/Classes/xcaea.x-poi.detector.class.mq5 b/XCAEA/Classes/xcaea.x-poi.detector.class.mq5 index cef2c533..de1805ca 100644 --- a/XCAEA/Classes/xcaea.x-poi.detector.class.mq5 +++ b/XCAEA/Classes/xcaea.x-poi.detector.class.mq5 @@ -39,6 +39,10 @@ enum ENUM_XCA_PIVOTS XCA_SWH, // SWH XCA_VALE, // VALE XCA_PEAK, // PEAK + XCA_RSI_COOS, // RSICOOS + XCA_RSI_CUOB, // RSICUOB + XCA_CCI_COOS, // CCICOOS + XCA_CCI_CUOB, // CCICUOB XCA_KI_BULL, // KIBull XCA_KI_BEAR, // KIBear XCA_TKI_BULL, // TKIBull @@ -323,6 +327,8 @@ struct XCAPivot case XCA_SWL: case XCA_VALE: case XCA_KI_BULL: + case XCA_RSI_COOS: + case XCA_CCI_COOS: case XCA_TKI_BULL: case XCA_TREND_BULL: case XCA_VALESWLSUP: @@ -335,6 +341,8 @@ struct XCAPivot case XCA_SWH: case XCA_PEAK: case XCA_KI_BEAR: + case XCA_RSI_CUOB: + case XCA_CCI_CUOB: case XCA_TKI_BEAR: case XCA_TREND_BEAR: case XCA_PEAKSWHRES: @@ -383,6 +391,18 @@ struct XCAPivot // typeStr = "XCA_KI"; } + 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) { @@ -510,6 +530,10 @@ class XCXCAEAPOIDetector : public XCBase bool detectTrendBearishPivot; bool detectTKITRNDBullishPivot; bool detectTKITRNDBearishPivot; + bool detectRSICrossedOverOSPivot; + bool detectRSICrossedUnderOBPivot; + bool detectCCICrossedOverOSPivot; + bool detectCCICrossedUnderOBPivot; // // Active Pivots ... @@ -561,6 +585,12 @@ class XCXCAEAPOIDetector : public XCBase XCAPivot tkitrndBullishPivots[]; XCAPivot tkitrndBearishPivots[]; + // + XCAPivot rsiCrossedOverOSPivots[]; + XCAPivot rsiCrossedUnderOBPivots[]; + XCAPivot cciCrossedOverOSPivots[]; + XCAPivot cciCrossedUnderOBPivots[]; + // // Constructors ... XCXCAEAPOIDetector( @@ -627,6 +657,10 @@ class XCXCAEAPOIDetector : public XCBase Clean(trendBearishPivots); Clean(tkitrndBullishPivots); Clean(tkitrndBearishPivots); + Clean(rsiCrossedOverOSPivots); + Clean(rsiCrossedUnderOBPivots); + Clean(cciCrossedOverOSPivots); + Clean(cciCrossedUnderOBPivots); // ZeroMemory(helper); @@ -651,18 +685,20 @@ class XCXCAEAPOIDetector : public XCBase detectSWLPivot = true; detectPeakPivot = true; detectValePivot = true; - detectCycleSameLLPivot = true; - detectCycleSameHHPivot = true; detectKIBullishPivot = true; detectKIBearishPivot = true; detectTKIBullishPivot = true; detectTKIBearishPivot = true; detectPeakSWHResPivot = true; detectValeSWLSupPivot = true; + detectCycleSameLLPivot = true; + detectCycleSameHHPivot = true; detectTrendBullishPivot = true; detectTrendBearishPivot = true; detectTKITRNDBullishPivot = true; detectTKITRNDBearishPivot = true; + detectCCICrossedOverOSPivot = true; + detectCCICrossedUnderOBPivot = true; } // @@ -689,6 +725,7 @@ class XCXCAEAPOIDetector : public XCBase int cIDX = zIDX + 1; int pIDX = cIDX + 1; int p2IDX = pIDX + 1; + int p3IDX = p2IDX + 1; // int index = barIndex; @@ -1231,6 +1268,52 @@ class XCXCAEAPOIDetector : public XCBase !isCKISame && isPKISame; + // + // RSI ... + + // + double zRSI = iConditions.rsiBuffer[zIDX]; + double cRSI = iConditions.rsiBuffer[cIDX]; + double pRSI = iConditions.rsiBuffer[pIDX]; + double p2RSI = iConditions.rsiBuffer[p2IDX]; + + // + bool isRSIBullishVPattern = + cRSI > pRSI && + p2RSI > pRSI && + cRSI > iConditions.rsiOSLevel && + pRSI < iConditions.rsiOSLevel; + + // + bool isRSIBearishVPattern = + cRSI < pRSI && + p2RSI < pRSI && + cRSI < iConditions.rsiOBLevel && + pRSI > iConditions.rsiOBLevel; + + // + // CCI ... + + // + double zCCI = iConditions.cciBuffer[zIDX]; + double cCCI = iConditions.cciBuffer[cIDX]; + double pCCI = iConditions.cciBuffer[pIDX]; + double p2CCI = iConditions.cciBuffer[p2IDX]; + + // + bool isCCIBullishVPattern = + cCCI > pCCI && + p2CCI > pCCI && + cCCI > iConditions.cciOSLevel && + pCCI < iConditions.cciOSLevel; + + // + bool isCCIBearishVPattern = + cCCI < pCCI && + p2CCI < pCCI && + cCCI < iConditions.cciOBLevel && + pCCI > iConditions.cciOBLevel; + // // Checking Pivots ... @@ -3045,6 +3128,238 @@ class XCXCAEAPOIDetector : public XCBase } } + // + // RSI Crossed Over OS ... + if (detectRSICrossedOverOSPivot) + { + // + if (isRSIBullishVPattern) + { + // + XCAPivot iPivot; + + // + iPivot.to = cBar.time; + iPivot.from = p2Bar.time; + iPivot.value = pBar.low; + iPivot.type = XCA_RSI_COOS; + 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, + rsiCrossedOverOSPivots // + ); + + // + iPivot.Clean(); + } + } + + // + // RSI Crossed Under OS ... + if (detectRSICrossedUnderOBPivot) + { + // + if (isRSIBearishVPattern) + { + // + XCAPivot iPivot; + + // + iPivot.to = cBar.time; + iPivot.from = p2Bar.time; + iPivot.value = pBar.high; + iPivot.type = XCA_RSI_CUOB; + 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, + rsiCrossedUnderOBPivots // + ); + + // + iPivot.Clean(); + } + } + + // + // CCI Crossed Over OS ... + if (detectCCICrossedOverOSPivot) + { + // + if (isCCIBullishVPattern) + { + // + XCAPivot iPivot; + + // + iPivot.to = cBar.time; + iPivot.from = p2Bar.time; + iPivot.value = pBar.low; + iPivot.type = XCA_CCI_COOS; + 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, + cciCrossedOverOSPivots // + ); + + // + iPivot.Clean(); + } + } + + // + // CCI Crossed Under OS ... + if (detectCCICrossedUnderOBPivot) + { + // + if (isCCIBearishVPattern) + { + // + XCAPivot iPivot; + + // + iPivot.to = cBar.time; + iPivot.from = p2Bar.time; + iPivot.value = pBar.high; + iPivot.type = XCA_CCI_CUOB; + 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, + cciCrossedUnderOBPivots // + ); + + // + iPivot.Clean(); + } + } + // start++; @@ -3307,7 +3622,7 @@ class XCXCAEAPOIDetector : public XCBase } Clean(tmp); } - + // has = HasKIBullishPivots(); if (has) @@ -3344,7 +3659,7 @@ class XCXCAEAPOIDetector : public XCBase } Clean(tmp); } - + // has = HasValeSWLSupPivots(); if (has) @@ -4795,6 +5110,54 @@ class XCXCAEAPOIDetector : public XCBase return ArraySize(hSameHHPivots); } + // + bool HasRSICrossedOverOSPivots() + { + return HasChild(rsiCrossedOverOSPivots); + } + + // + int CountRSICrossedOverOSPivots() + { + return ArraySize(rsiCrossedOverOSPivots); + } + + // + bool HasRSICrossedUnderOBPivots() + { + return HasChild(rsiCrossedUnderOBPivots); + } + + // + int CountRSICrossedUnderOBPivots() + { + return ArraySize(rsiCrossedUnderOBPivots); + } + + // + bool HasCCICrossedOverOSPivots() + { + return HasChild(cciCrossedOverOSPivots); + } + + // + int CountCCICrossedOverOSPivots() + { + return ArraySize(cciCrossedOverOSPivots); + } + + // + bool HasCCICrossedUnderOBPivots() + { + return HasChild(cciCrossedUnderOBPivots); + } + + // + int CountCCICrossedUnderOBPivots() + { + return ArraySize(cciCrossedUnderOBPivots); + } + // // Protected ... protected: diff --git a/XCAEA/Classes/xcaea.x-poi.drawer.class.mq5 b/XCAEA/Classes/xcaea.x-poi.drawer.class.mq5 index a2154005..37828176 100644 --- a/XCAEA/Classes/xcaea.x-poi.drawer.class.mq5 +++ b/XCAEA/Classes/xcaea.x-poi.drawer.class.mq5 @@ -52,6 +52,10 @@ class XCXCAEAPOIDrawer : public XCBase bool drawTrendBearishPivots; bool drawTKITRNDBullishPivots; bool drawTKITRNDBearishPivots; + bool drawRSICrossedOverOSPivots; + bool drawRSICrossedUnderOBPivots; + bool drawCCICrossedOverOSPivots; + bool drawCCICrossedUnderOBPivots; // // Constructors ... @@ -88,6 +92,10 @@ class XCXCAEAPOIDrawer : public XCBase mCycleSameHHPivotObjects.Clear(); mTKITRNDBullishPivotObjects.Clear(); mTKITRNDBearishPivotObjects.Clear(); + mRSICrossedOverOSPivotObjects.Clear(); + mRSICrossedUnderOBPivotObjects.Clear(); + mCCICrossedOverOSPivotObjects.Clear(); + mCCICrossedUnderOBPivotObjects.Clear(); // ZeroMemory(drawer); @@ -120,6 +128,10 @@ class XCXCAEAPOIDrawer : public XCBase drawTrendBearishPivots = false; drawTKITRNDBullishPivots = false; drawTKITRNDBearishPivots = false; + drawRSICrossedOverOSPivots = false; + drawRSICrossedUnderOBPivots = false; + drawCCICrossedOverOSPivots = false; + drawCCICrossedUnderOBPivots = false; } // @@ -142,6 +154,10 @@ class XCXCAEAPOIDrawer : public XCBase DrawTrendBearishPivots(to); DrawTKITRNDBullishPivots(to); DrawTKITRNDBearishPivots(to); + DrawRSICrossedOverOSPivots(to); + DrawRSICrossedUnderOBPivots(to); + DrawCCICrossedOverOSPivots(to); + DrawCCICrossedUnderOBPivots(to); } // @@ -1234,6 +1250,218 @@ class XCXCAEAPOIDrawer : public XCBase } } + // + void DrawRSICrossedOverOSPivots(datetime to = NULL) + { + // + if (!drawRSICrossedOverOSPivots) + { + return; + } + + // + to = NULL; + bool canUpdateTo = IsValid(to); + + // + int count = 0; + bool has = detector.HasRSICrossedOverOSPivots(); + if (has) + { + // + count = detector.CountRSICrossedOverOSPivots(); + for (int i = 0; i < count; i++) + { + // + XBoxZone iBox; + has = detector.rsiCrossedOverOSPivots[i].AsBox(iBox); + if (!has) + { + continue; + } + + // + if (canUpdateTo) + { + iBox.to = to; + } + + // + XCBoxObject *iObj; + has = drawer.DrawBox( + iBox, + iObj // + ); + if (has) + { + mRSICrossedOverOSPivotObjects.Add(iObj); + } + + // + iBox.Clean(); + } + } + } + + // + void DrawRSICrossedUnderOBPivots(datetime to = NULL) + { + // + if (!drawRSICrossedUnderOBPivots) + { + return; + } + + // + to = NULL; + bool canUpdateTo = IsValid(to); + + // + int count = 0; + bool has = detector.HasRSICrossedUnderOBPivots(); + if (has) + { + // + count = detector.CountRSICrossedUnderOBPivots(); + for (int i = 0; i < count; i++) + { + // + XBoxZone iBox; + has = detector.rsiCrossedUnderOBPivots[i].AsBox(iBox); + if (!has) + { + continue; + } + + // + if (canUpdateTo) + { + iBox.to = to; + } + + // + XCBoxObject *iObj; + has = drawer.DrawBox( + iBox, + iObj // + ); + if (has) + { + mRSICrossedUnderOBPivotObjects.Add(iObj); + } + + // + iBox.Clean(); + } + } + } + + // + void DrawCCICrossedOverOSPivots(datetime to = NULL) + { + // + if (!drawCCICrossedOverOSPivots) + { + return; + } + + // + to = NULL; + bool canUpdateTo = IsValid(to); + + // + int count = 0; + bool has = detector.HasCCICrossedOverOSPivots(); + if (has) + { + // + count = detector.CountCCICrossedOverOSPivots(); + for (int i = 0; i < count; i++) + { + // + XBoxZone iBox; + has = detector.cciCrossedOverOSPivots[i].AsBox(iBox); + if (!has) + { + continue; + } + + // + if (canUpdateTo) + { + iBox.to = to; + } + + // + XCBoxObject *iObj; + has = drawer.DrawBox( + iBox, + iObj // + ); + if (has) + { + mCCICrossedOverOSPivotObjects.Add(iObj); + } + + // + iBox.Clean(); + } + } + } + + // + void DrawCCICrossedUnderOBPivots(datetime to = NULL) + { + // + if (!drawCCICrossedUnderOBPivots) + { + return; + } + + // + to = NULL; + bool canUpdateTo = IsValid(to); + + // + int count = 0; + bool has = detector.HasCCICrossedUnderOBPivots(); + if (has) + { + // + count = detector.CountCCICrossedUnderOBPivots(); + for (int i = 0; i < count; i++) + { + // + XBoxZone iBox; + has = detector.cciCrossedUnderOBPivots[i].AsBox(iBox); + if (!has) + { + continue; + } + + // + if (canUpdateTo) + { + iBox.to = to; + } + + // + XCBoxObject *iObj; + has = drawer.DrawBox( + iBox, + iObj // + ); + if (has) + { + mCCICrossedUnderOBPivotObjects.Add(iObj); + } + + // + iBox.Clean(); + } + } + } + // // Protected ... protected: @@ -1267,6 +1495,10 @@ class XCXCAEAPOIDrawer : public XCBase CArrayObj mTrendBearishPivotObjects; CArrayObj mTKITRNDBullishPivotObjects; CArrayObj mTKITRNDBearishPivotObjects; + CArrayObj mRSICrossedOverOSPivotObjects; + CArrayObj mRSICrossedUnderOBPivotObjects; + CArrayObj mCCICrossedOverOSPivotObjects; + CArrayObj mCCICrossedUnderOBPivotObjects; // }; diff --git a/XCAEA/Helpers/xcaea.helper.mq5 b/XCAEA/Helpers/xcaea.helper.mq5 index c9cafd3d..c329c1a2 100644 --- a/XCAEA/Helpers/xcaea.helper.mq5 +++ b/XCAEA/Helpers/xcaea.helper.mq5 @@ -367,6 +367,31 @@ struct XCAEAConditions double stochasticBuffer[]; double stochasticSignalBuffer[]; + // + // Values ... + + // + double adxThreshold; + double cciOBLevel; + double cciOSLevel; + double cciReversalLevel; + double rsiOBLevel; + double rsiOSLevel; + double rsiReversalLevel; + double mfiOBLevel; + double mfiOSLevel; + double mfiReversalLevel; + double rviBullishLevel; + double rviBearishLevel; + double macdBullishLevel; + double macdBearishLevel; + double momentumBullishLevel; + double momentumBearishLevel; + double stochasticOBLevel; + double stochasticOSLevel; + double stochasticReversalLevel; + + // // Conditions ... @@ -850,6 +875,30 @@ struct XCAEAConditions ArraySetAsSeries(stochasticBuffer, true); ArraySetAsSeries(stochasticSignalBuffer, true); + // + // Values ... + + // + adxThreshold = 0.0; + cciOBLevel = 0.0; + cciOSLevel = 0.0; + cciReversalLevel = 0.0; + rsiOBLevel = 0.0; + rsiOSLevel = 0.0; + rsiReversalLevel = 0.0; + mfiOBLevel = 0.0; + mfiOSLevel = 0.0; + mfiReversalLevel = 0.0; + rviBullishLevel = 0.0; + rviBearishLevel = 0.0; + macdBullishLevel = 0.0; + macdBearishLevel = 0.0; + momentumBullishLevel = 0.0; + momentumBearishLevel = 0.0; + stochasticOBLevel = 0.0; + stochasticOSLevel = 0.0; + stochasticReversalLevel = 0.0; + // // Conditions ... @@ -2880,8 +2929,33 @@ class XCXCAEAHelper : XCBase conditions.stochasticSignalBuffer // ); + // + // Values ... + + // + conditions.adxThreshold = xocsConditions.adxThreshold; + conditions.cciOBLevel = xocsConditions.cciOBLevel; + conditions.cciOSLevel = xocsConditions.cciOSLevel; + conditions.cciReversalLevel = xocsConditions.cciReversalLevel; + conditions.rsiOBLevel = xocsConditions.rsiOBLevel; + conditions.rsiOSLevel = xocsConditions.rsiOSLevel; + conditions.rsiReversalLevel = xocsConditions.rsiReversalLevel; + conditions.mfiOBLevel = xocsConditions.mfiOBLevel; + conditions.mfiOSLevel = xocsConditions.mfiOSLevel; + conditions.mfiReversalLevel = xocsConditions.mfiReversalLevel; + conditions.rviBullishLevel = xocsConditions.rviBullishLevel; + conditions.rviBearishLevel = xocsConditions.rviBearishLevel; + conditions.macdBullishLevel = xocsConditions.macdBullishLevel; + conditions.macdBearishLevel = xocsConditions.macdBearishLevel; + conditions.momentumBullishLevel = xocsConditions.momentumBullishLevel; + conditions.momentumBearishLevel = xocsConditions.momentumBearishLevel; + conditions.stochasticOBLevel = xocsConditions.stochasticOBLevel; + conditions.stochasticOSLevel = xocsConditions.stochasticOSLevel; + conditions.stochasticReversalLevel = xocsConditions.stochasticReversalLevel; + // // Conditions ... + // conditions.isCCIOB = xocsConditions.isCCIOB; conditions.isCCIOS = xocsConditions.isCCIOS; diff --git a/XCAEA/Libraries/xcaea.signaller.lib.mq5 b/XCAEA/Libraries/xcaea.signaller.lib.mq5 index ff0b9128..778123b3 100644 --- a/XCAEA/Libraries/xcaea.signaller.lib.mq5 +++ b/XCAEA/Libraries/xcaea.signaller.lib.mq5 @@ -419,6 +419,7 @@ int AddGuard( // bool DetectXCAEAConditions( + XBoxZone &boxes[], XCAEAConditions &conditions, XBoxZone &box, ENUM_X_DIRECTION &dir, diff --git a/XCAEA/Signals/xcaea.signaller.class.mq5 b/XCAEA/Signals/xcaea.signaller.class.mq5 index 923ab7cb..c046f2ef 100644 --- a/XCAEA/Signals/xcaea.signaller.class.mq5 +++ b/XCAEA/Signals/xcaea.signaller.class.mq5 @@ -185,20 +185,53 @@ class XCXCAEASignaller : XCBase // Draw Founded Pivots ... drawer.Draw(cTime); + // + // Retrieve Valid Boxes ... + + // + // Bullish ... + XBoxZone bullishBoxes[]; + int bullishBoxesCount = detector.FillBullishBoxes(bullishBoxes); + + // + // Bearish ... + XBoxZone bearishBoxes[]; + int bearishBoxesCount = detector.FillBearishBoxes(bearishBoxes); + + // + XBoxZone boxes[]; + Copy( + bullishBoxes, + boxes, + false // + ); + Copy( + bearishBoxes, + boxes, + false // + ); + int boxesCount = ArraySize(boxes); + bool hasBoxes = IsValidSize(boxesCount); + // // // // XCAEAConditions conditions; - hasSignalBox = DetectXCAEAConditions( - conditions, - signalBox, - signalBoxDir, - helper, - zIndex, - loopback // - ); + if (hasBoxes) + { + // + hasSignalBox = DetectXCAEAConditions( + boxes, + conditions, + signalBox, + signalBoxDir, + helper, + zIndex, + loopback // + ); + } // isBullish = hasSignalBox && @@ -598,7 +631,7 @@ class XCXCAEASignaller : XCBase // // Oscillators Views ... - inputs.showCCI = false; + inputs.showCCI = true; inputs.showRSI = false; inputs.showMFI = false; inputs.showRVI = false; @@ -624,16 +657,20 @@ class XCXCAEASignaller : XCBase detector.detectValePivot = false; detector.detectKIBullishPivot = false; detector.detectKIBearishPivot = false; - detector.detectPeakSWHResPivot = true; - detector.detectValeSWLSupPivot = true; + detector.detectPeakSWHResPivot = false; // true; + detector.detectValeSWLSupPivot = false; // true; detector.detectTKIBullishPivot = false; - detector.detectCycleSameLLPivot = true; - detector.detectCycleSameHHPivot = true; + detector.detectCycleSameLLPivot = false; + detector.detectCycleSameHHPivot = false; detector.detectTKIBearishPivot = false; - detector.detectTrendBullishPivot = true; - detector.detectTrendBearishPivot = true; + detector.detectTrendBullishPivot = false; // true; + detector.detectTrendBearishPivot = false; // true; detector.detectTKITRNDBullishPivot = false; detector.detectTKITRNDBearishPivot = false; + detector.detectRSICrossedOverOSPivot = true; + detector.detectRSICrossedUnderOBPivot = true; + detector.detectCCICrossedOverOSPivot = true; + detector.detectCCICrossedUnderOBPivot = true; // // Initialize and Configure Drawer ... @@ -649,14 +686,18 @@ class XCXCAEASignaller : XCBase drawer.drawKIBearishPivots = false; drawer.drawPeakSWHResPivots = true; drawer.drawValeSWLSupPivots = true; - drawer.drawCycleSameLLPivots = true; - drawer.drawCycleSameHHPivots = true; drawer.drawTKIBullishPivots = false; drawer.drawTKIBearishPivots = false; + drawer.drawCycleSameLLPivots = false; + drawer.drawCycleSameHHPivots = false; drawer.drawTrendBullishPivots = false; drawer.drawTrendBearishPivots = false; drawer.drawTKITRNDBullishPivots = false; drawer.drawTKITRNDBearishPivots = false; + drawer.drawRSICrossedOverOSPivots = true; + drawer.drawRSICrossedUnderOBPivots = true; + drawer.drawCCICrossedOverOSPivots = true; + drawer.drawCCICrossedUnderOBPivots = true; } /**