diff --git a/Classes/x-saherelm.x-bar.analyser.class.mq5 b/Classes/x-saherelm.x-bar.analyser.class.mq5 index 6501d1fa..fb255dd3 100644 --- a/Classes/x-saherelm.x-bar.analyser.class.mq5 +++ b/Classes/x-saherelm.x-bar.analyser.class.mq5 @@ -2099,13 +2099,12 @@ class XCBarAnalyser : public XCBase } // - // Check Bar Must Engulfed ... - result = IsEngulfed( - bar, - dir // - ); + XOHCL pBar; + result = bar.GetPreviousBar(pBar); if (!result) { + // + pBar.Clean(); return result; } @@ -2131,24 +2130,32 @@ class XCBarAnalyser : public XCBase IsValidIndex(hhIDX); if (!result) { + // + pBar.Clean(); return result; } - // - // TODO: Fix Momentum Extends and Also Rejection ... - double llhhDiff = MathAbs(hh - ll); - // bool isBullish = bar.low > ll && - IsBullish(dir) && - bar.close >= hh; + bar.close >= hh && + bar.IsBullish() && + bar.low > pBar.low && + bar.high > pBar.high && + bar.GetBody() > pBar.GetBody() && + bar.GetRange() > pBar.GetRange() && + bar.GetShadows() < pBar.GetShadows(); // bool isBearish = bar.high < hh && - IsBearish(dir) && - bar.close <= ll; + bar.close <= ll && + bar.IsBearish() && + bar.low < pBar.low && + bar.high < pBar.high && + bar.GetBody() > pBar.GetBody() && + bar.GetRange() > pBar.GetRange() && + bar.GetShadows() < pBar.GetShadows(); // result = isBullish || @@ -2163,7 +2170,7 @@ class XCBarAnalyser : public XCBase } // - // Cleanup Resources ... + pBar.Clean(); // return result; diff --git a/Classes/x-saherelm.x-poi.class.mq5 b/Classes/x-saherelm.x-poi.class.mq5 index b9b86b13..0f376dc6 100644 --- a/Classes/x-saherelm.x-poi.class.mq5 +++ b/Classes/x-saherelm.x-poi.class.mq5 @@ -788,10 +788,10 @@ class XCPOIDetector : public XCBaseAlert // // Momentum ... - // DetectMomentum( - // iBar, - // iEvent // - // ); + DetectMomentum( + iBar, + iEvent // + ); // // Rejection ... @@ -952,10 +952,10 @@ class XCPOIDetector : public XCBaseAlert // // Momentum ... - // has = DetectMomentum( - // iBar, - // iEvent // - // ); + has = DetectMomentum( + iBar, + iEvent // + ); if (has) { // @@ -1181,7 +1181,7 @@ class XCPOIDetector : public XCBaseAlert // Copy( - mBullishMomentums, + mBearishMomentums, state.bearishMomentums // ); @@ -1570,10 +1570,32 @@ class XCPOIDetector : public XCBaseAlert return result; } + // + XOHCL sBar; + if (bar.Index() == 0) + { + // + result = sBar.Init( + bar.symbol, + bar.period, + bar.Index() + 1 // + ); + if (!result) + { + // + sBar.Clean(); + return result; + } + } + else + { + sBar = bar; + } + // ENUM_X_DIRECTION iDir; result = mBarAnalyser.IsMomentum( - bar, + sBar, iDir, mMomentumLoopback, mMomentumRangeExtendMultiplier // @@ -1584,6 +1606,8 @@ class XCPOIDetector : public XCBaseAlert HasDirection(iDir); if (!result) { + // + sBar.Clean(); return result; } @@ -1602,10 +1626,12 @@ class XCPOIDetector : public XCBaseAlert XCMomentumBar *momentum; momentum = new XCMomentumBar(); result = momentum.Init( - bar // + sBar // ); if (!result) { + // + sBar.Clean(); return result; } @@ -1617,6 +1643,8 @@ class XCPOIDetector : public XCBaseAlert result = !IsValidIndex(idx); if (!result) { + // + sBar.Clean(); return result; } @@ -1653,6 +1681,9 @@ class XCPOIDetector : public XCBaseAlert ? X_BULLISH_MOMENTUM_BAR_DETECTED : X_BEARISH_MOMENTUM_BAR_DETECTED; + // + sBar.Clean(); + // return result; } diff --git a/Classes/x-saherelm.x-poi.drawer.class.mq5 b/Classes/x-saherelm.x-poi.drawer.class.mq5 index 3fa70904..6fb397a6 100644 --- a/Classes/x-saherelm.x-poi.drawer.class.mq5 +++ b/Classes/x-saherelm.x-poi.drawer.class.mq5 @@ -3364,9 +3364,9 @@ class XCPOIDrawer : public XCBase // Bearish ... bool ignoreSwingHighs = false, bool ignoreSupplyZones = false, + bool ignoreResistanceZones = false, bool ignoreBearishSharps = false, bool ignoreBearishSpikes = false, - bool ignoreResistanceZones = false, bool ignoreBearishMomentums = false, bool ignoreBearishRejections = false, bool ignoreBearishOrderBlocks = false, diff --git a/Experts/x-saherelm.xpoi.test.ea.mq5 b/Experts/x-saherelm.xpoi.test.ea.mq5 index 35b5d7eb..e0c44ca2 100644 --- a/Experts/x-saherelm.xpoi.test.ea.mq5 +++ b/Experts/x-saherelm.xpoi.test.ea.mq5 @@ -342,24 +342,24 @@ void DetectPOIState() stateObjects, // // Bullish ... - showBullishPOIs && false, // SwingLows + showBullishPOIs && true, // SwingLows showBullishPOIs && true, // DemandZones showBullishPOIs && true, // SupportZones showBullishPOIs && true, // BullishSharps - showBullishPOIs && false, // BullishSpikes - showBullishPOIs && true, // BullishMomentums + showBullishPOIs && true, // BullishSpikes + showBullishPOIs && false, // BullishMomentums showBullishPOIs && true, // BullishRejections showBullishPOIs && true, // BullishOrderBlocks showBullishPOIs && true, // BullishFairValueGaps showBullishPOIs && true, // BullishConsolidationZones // // Bearish ... - showBearishPOIs && false, // SwingHighs + showBearishPOIs && true, // SwingHighs showBearishPOIs && true, // SupplyZones showBearishPOIs && true, // BearishSharps - showBearishPOIs && false, // BearishSpikes + showBearishPOIs && true, // BearishSpikes showBearishPOIs && true, // ResistanceZones - showBearishPOIs && true, // BearishMomentums + showBearishPOIs && false, // BearishMomentums showBearishPOIs && true, // BearishRejections showBearishPOIs && true, // BearishOrderBlocks showBearishPOIs && true, // BearishFairValueGaps @@ -367,9 +367,9 @@ void DetectPOIState() ); // - if (poiEventNotifier.hasNewSwing) + if (poiEventNotifier.hasNewMomentum) { - Print("Swing ..."); + Print("Momentum ..."); } //