diff --git a/XCAEA/Classes/xcaea.x-poi.detector.class.mq5 b/XCAEA/Classes/xcaea.x-poi.detector.class.mq5 index c090b7ed..16a03324 100644 --- a/XCAEA/Classes/xcaea.x-poi.detector.class.mq5 +++ b/XCAEA/Classes/xcaea.x-poi.detector.class.mq5 @@ -31,19 +31,21 @@ // enum ENUM_XCA_PIVOTS { - XCA_NONE, // None - XCA_SWL, // SWL - XCA_SWH, // SWH - XCA_VALE, // VALE - XCA_PEAK, // PEAK - 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, // Trend Bullish - XCA_TREND_BEAR, // Trend Bearish + XCA_NONE, // None + XCA_SWL, // SWL + XCA_SWH, // SWH + XCA_VALE, // VALE + XCA_PEAK, // PEAK + 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 }; // @@ -320,6 +322,7 @@ struct XCAPivot case XCA_TKI_BULL: case XCA_TREND_BULL: case XCA_VALESWLSUP: + case XCA_TKITRND_BULL: iDir = X_DIRECTION_BULLISH; break; @@ -330,6 +333,7 @@ struct XCAPivot case XCA_TKI_BEAR: case XCA_TREND_BEAR: case XCA_PEAKSWHRES: + case XCA_TKITRND_BEAR: iDir = X_DIRECTION_BEARISH; break; } @@ -386,6 +390,12 @@ struct XCAPivot // typeStr = "XCA_TREND"; } + else if (type == XCA_TKITRND_BULL || + type == XCA_TKITRND_BEAR) + { + // + typeStr = "XCA_TKITRND"; + } box.type = typeStr; // @@ -473,6 +483,26 @@ class XCXCAEAPOIDetector : public XCBase public: // // Props ... + + // + // Active Pivots ... + XCAPivot swhPivot; + XCAPivot swlPivot; + XCAPivot peakPivot; + XCAPivot valePivot; + XCAPivot kiBullishPivot; + XCAPivot kiBearishPivot; + XCAPivot tkiBullishPivot; + XCAPivot tkiBearishPivot; + XCAPivot peakSWHResPivot; + XCAPivot valeSWLSupPivot; + XCAPivot trendBullishPivot; + XCAPivot trendBearishPivot; + XCAPivot tkitrndBullishPivot; + XCAPivot tkitrndBearishPivot; + + // + // UnActive Pivots ... XCAPivot swhPivots[]; XCAPivot swlPivots[]; XCAPivot peakPivots[]; @@ -485,6 +515,8 @@ class XCXCAEAPOIDetector : public XCBase XCAPivot valeSWLSupPivots[]; XCAPivot trendBullishPivots[]; XCAPivot trendBearishPivots[]; + XCAPivot tkitrndBullishPivots[]; + XCAPivot tkitrndBearishPivots[]; // // Constructors ... @@ -727,6 +759,141 @@ class XCXCAEAPOIDetector : public XCBase cResistance != pResistance && pResistance == p2Resistance; + // + // PEAK SWH RES ... + + // + bool isCPeakIsPivot = + cPeak == cSWH && + cSWH == cResistance; + + // + bool isPPeakIsPivot = + pPeak == pSWH && + pSWH == pResistance; + + // + bool isStartPeakIsPivot = + isCPeakIsPivot && + !isPPeakIsPivot; + + // + bool isFinishedPeakIsPivot = + !isCPeakIsPivot && + isPPeakIsPivot; + + // + // VALE SWL SUP ... + + // + bool isCValeIsPivot = + cVale == cSWL && + cSWL == cSupport; + + // + bool isPValeIsPivot = + pVale == pSWL && + pSWL == pSupport; + + // + bool isStartValeIsPivot = + isCValeIsPivot && + !isPValeIsPivot; + + // + bool isFinishedValeIsPivot = + !isCValeIsPivot && + isPValeIsPivot; + + // + // TKITRND ... + + // + double cKI = iConditions.kiBuffer[cIDX]; + double pKI = iConditions.kiBuffer[pIDX]; + double p2KI = iConditions.kiBuffer[p2IDX]; + + // + double cKIState = iConditions.kiStateBuffer[cIDX]; + double pKIState = iConditions.kiStateBuffer[pIDX]; + double p2KIState = iConditions.kiStateBuffer[p2IDX]; + + // + double cTKI = iConditions.tkiBuffer[cIDX]; + double pTKI = iConditions.tkiBuffer[pIDX]; + double p2TKI = iConditions.tkiBuffer[p2IDX]; + + // + double cTKIState = iConditions.tkiStateBuffer[cIDX]; + double pTKIState = iConditions.tkiStateBuffer[pIDX]; + double p2TKIState = iConditions.tkiStateBuffer[p2IDX]; + + // + double cTrend = iConditions.trendBuffer[cIDX]; + double pTrend = iConditions.trendBuffer[pIDX]; + double p2Trend = iConditions.trendBuffer[p2IDX]; + + // + double cTrendState = iConditions.trendStateBuffer[cIDX]; + double pTrendState = iConditions.trendStateBuffer[pIDX]; + double p2TrendState = iConditions.trendStateBuffer[p2IDX]; + + // + double cTKITRNDs[] = { + cKI, + cTKI, + cTrend // + }; + + // + double cTKITRNDMin = GetMin(cTKITRNDs); + double cTKITRNDMax = GetMax(cTKITRNDs); + + // + double pTKITRNDs[] = { + pKI, + pTKI, + pTrend // + }; + + // + double pTKITRNDMin = GetMin(pTKITRNDs); + double pTKITRNDMax = GetMax(pTKITRNDs); + + // + bool isCTKITRNDBullish = + cKIState > 0 && + cTKIState > 0 && + cTrendState > 0; + + // + bool isPTKITRNDBullish = + pKIState > 0 && + pTKIState > 0 && + pTrendState > 0; + + // + bool isTKITRNDSwitchedBullish = + isCTKITRNDBullish && + !isPTKITRNDBullish; + + // + bool isCTKITRNDBearish = + cKIState < 0 && + cTKIState < 0 && + cTrendState < 0; + + // + bool isPTKITRNDBearish = + pKIState < 0 && + pTKIState < 0 && + pTrendState < 0; + + // + bool isTKITRNDSwitchedBearish = + isCTKITRNDBearish && + !isPTKITRNDBearish; + // // Checking Pivots ... @@ -735,6 +902,8 @@ class XCXCAEAPOIDetector : public XCBase bool detectSWLPivot = true; bool detectPeakPivot = true; bool detectValePivot = true; + bool detectTKITRNDBullish = true; + bool detectTKITRNDBearish = true; bool detectKIBullishPivot = true; bool detectKIBearishPivot = true; bool detectTKIBullishPivot = true; @@ -1074,28 +1243,39 @@ class XCXCAEAPOIDetector : public XCBase peakSWHResPivot.period = iConditions.period; // - if (iConditions.isPeakIsPivot && iConditions.isPeakSameLast) + if (isFinishedPeakIsPivot) { // - peakSWHResPivot.to = cBar.time; + peakSWHResPivot.Clean(); + + // + peakSWHResPivot.type = XCA_PEAKSWHRES; + peakSWHResPivot.symbol = iConditions.symbol; + peakSWHResPivot.period = iConditions.period; + + // + peakSWHResPivot.to = pBar.time; peakSWHResPivot.from = pBar.time; - peakSWHResPivot.value = iConditions.peakBuffer[cIDX]; + peakSWHResPivot.value = iConditions.peakBuffer[pIDX]; + peakSWHResPivot.reserve = iConditions.peakGoldenBuffer[pIDX]; } } // - if (iConditions.isPeakIsPivot && iConditions.isPeakSameLast) + if (iConditions.isPeakIsPivot) { // peakSWHResPivot.from = pBar.time; + + // peakSWHResPivot.reserve = peakSWHResPivot.reserve == 0 - ? iConditions.peakGoldenBuffer[cIDX] - : MathMax(peakSWHResPivot.reserve, iConditions.peakGoldenBuffer[cIDX]); + ? iConditions.peakGoldenBuffer[pIDX] + : MathMax(peakSWHResPivot.reserve, iConditions.peakGoldenBuffer[pIDX]); } // - if (!(iConditions.isPeakIsPivot && iConditions.isPeakSameLast)) + if (isStartPeakIsPivot) { // has = peakSWHResPivot.IsValid() && @@ -1127,28 +1307,39 @@ class XCXCAEAPOIDetector : public XCBase valeSWLSupPivot.period = iConditions.period; // - if (iConditions.isValeIsPivot && iConditions.isValeSameLast) + if (isFinishedValeIsPivot) { // - valeSWLSupPivot.to = cBar.time; + valeSWLSupPivot.Clean(); + + // + valeSWLSupPivot.type = XCA_VALESWLSUP; + valeSWLSupPivot.symbol = iConditions.symbol; + valeSWLSupPivot.period = iConditions.period; + + // + valeSWLSupPivot.to = pBar.time; valeSWLSupPivot.from = pBar.time; - valeSWLSupPivot.value = iConditions.valeBuffer[cIDX]; + valeSWLSupPivot.value = iConditions.valeBuffer[pIDX]; + valeSWLSupPivot.reserve = iConditions.valeGoldenBuffer[pIDX]; } } // - if (iConditions.isValeIsPivot && iConditions.isValeSameLast) + if (iConditions.isValeIsPivot) { // valeSWLSupPivot.from = pBar.time; + + // valeSWLSupPivot.reserve = valeSWLSupPivot.reserve == 0 - ? iConditions.valeGoldenBuffer[cIDX] - : MathMin(valeSWLSupPivot.reserve, iConditions.valeGoldenBuffer[cIDX]); + ? iConditions.valeGoldenBuffer[pIDX] + : MathMin(valeSWLSupPivot.reserve, iConditions.valeGoldenBuffer[pIDX]); } // - if (!(iConditions.isValeIsPivot && iConditions.isValeSameLast)) + if (isStartValeIsPivot) { // has = valeSWLSupPivot.IsValid() && @@ -1629,6 +1820,172 @@ class XCXCAEAPOIDetector : public XCBase } } + // + // TKITRND Bullish ... + if (detectTKITRNDBullish) + { + // + if (!tkitrndBullishPivot.IsValid()) + { + // + tkitrndBullishPivot.type = XCA_TKITRND_BULL; + tkitrndBullishPivot.symbol = iConditions.symbol; + tkitrndBullishPivot.period = iConditions.period; + + // + if (!isCTKITRNDBullish && isPTKITRNDBullish) + { + // + tkitrndBullishPivot.Clean(); + + // + tkitrndBullishPivot.type = XCA_TKITRND_BULL; + tkitrndBullishPivot.symbol = iConditions.symbol; + tkitrndBullishPivot.period = iConditions.period; + + // + tkitrndBullishPivot.to = pBar.time; + tkitrndBullishPivot.from = pBar.time; + tkitrndBullishPivot.value = pTKITRNDMin; + tkitrndBullishPivot.reserve = pTKITRNDMax; + } + } + + // + if (isCTKITRNDBullish) + { + // + tkitrndBullishPivot.from = cBar.time; + + // + Add( + cTKITRNDMin, + tkitrndBullishPivot.values // + ); + + // + Add( + cTKITRNDMax, + tkitrndBullishPivot.values // + ); + + // + tkitrndBullishPivot.value = + tkitrndBullishPivot.value == 0 + ? cTKITRNDMin + : MathMin(cTKITRNDMin, tkitrndBullishPivot.value); + + // + tkitrndBullishPivot.reserve = + tkitrndBullishPivot.reserve == 0 + ? cTKITRNDMax + : MathMax(cTKITRNDMax, tkitrndBullishPivot.reserve); + } + + // + if (!isCTKITRNDBullish) + { + // + has = + tkitrndBullishPivot.IsValid() && + tkitrndBullishPivot.GetAge() >= pivotVerifications; + if (has) + { + // + AddPivot( + tkitrndBullishPivot, + tkitrndBullishPivots // + ); + } + + // + trendBullishPivot.Clean(); + } + } + + // + // TKITRND Bearish ... + if (detectTKITRNDBearish) + { + // + if (!tkitrndBearishPivot.IsValid()) + { + // + tkitrndBearishPivot.type = XCA_TKITRND_BEAR; + tkitrndBearishPivot.symbol = iConditions.symbol; + tkitrndBearishPivot.period = iConditions.period; + + // + if (!isCTKITRNDBearish && isPTKITRNDBearish) + { + // + tkitrndBearishPivot.Clean(); + + // + tkitrndBearishPivot.type = XCA_TKITRND_BEAR; + tkitrndBearishPivot.symbol = iConditions.symbol; + tkitrndBearishPivot.period = iConditions.period; + + // + tkitrndBearishPivot.to = pBar.time; + tkitrndBearishPivot.from = pBar.time; + tkitrndBearishPivot.value = pTKITRNDMax; + tkitrndBearishPivot.reserve = pTKITRNDMin; + } + } + + // + if (isCTKITRNDBearish) + { + // + tkitrndBearishPivot.from = cBar.time; + + // + Add( + cTKITRNDMin, + tkitrndBearishPivot.values // + ); + + // + Add( + cTKITRNDMax, + tkitrndBearishPivot.values // + ); + + // + tkitrndBearishPivot.value = + tkitrndBearishPivot.value == 0 + ? cTKITRNDMax + : MathMax(cTKITRNDMax, tkitrndBearishPivot.value); + + // + tkitrndBearishPivot.reserve = + tkitrndBearishPivot.reserve == 0 + ? cTKITRNDMin + : MathMin(cTKITRNDMin, tkitrndBearishPivot.reserve); + } + + // + if (!isCTKITRNDBearish) + { + // + has = + tkitrndBearishPivot.IsValid() && + tkitrndBearishPivot.GetAge() >= pivotVerifications; + if (has) + { + // + AddPivot( + tkitrndBearishPivot, + tkitrndBearishPivots // + ); + } + + // + trendBearishPivot.Clean(); + } + } + // start++; @@ -1817,6 +2174,33 @@ class XCXCAEAPOIDetector : public XCBase return ArraySize(trendBearishPivots); } + // + // TKITRND ... + + // + bool HasTKITRNDBullishPivots() + { + return HasChild(tkitrndBullishPivots); + } + + // + int CountTKITRNDBullishPivots() + { + return ArraySize(tkitrndBullishPivots); + } + + // + bool HasTKITRNDBearishPivots() + { + return HasChild(tkitrndBearishPivots); + } + + // + int CountTKITRNDBearishPivots() + { + return ArraySize(tkitrndBearishPivots); + } + // // Protected ... protected: @@ -1831,20 +2215,6 @@ class XCXCAEAPOIDetector : public XCBase int pivotVerifications; // Pivots Verifications ... int maxAllowedPivots; // Max Allowed Holding Pibots ... - // - XCAPivot swhPivot; - XCAPivot swlPivot; - XCAPivot peakPivot; - XCAPivot valePivot; - XCAPivot kiBullishPivot; - XCAPivot kiBearishPivot; - XCAPivot tkiBullishPivot; - XCAPivot tkiBearishPivot; - XCAPivot peakSWHResPivot; - XCAPivot valeSWLSupPivot; - XCAPivot trendBullishPivot; - XCAPivot trendBearishPivot; - // XCPOIDrawer *drawer; XCXCAEAHelper *helper; diff --git a/XCAEA/Classes/xcaea.x-poi.drawer.class.mq5 b/XCAEA/Classes/xcaea.x-poi.drawer.class.mq5 new file mode 100644 index 00000000..1dd05976 --- /dev/null +++ b/XCAEA/Classes/xcaea.x-poi.drawer.class.mq5 @@ -0,0 +1,1440 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center MQL5 Indicator +// ------------------------------------------------- +// Name: XCXCAEAPOIDrawer ... +// Description: Class for XCAEA POI Drawer ... +// +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +// +// Global Properties ... +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://saherelm.ir" +#property version "1.00" +#property description "SaherElm Class for XCAEA POI Drawer" +#property strict + +// +// Imports ... +#include "../../Classes/x-saherelm.x-poi.drawer.class.mq5" +#include "../Classes/xcaea.x-poi.detector.class.mq5" + +// +// Definitions ... + +// +// Implementations ... +class XCXCAEAPOIDrawer : public XCBase +{ + // + // Public ... + public: + // + // Props ... + bool drawSWHPivots; + bool drawSWLPivots; + bool drawPeakPivots; + bool drawValePivots; + bool drawKIBullishPivots; + bool drawKIBearishPivots; + bool drawPeakSWHResPivots; + bool drawValeSWLSupPivots; + bool drawTKIBullishPivots; + bool drawTKIBearishPivots; + bool drawTrendBullishPivots; + bool drawTrendBearishPivots; + bool drawTKITRNDBullishPivots; + bool drawTKITRNDBearishPivots; + + // + bool drawActiveSWHPivot; + bool drawActiveSWLPivot; + bool drawActivePeakPivot; + bool drawActiveValePivot; + bool drawActiveKIBullishPivot; + bool drawActiveKIBearishPivot; + bool drawActivePeakSWHResPivot; + bool drawActiveValeSWLSupPivot; + bool drawActiveTKIBullishPivot; + bool drawActiveTKIBearishPivot; + bool drawActiveTrendBullishPivot; + bool drawActiveTrendBearishPivot; + bool drawActiveTKITRNDBullishPivot; + bool drawActiveTKITRNDBearishPivot; + + // + // Constructors ... + XCXCAEAPOIDrawer( + XCXCAEAPOIDetector *_detector // + ) + { + // + detector = _detector; + drawer = new XCPOIDrawer(); + + // + Default(); + } + + // + // De Constructors ... + ~XCXCAEAPOIDrawer() + { + // + mSWHPivotObjects.Clear(); + mSWLPivotObjects.Clear(); + mPeakPivotObjects.Clear(); + mValePivotObjects.Clear(); + mKIBullishPivotObjects.Clear(); + mKIBearishPivotObjects.Clear(); + mPeakSWHResPivotObjects.Clear(); + mValeSWLSupPivotObjects.Clear(); + mTKIBullishPivotObjects.Clear(); + mTKIBearishPivotObjects.Clear(); + mTrendBullishPivotObjects.Clear(); + mTrendBearishPivotObjects.Clear(); + mTKITRNDBullishPivotObjects.Clear(); + mTKITRNDBearishPivotObjects.Clear(); + + // + mActiveSWHPivotObject.Delete(); + mActiveSWHPivotObject.Detach(); + ZeroMemory(mActiveSWHPivotObject); + + // + mActiveSWLPivotObject.Delete(); + mActiveSWLPivotObject.Detach(); + ZeroMemory(mActiveSWLPivotObject); + + // + mActivePeakPivotObject.Delete(); + mActivePeakPivotObject.Detach(); + ZeroMemory(mActivePeakPivotObject); + + // + mActiveValePivotObject.Delete(); + mActiveValePivotObject.Detach(); + ZeroMemory(mActiveValePivotObject); + + // + mActiveKIBullishPivotObject.Delete(); + mActiveKIBullishPivotObject.Detach(); + ZeroMemory(mActiveKIBullishPivotObject); + + // + mActiveKIBearishPivotObject.Delete(); + mActiveKIBearishPivotObject.Detach(); + ZeroMemory(mActiveKIBearishPivotObject); + + // + mActivePeakSWHResPivotObject.Delete(); + mActivePeakSWHResPivotObject.Detach(); + ZeroMemory(mActivePeakSWHResPivotObject); + + // + mActiveValeSWLSupPivotObject.Delete(); + mActiveValeSWLSupPivotObject.Detach(); + ZeroMemory(mActiveValeSWLSupPivotObject); + + // + mActiveTKIBullishPivotObject.Delete(); + mActiveTKIBullishPivotObject.Detach(); + ZeroMemory(mActiveTKIBullishPivotObject); + + // + mActiveTKIBearishPivotObject.Delete(); + mActiveTKIBearishPivotObject.Detach(); + ZeroMemory(mActiveTKIBearishPivotObject); + + // + mActiveTrendBullishPivotObject.Delete(); + mActiveTrendBullishPivotObject.Detach(); + ZeroMemory(mActiveTrendBullishPivotObject); + + // + mActiveTrendBearishPivotObject.Delete(); + mActiveTrendBearishPivotObject.Detach(); + ZeroMemory(mActiveTrendBearishPivotObject); + + // + mActiveTKITRNDBullishPivotObject.Delete(); + mActiveTKITRNDBullishPivotObject.Detach(); + ZeroMemory(mActiveTKITRNDBullishPivotObject); + + // + mActiveTKITRNDBearishPivotObject.Delete(); + mActiveTKITRNDBearishPivotObject.Detach(); + ZeroMemory(mActiveTKITRNDBearishPivotObject); + + // + ZeroMemory(drawer); + ZeroMemory(detector); + } + + // + // Properties ... + + // + // Tools ... + + // + virtual void Default() + { + // + drawSWHPivots = false; + drawSWLPivots = false; + drawPeakPivots = false; + drawValePivots = false; + drawKIBullishPivots = false; + drawKIBearishPivots = false; + drawPeakSWHResPivots = false; + drawValeSWLSupPivots = false; + drawTKIBullishPivots = false; + drawTKIBearishPivots = false; + drawTrendBullishPivots = false; + drawTrendBearishPivots = false; + drawTKITRNDBullishPivots = false; + drawTKITRNDBearishPivots = false; + + // + drawActiveSWHPivot = false; + drawActiveSWLPivot = false; + drawActivePeakPivot = false; + drawActiveValePivot = false; + drawActiveKIBullishPivot = false; + drawActiveKIBearishPivot = false; + drawActivePeakSWHResPivot = false; + drawActiveValeSWLSupPivot = false; + drawActiveTKIBullishPivot = false; + drawActiveTKIBearishPivot = false; + drawActiveTrendBullishPivot = false; + drawActiveTrendBearishPivot = false; + drawActiveTKITRNDBullishPivot = false; + drawActiveTKITRNDBearishPivot = false; + } + + // + void Draw() + { + // + DrawSWHPivots(); + DrawSWLPivots(); + DrawPeakPivots(); + DrawValePivots(); + DrawKIBullishPivots(); + DrawKIBearishPivots(); + DrawPeakSWHResPivots(); + DrawValeSWLSupPivots(); + DrawTKIBullishPivots(); + DrawTKIBearishPivots(); + DrawTrendBullishPivots(); + DrawTrendBearishPivots(); + DrawTKITRNDBullishPivots(); + DrawTKITRNDBearishPivots(); + } + + // + void DrawActives() + { + // + DrawActiveSWHPivot(); + DrawActiveSWLPivot(); + DrawActivePeakPivot(); + DrawActiveValePivot(); + DrawActiveKIBullishPivot(); + DrawActiveKIBearishPivot(); + DrawActivePeakSWHResPivot(); + DrawActiveValeSWLSupPivot(); + DrawActiveTKIBullishPivot(); + DrawActiveTKIBearishPivot(); + DrawActiveTrendBullishPivot(); + DrawActiveTrendBearishPivot(); + DrawActiveTKITRNDBullishPivot(); + DrawActiveTKITRNDBearishPivot(); + } + + // + // + // + + // + void DrawSWHPivots() + { + // + if (!drawSWHPivots) + { + return; + } + + // + bool has = detector.HasSWHPivots(); + if (!has) + { + return; + } + + // + int count = detector.CountSWHPivots(); + for (int i = 0; i < count; i++) + { + // + XBoxZone iBox; + has = detector.swhPivots[i].AsBox(iBox); + if (!has) + { + continue; + } + + // + XCBoxObject *iObj; + has = drawer.DrawBox( + iBox, + iObj // + ); + if (has) + { + mSWHPivotObjects.Add(iObj); + } + + // + iBox.Clean(); + } + } + + // + void DrawSWLPivots() + { + // + if (!drawSWLPivots) + { + return; + } + + // + bool has = detector.HasSWLPivots(); + if (!has) + { + return; + } + + // + int count = detector.CountSWLPivots(); + for (int i = 0; i < count; i++) + { + // + XBoxZone iBox; + has = detector.swlPivots[i].AsBox(iBox); + if (!has) + { + continue; + } + + // + XCBoxObject *iObj; + has = drawer.DrawBox( + iBox, + iObj // + ); + if (has) + { + mSWLPivotObjects.Add(iObj); + } + + // + iBox.Clean(); + } + } + + // + void DrawPeakPivots() + { + // + if (!drawPeakPivots) + { + return; + } + + // + bool has = detector.HasPeakPivots(); + if (!has) + { + return; + } + + // + int count = detector.CountPeakPivots(); + for (int i = 0; i < count; i++) + { + // + XBoxZone iBox; + has = detector.peakPivots[i].AsBox(iBox); + if (!has) + { + continue; + } + + // + XCBoxObject *iObj; + has = drawer.DrawBox( + iBox, + iObj // + ); + if (has) + { + mPeakPivotObjects.Add(iObj); + } + + // + iBox.Clean(); + } + } + + // + void DrawValePivots() + { + // + if (!drawValePivots) + { + return; + } + + // + bool has = detector.HasValePivots(); + if (!has) + { + return; + } + + // + int count = detector.CountValePivots(); + for (int i = 0; i < count; i++) + { + // + XBoxZone iBox; + has = detector.valePivots[i].AsBox(iBox); + if (!has) + { + continue; + } + + // + XCBoxObject *iObj; + has = drawer.DrawBox( + iBox, + iObj // + ); + if (has) + { + mValePivotObjects.Add(iObj); + } + + // + iBox.Clean(); + } + } + + // + void DrawKIBullishPivots() + { + // + if (!drawKIBullishPivots) + { + return; + } + + // + bool has = detector.HasKIBullishPivots(); + if (!has) + { + return; + } + + // + int count = detector.CountKIBullishPivots(); + for (int i = 0; i < count; i++) + { + // + XBoxZone iBox; + has = detector.kiBullishPivots[i].AsBox(iBox); + if (!has) + { + continue; + } + + // + XCBoxObject *iObj; + has = drawer.DrawBox( + iBox, + iObj // + ); + if (has) + { + mKIBullishPivotObjects.Add(iObj); + } + + // + iBox.Clean(); + } + } + + // + void DrawKIBearishPivots() + { + // + if (!drawKIBearishPivots) + { + return; + } + + // + bool has = detector.HasKIBearishPivots(); + if (!has) + { + return; + } + + // + int count = detector.CountKIBearishPivots(); + for (int i = 0; i < count; i++) + { + // + XBoxZone iBox; + has = detector.kiBearishPivots[i].AsBox(iBox); + if (!has) + { + continue; + } + + // + XCBoxObject *iObj; + has = drawer.DrawBox( + iBox, + iObj // + ); + if (has) + { + mKIBearishPivotObjects.Add(iObj); + } + + // + iBox.Clean(); + } + } + + // + void DrawPeakSWHResPivots() + { + // + if (!drawPeakSWHResPivots) + { + return; + } + + // + bool has = detector.HasPeakSWHResPivots(); + if (!has) + { + return; + } + + // + int count = detector.CountPeakSWHResPivots(); + for (int i = 0; i < count; i++) + { + // + XBoxZone iBox; + has = detector.peakSWHResPivots[i].AsBox(iBox); + if (!has) + { + continue; + } + + // + XCBoxObject *iObj; + has = drawer.DrawBox( + iBox, + iObj // + ); + if (has) + { + mPeakSWHResPivotObjects.Add(iObj); + } + + // + iBox.Clean(); + } + } + + // + void DrawValeSWLSupPivots() + { + // + if (!drawValeSWLSupPivots) + { + return; + } + + // + bool has = detector.HasValeSWLSupPivots(); + if (!has) + { + return; + } + + // + int count = detector.CountValeSWLSupPivots(); + for (int i = 0; i < count; i++) + { + // + XBoxZone iBox; + has = detector.valeSWLSupPivots[i].AsBox(iBox); + if (!has) + { + continue; + } + + // + XCBoxObject *iObj; + has = drawer.DrawBox( + iBox, + iObj // + ); + if (has) + { + mValeSWLSupPivotObjects.Add(iObj); + } + + // + iBox.Clean(); + } + } + + // + void DrawTKIBullishPivots() + { + // + if (!drawTKIBullishPivots) + { + return; + } + + // + bool has = detector.HasTKIBullishPivots(); + if (!has) + { + return; + } + + // + int count = detector.CountTKIBullishPivots(); + for (int i = 0; i < count; i++) + { + // + XBoxZone iBox; + has = detector.tkiBullishPivots[i].AsBox(iBox); + if (!has) + { + continue; + } + + // + XCBoxObject *iObj; + has = drawer.DrawBox( + iBox, + iObj // + ); + if (has) + { + mTKIBullishPivotObjects.Add(iObj); + } + + // + iBox.Clean(); + } + } + + // + void DrawTKIBearishPivots() + { + // + if (!drawTKIBearishPivots) + { + return; + } + + // + bool has = detector.HasTKIBearishPivots(); + if (!has) + { + return; + } + + // + int count = detector.CountTKIBearishPivots(); + for (int i = 0; i < count; i++) + { + // + XBoxZone iBox; + has = detector.tkiBearishPivots[i].AsBox(iBox); + if (!has) + { + continue; + } + + // + XCBoxObject *iObj; + has = drawer.DrawBox( + iBox, + iObj // + ); + if (has) + { + mTKIBearishPivotObjects.Add(iObj); + } + + // + iBox.Clean(); + } + } + + // + void DrawTrendBullishPivots() + { + // + if (!drawTrendBullishPivots) + { + return; + } + + // + bool has = detector.HasTrendBullishPivots(); + if (!has) + { + return; + } + + // + int count = detector.CountTrendBullishPivots(); + for (int i = 0; i < count; i++) + { + // + XBoxZone iBox; + has = detector.trendBullishPivots[i].AsBox(iBox); + if (!has) + { + continue; + } + + // + XCBoxObject *iObj; + has = drawer.DrawBox( + iBox, + iObj // + ); + if (has) + { + mTrendBullishPivotObjects.Add(iObj); + } + + // + iBox.Clean(); + } + } + + // + void DrawTrendBearishPivots() + { + // + if (!drawTrendBearishPivots) + { + return; + } + + // + bool has = detector.HasTrendBearishPivots(); + if (!has) + { + return; + } + + // + int count = detector.CountTrendBearishPivots(); + for (int i = 0; i < count; i++) + { + // + XBoxZone iBox; + has = detector.trendBearishPivots[i].AsBox(iBox); + if (!has) + { + continue; + } + + // + XCBoxObject *iObj; + has = drawer.DrawBox( + iBox, + iObj // + ); + if (has) + { + mTrendBearishPivotObjects.Add(iObj); + } + + // + iBox.Clean(); + } + } + + // + void DrawTKITRNDBullishPivots() + { + // + if (!drawTKITRNDBullishPivots) + { + return; + } + + // + bool has = detector.HasTKITRNDBullishPivots(); + if (!has) + { + return; + } + + // + int count = detector.CountTKITRNDBullishPivots(); + for (int i = 0; i < count; i++) + { + // + XBoxZone iBox; + has = detector.tkitrndBullishPivots[i].AsBox(iBox); + if (!has) + { + continue; + } + + // + XCBoxObject *iObj; + has = drawer.DrawBox( + iBox, + iObj // + ); + if (has) + { + mTKITRNDBullishPivotObjects.Add(iObj); + } + + // + iBox.Clean(); + } + } + + // + void DrawTKITRNDBearishPivots() + { + // + if (!drawTKITRNDBearishPivots) + { + return; + } + + // + bool has = detector.HasTKITRNDBearishPivots(); + if (!has) + { + return; + } + + // + int count = detector.CountTKITRNDBearishPivots(); + for (int i = 0; i < count; i++) + { + // + XBoxZone iBox; + has = detector.tkitrndBearishPivots[i].AsBox(iBox); + if (!has) + { + continue; + } + + // + XCBoxObject *iObj; + has = drawer.DrawBox( + iBox, + iObj // + ); + if (has) + { + mTKITRNDBearishPivotObjects.Add(iObj); + } + + // + iBox.Clean(); + } + } + + // + // + // + + // + void DrawActiveSWHPivot() + { + // + if (!drawActiveSWHPivot) + { + return; + } + + // + bool has = detector.swhPivot.IsValid(); + if (!has) + { + return; + } + + // + XBoxZone iBox; + has = detector.swhPivot.AsBox(iBox); + if (!has) + { + // + iBox.Clean(); + return; + } + + // + has = drawer.DrawBox( + iBox, + mActiveSWHPivotObject // + ); + + // + iBox.Clean(); + } + + // + void DrawActiveSWLPivot() + { + // + if (!drawActiveSWLPivot) + { + return; + } + + // + bool has = detector.swlPivot.IsValid(); + if (!has) + { + return; + } + + // + XBoxZone iBox; + has = detector.swlPivot.AsBox(iBox); + if (!has) + { + // + iBox.Clean(); + return; + } + + // + has = drawer.DrawBox( + iBox, + mActiveSWLPivotObject // + ); + + // + iBox.Clean(); + } + + // + void DrawActivePeakPivot() + { + // + if (!drawActivePeakPivot) + { + return; + } + + // + bool has = detector.peakPivot.IsValid(); + if (!has) + { + return; + } + + // + XBoxZone iBox; + has = detector.peakPivot.AsBox(iBox); + if (!has) + { + // + iBox.Clean(); + return; + } + + // + has = drawer.DrawBox( + iBox, + mActivePeakPivotObject // + ); + + // + iBox.Clean(); + } + + // + void DrawActiveValePivot() + { + // + if (!drawActiveValePivot) + { + return; + } + + // + bool has = detector.valePivot.IsValid(); + if (!has) + { + return; + } + + // + XBoxZone iBox; + has = detector.valePivot.AsBox(iBox); + if (!has) + { + // + iBox.Clean(); + return; + } + + // + has = drawer.DrawBox( + iBox, + mActiveValePivotObject // + ); + + // + iBox.Clean(); + } + + // + void DrawActiveKIBullishPivot() + { + // + if (!drawActiveKIBullishPivot) + { + return; + } + + // + bool has = detector.kiBullishPivot.IsValid(); + if (!has) + { + return; + } + + // + XBoxZone iBox; + has = detector.kiBullishPivot.AsBox(iBox); + if (!has) + { + // + iBox.Clean(); + return; + } + + // + has = drawer.DrawBox( + iBox, + mActiveKIBullishPivotObject // + ); + + // + iBox.Clean(); + } + + // + void DrawActiveKIBearishPivot() + { + // + if (!drawActiveKIBearishPivot) + { + return; + } + + // + bool has = detector.kiBearishPivot.IsValid(); + if (!has) + { + return; + } + + // + XBoxZone iBox; + has = detector.kiBearishPivot.AsBox(iBox); + if (!has) + { + // + iBox.Clean(); + return; + } + + // + has = drawer.DrawBox( + iBox, + mActiveKIBearishPivotObject // + ); + + // + iBox.Clean(); + } + + // + void DrawActivePeakSWHResPivot() + { + // + if (!drawActivePeakSWHResPivot) + { + return; + } + + // + bool has = detector.peakSWHResPivot.IsValid(); + if (!has) + { + return; + } + + // + XBoxZone iBox; + has = detector.peakSWHResPivot.AsBox(iBox); + if (!has) + { + // + iBox.Clean(); + return; + } + + // + has = drawer.DrawBox( + iBox, + mActivePeakSWHResPivotObject // + ); + + // + iBox.Clean(); + } + + // + void DrawActiveValeSWLSupPivot() + { + // + if (!drawActiveValeSWLSupPivot) + { + return; + } + + // + bool has = detector.valeSWLSupPivot.IsValid(); + if (!has) + { + return; + } + + // + XBoxZone iBox; + has = detector.valeSWLSupPivot.AsBox(iBox); + if (!has) + { + // + iBox.Clean(); + return; + } + + // + has = drawer.DrawBox( + iBox, + mActiveValeSWLSupPivotObject // + ); + + // + iBox.Clean(); + } + + // + void DrawActiveTKIBullishPivot() + { + // + if (!drawActiveTKIBullishPivot) + { + return; + } + + // + bool has = detector.tkiBullishPivot.IsValid(); + if (!has) + { + return; + } + + // + XBoxZone iBox; + has = detector.tkiBullishPivot.AsBox(iBox); + if (!has) + { + // + iBox.Clean(); + return; + } + + // + has = drawer.DrawBox( + iBox, + mActiveTKIBullishPivotObject // + ); + + // + iBox.Clean(); + } + + // + void DrawActiveTKIBearishPivot() + { + // + if (!drawActiveTKIBearishPivot) + { + return; + } + + // + bool has = detector.tkiBearishPivot.IsValid(); + if (!has) + { + return; + } + + // + XBoxZone iBox; + has = detector.tkiBearishPivot.AsBox(iBox); + if (!has) + { + // + iBox.Clean(); + return; + } + + // + has = drawer.DrawBox( + iBox, + mActiveTKIBearishPivotObject // + ); + + // + iBox.Clean(); + } + + // + void DrawActiveTrendBullishPivot() + { + // + if (!drawActiveTrendBullishPivot) + { + return; + } + + // + bool has = detector.trendBullishPivot.IsValid(); + if (!has) + { + return; + } + + // + XBoxZone iBox; + has = detector.trendBullishPivot.AsBox(iBox); + if (!has) + { + // + iBox.Clean(); + return; + } + + // + has = drawer.DrawBox( + iBox, + mActiveTrendBullishPivotObject // + ); + + // + iBox.Clean(); + } + + // + void DrawActiveTrendBearishPivot() + { + // + if (!drawActiveTrendBearishPivot) + { + return; + } + + // + bool has = detector.trendBearishPivot.IsValid(); + if (!has) + { + return; + } + + // + XBoxZone iBox; + has = detector.trendBearishPivot.AsBox(iBox); + if (!has) + { + // + iBox.Clean(); + return; + } + + // + has = drawer.DrawBox( + iBox, + mActiveTrendBearishPivotObject // + ); + + // + iBox.Clean(); + } + + // + void DrawActiveTKITRNDBullishPivot() + { + // + if (!drawActiveTKITRNDBullishPivot) + { + return; + } + + // + bool has = detector.tkitrndBullishPivot.IsValid(); + if (!has) + { + return; + } + + // + XBoxZone iBox; + has = detector.tkitrndBullishPivot.AsBox(iBox); + if (!has) + { + // + iBox.Clean(); + return; + } + + // + has = drawer.DrawBox( + iBox, + mActiveTKITRNDBullishPivotObject // + ); + + // + iBox.Clean(); + } + + // + void DrawActiveTKITRNDBearishPivot() + { + // + if (!drawActiveTKITRNDBearishPivot) + { + return; + } + + // + bool has = detector.tkitrndBearishPivot.IsValid(); + if (!has) + { + return; + } + + // + XBoxZone iBox; + has = detector.tkitrndBearishPivot.AsBox(iBox); + if (!has) + { + // + iBox.Clean(); + return; + } + + // + has = drawer.DrawBox( + iBox, + mActiveTKITRNDBearishPivotObject // + ); + + // + iBox.Clean(); + } + + // + // Protected ... + protected: + // + // Props ... + + // + // Prrivate ... + private: + // + // Props ... + + // + XCPOIDrawer *drawer; + XCXCAEAPOIDetector *detector; + + // + CArrayObj mSWHPivotObjects; + CArrayObj mSWLPivotObjects; + CArrayObj mPeakPivotObjects; + CArrayObj mValePivotObjects; + CArrayObj mKIBullishPivotObjects; + CArrayObj mKIBearishPivotObjects; + CArrayObj mPeakSWHResPivotObjects; + CArrayObj mValeSWLSupPivotObjects; + CArrayObj mTKIBullishPivotObjects; + CArrayObj mTKIBearishPivotObjects; + CArrayObj mTrendBullishPivotObjects; + CArrayObj mTrendBearishPivotObjects; + CArrayObj mTKITRNDBullishPivotObjects; + CArrayObj mTKITRNDBearishPivotObjects; + + // + XCBoxObject *mActiveSWHPivotObject; + XCBoxObject *mActiveSWLPivotObject; + XCBoxObject *mActivePeakPivotObject; + XCBoxObject *mActiveValePivotObject; + XCBoxObject *mActiveKIBullishPivotObject; + XCBoxObject *mActiveKIBearishPivotObject; + XCBoxObject *mActivePeakSWHResPivotObject; + XCBoxObject *mActiveValeSWLSupPivotObject; + XCBoxObject *mActiveTKIBullishPivotObject; + XCBoxObject *mActiveTKIBearishPivotObject; + XCBoxObject *mActiveTrendBullishPivotObject; + XCBoxObject *mActiveTrendBearishPivotObject; + XCBoxObject *mActiveTKITRNDBullishPivotObject; + XCBoxObject *mActiveTKITRNDBearishPivotObject; + + // +}; + +// \ No newline at end of file diff --git a/XCAEA/Signals/xcaea.signaller.class.mq5 b/XCAEA/Signals/xcaea.signaller.class.mq5 index 62e585af..f5c9ed1d 100644 --- a/XCAEA/Signals/xcaea.signaller.class.mq5 +++ b/XCAEA/Signals/xcaea.signaller.class.mq5 @@ -24,6 +24,7 @@ #include "../../Classes/x-saherelm.base.class.mq5" #include "../../Classes/x-saherelm.x-cobject.class.mq5" #include "../Classes/xcaea.x-poi.detector.class.mq5" +#include "../Classes/xcaea.x-poi.drawer.class.mq5" #include "../Helpers/xcaea.helper.mq5" #include "../Libraries/xcaea.signaller.lib.mq5" @@ -41,6 +42,7 @@ class XCXCAEASignaller : XCBase XCAEAInputs inputs; XBarTracker barTraker; XCXCAEAHelper *helper; + XCXCAEAPOIDrawer *drawer; bool continuesRFTillTarget; XCXCAEAPOIDetector *detector; XCAEAStrategyConditions mConditions; @@ -56,6 +58,8 @@ class XCXCAEASignaller : XCBase // symbol = _symbol; period = _period; + + // Init(); } @@ -172,7 +176,12 @@ class XCXCAEASignaller : XCBase ); // - DrawPivots(); + // Draw Active Pivots ... + drawer.DrawActives(); + + // + // Draw Founded Pivots ... + drawer.Draw(); // // @@ -515,501 +524,6 @@ class XCXCAEASignaller : XCBase protected: // - // - void DrawPivots() - { - // - int count = 0; - bool has = false; - datetime cTime = TimeCurrent(); - - // - bool drawPeakPivots = false; - bool drawValePivots = false; - bool drawSWHPivots = true; - bool drawSWLPivots = true; - bool drawPeakSWHResPivots = false; - bool drawValeSWLSupPivots = false; - bool drawKIBullishPivots = false; - bool drawKIBearishPivots = false; - bool drawTKIBullishPivots = false; - bool drawTKIBearishPivots = false; - bool drawTrendBullishPivots = false; - bool drawTrendBearishPivots = false; - - // - // Draw Peak Pivots ... - if (drawPeakPivots) - { - // - has = detector.HasPeakPivots(); - if (has) - { - // - count = detector.CountPeakPivots(); - for (int i = 0; i < count; i++) - { - // - XBoxZone iBox; - has = detector - .peakPivots[i] - .AsBox(iBox); - if (has) - { - // - // iBox.to = cTime; - - // - XCBoxObject *iObj; - has = helper.poiDrawer.DrawBox( - iBox, - iObj // - ); - if (has) - { - mObjects.Add(iObj); - } - } - - // - iBox.Clean(); - } - } - } - - // - // Draw Vale Pivots ... - if (drawValePivots) - { - // - has = detector.HasValePivots(); - if (has) - { - // - count = detector.CountValePivots(); - for (int i = 0; i < count; i++) - { - // - XBoxZone iBox; - has = detector - .valePivots[i] - .AsBox(iBox); - if (has) - { - // - // iBox.to = cTime; - - // - XCBoxObject *iObj; - has = helper.poiDrawer.DrawBox( - iBox, - iObj // - ); - if (has) - { - mObjects.Add(iObj); - } - } - - // - iBox.Clean(); - } - } - } - - // - // Draw SWH Pvots ... - if (drawSWHPivots) - { - // - has = detector.HasSWHPivots(); - if (has) - { - // - count = detector.CountSWHPivots(); - for (int i = 0; i < count; i++) - { - // - XBoxZone iBox; - has = detector - .swhPivots[i] - .AsBox(iBox); - if (has) - { - // - // iBox.to = cTime; - - // - XCBoxObject *iObj; - has = helper - .poiDrawer - .DrawBox( - iBox, - iObj // - ); - if (has) - { - mObjects.Add(iObj); - } - } - } - } - } - - // - // Draw SWL Pvots ... - if (drawSWLPivots) - { - // - has = detector.HasSWLPivots(); - if (has) - { - // - count = detector.CountSWLPivots(); - for (int i = 0; i < count; i++) - { - // - XBoxZone iBox; - has = detector - .swlPivots[i] - .AsBox(iBox); - if (has) - { - // - // iBox.to = cTime; - - // - XCBoxObject *iObj; - has = helper - .poiDrawer - .DrawBox( - iBox, - iObj // - ); - if (has) - { - mObjects.Add(iObj); - } - } - } - } - } - - // - // Draw Peak SWH Res Pivots ... - if (drawPeakSWHResPivots) - { - // - has = detector.HasPeakSWHResPivots(); - if (has) - { - // - count = detector.CountPeakSWHResPivots(); - for (int i = 0; i < count; i++) - { - // - XBoxZone iBox; - has = detector - .peakSWHResPivots[i] - .AsBox(iBox); - if (has) - { - // - // iBox.to = cTime; - - // - XCBoxObject *iObj; - has = helper.poiDrawer.DrawBox( - iBox, - iObj // - ); - if (has) - { - mObjects.Add(iObj); - } - } - - // - iBox.Clean(); - } - } - } - - // - // Draw Vale SWL Sup Pivots ... - if (drawValeSWLSupPivots) - { - // - has = detector.HasValeSWLSupPivots(); - if (has) - { - // - count = detector.CountValeSWLSupPivots(); - for (int i = 0; i < count; i++) - { - // - XBoxZone iBox; - has = detector - .valeSWLSupPivots[i] - .AsBox(iBox); - if (has) - { - // - // iBox.to = cTime; - - // - XCBoxObject *iObj; - has = helper.poiDrawer.DrawBox( - iBox, - iObj // - ); - if (has) - { - mObjects.Add(iObj); - } - } - - // - iBox.Clean(); - } - } - } - - // - // Draw KI Bullish Pivots ... - if (drawKIBullishPivots) - { - // - has = detector.HasKIBullishPivots(); - if (has) - { - // - count = detector.CountKIBullishPivots(); - for (int i = 0; i < count; i++) - { - // - XBoxZone iBox; - has = detector - .kiBullishPivots[i] - .AsBox(iBox); - if (has) - { - // - // iBox.to = cTime; - - // - XCBoxObject *iObj; - has = helper - .poiDrawer - .DrawBox( - iBox, - iObj // - ); - if (has) - { - mObjects.Add(iObj); - } - } - } - } - } - - // - // Draw KI Bearish Pivots ... - if (drawKIBearishPivots) - { - // - has = detector.HasKIBullishPivots(); - if (has) - { - // - count = detector.CountKIBearishPivots(); - for (int i = 0; i < count; i++) - { - // - XBoxZone iBox; - has = detector - .kiBearishPivots[i] - .AsBox(iBox); - if (has) - { - // - // iBox.to = cTime; - - // - XCBoxObject *iObj; - has = helper - .poiDrawer - .DrawBox( - iBox, - iObj // - ); - if (has) - { - mObjects.Add(iObj); - } - } - } - } - } - - // - // Draw TKI Bullish Pivots ... - if (drawTKIBullishPivots) - { - // - has = detector.HasTKIBullishPivots(); - if (has) - { - // - count = detector.CountTKIBullishPivots(); - for (int i = 0; i < count; i++) - { - // - XBoxZone iBox; - has = detector - .tkiBullishPivots[i] - .AsBox(iBox); - if (has) - { - // - // iBox.to = cTime; - - // - XCBoxObject *iObj; - has = helper - .poiDrawer - .DrawBox( - iBox, - iObj // - ); - if (has) - { - mObjects.Add(iObj); - } - } - } - } - } - - // - // Draw TKI Bearish Pivots ... - if (drawTKIBearishPivots) - { - // - has = detector.HasTKIBullishPivots(); - if (has) - { - // - count = detector.CountTKIBearishPivots(); - for (int i = 0; i < count; i++) - { - // - XBoxZone iBox; - has = detector - .tkiBearishPivots[i] - .AsBox(iBox); - if (has) - { - // - // iBox.to = cTime; - - // - XCBoxObject *iObj; - has = helper - .poiDrawer - .DrawBox( - iBox, - iObj // - ); - if (has) - { - mObjects.Add(iObj); - } - } - } - } - } - - // - // Draw Trend Bullish Pivots ... - if (drawTrendBullishPivots) - { - // - has = detector.HasTrendBullishPivots(); - if (has) - { - // - count = detector.CountTrendBullishPivots(); - for (int i = 0; i < count; i++) - { - // - XBoxZone iBox; - has = detector - .trendBullishPivots[i] - .AsBox(iBox); - if (has) - { - // - // iBox.to = cTime; - - // - XCBoxObject *iObj; - has = helper - .poiDrawer - .DrawBox( - iBox, - iObj // - ); - if (has) - { - mObjects.Add(iObj); - } - } - } - } - } - - // - // Draw Trend Bearish Pivots ... - if (drawTrendBearishPivots) - { - // - has = detector.HasTrendBullishPivots(); - if (has) - { - // - count = detector.CountTrendBearishPivots(); - for (int i = 0; i < count; i++) - { - // - XBoxZone iBox; - has = detector - .trendBearishPivots[i] - .AsBox(iBox); - if (has) - { - // - // iBox.to = cTime; - - // - XCBoxObject *iObj; - has = helper - .poiDrawer - .DrawBox( - iBox, - iObj // - ); - if (has) - { - mObjects.Add(iObj); - } - } - } - } - } - } - // // Private ... private: @@ -1098,6 +612,44 @@ class XCXCAEASignaller : XCBase // detector = new XCXCAEAPOIDetector(helper); + + // + // Initialize and Configure Drawer ... + drawer = new XCXCAEAPOIDrawer(detector); + + // + // UnActive Pivots ... + drawer.drawSWHPivots = false; + drawer.drawSWLPivots = false; + drawer.drawPeakPivots = false; + drawer.drawValePivots = false; + drawer.drawKIBullishPivots = false; + drawer.drawKIBearishPivots = false; + drawer.drawPeakSWHResPivots = true; + drawer.drawValeSWLSupPivots = true; + drawer.drawTKIBullishPivots = false; + drawer.drawTKIBearishPivots = false; + drawer.drawTrendBullishPivots = false; + drawer.drawTrendBearishPivots = false; + drawer.drawTKITRNDBullishPivots = false; + drawer.drawTKITRNDBearishPivots = false; + + // + // Active Pivots ... + drawer.drawActiveSWHPivot = false; + drawer.drawActiveSWLPivot = false; + drawer.drawActivePeakPivot = false; + drawer.drawActiveValePivot = false; + drawer.drawActiveKIBullishPivot = false; + drawer.drawActiveKIBearishPivot = false; + drawer.drawActivePeakSWHResPivot = false; + drawer.drawActiveValeSWLSupPivot = false; + drawer.drawActiveTKIBullishPivot = false; + drawer.drawActiveTKIBearishPivot = false; + drawer.drawActiveTrendBullishPivot = false; + drawer.drawActiveTrendBearishPivot = false; + drawer.drawActiveTKITRNDBullishPivot = false; + drawer.drawActiveTKITRNDBearishPivot = false; } /** @@ -1107,6 +659,9 @@ class XCXCAEASignaller : XCBase { // inputs.Clean(); + + // + ZeroMemory(drawer); ZeroMemory(helper); ZeroMemory(detector);