diff --git a/X121XKIEA/Classes/x-saherelm.x121.xki.signaller.class.mq5 b/X121XKIEA/Classes/x-saherelm.x121.xki.signaller.class.mq5 index 33621428..536b1fbb 100644 --- a/X121XKIEA/Classes/x-saherelm.x121.xki.signaller.class.mq5 +++ b/X121XKIEA/Classes/x-saherelm.x121.xki.signaller.class.mq5 @@ -973,7 +973,6 @@ class XCX121XKIStrategy1Signaller : public XCX121XKIBaseSignaller } // - int score = 0; int scoreBullish = 0; int scoreBearish = 0; bool isBullish = false; @@ -1152,9 +1151,7 @@ class XCX121XKIStrategy1Signaller : public XCX121XKIBaseSignaller // #endregion // #endregion - // - // Summarize Directional Conditions ... - + // #region Summarize Directional Conditions ... // isBullish = isATRUp && @@ -1174,6 +1171,7 @@ class XCX121XKIStrategy1Signaller : public XCX121XKIBaseSignaller isKIWaveBearish || isLowerTFBearish || isCandlestickBearish); + // #endregion // // Validate Conditions ... @@ -1238,7 +1236,43 @@ class XCX121XKIStrategy1Signaller : public XCX121XKIBaseSignaller zone.IsValid(); if (result) { + // + // Refine Zone ... poiDetector.RefineZone(zone); + + // + // SL Refactoring ... + + // + XOHCL toBar; + if (zone.ToBar(toBar)) + { + // + int to = zone.ToIndex(); + int from = zone.FromIndex(); + int length = from - to; + double iValue = + isBullish + ? toBar.FindLowest(length, MODE_LOW) + : isBearish + ? toBar.FindHighest(length, MODE_HIGH) + : EMPTY_VALUE; + if (NotEmptyZero(iValue)) + { + // + if (isBullish) + { + zone.lower = MathMin(zone.lower, iValue); + } + + // + if (isBearish) + { + zone.upper = MathMax(zone.upper, iValue); + } + } + } + toBar.Clean(); } // diff --git a/X121XKIEA/Classes/x-saherelm.x121.xki.x-poi.detector.class.mq5 b/X121XKIEA/Classes/x-saherelm.x121.xki.x-poi.detector.class.mq5 index b22e236c..09271821 100644 --- a/X121XKIEA/Classes/x-saherelm.x121.xki.x-poi.detector.class.mq5 +++ b/X121XKIEA/Classes/x-saherelm.x121.xki.x-poi.detector.class.mq5 @@ -2247,6 +2247,7 @@ class XCX121XKIPOIDetector : public XCMarketPatternDetector iConfig.FullPattern(); // + // Looping Back ... for (int i = barIndex; i < barIndex + loopback; i++) { // @@ -2338,6 +2339,7 @@ class XCX121XKIPOIDetector : public XCMarketPatternDetector } // + // Cleanup Resource ... iBar.Clean(); iAnalysis.Clean(); XClean(iBullishZones); @@ -2345,9 +2347,7 @@ class XCX121XKIPOIDetector : public XCMarketPatternDetector } // - // Next - - // + // Cleanup Resources ... iBar.Clean(); iConfig.Clean(); iAnalysis.Clean();