diff --git a/Classes/x-saherelm.x-account.class.mq5 b/Classes/x-saherelm.x-account.class.mq5 index 3e63cfbc..b19c2e2b 100644 --- a/Classes/x-saherelm.x-account.class.mq5 +++ b/Classes/x-saherelm.x-account.class.mq5 @@ -57,7 +57,7 @@ class XCAccount : public XCBase public: // // Constructor ... - void XCAccount() + XCAccount() { // mAccountInfo = new CAccountInfo(); @@ -65,7 +65,7 @@ class XCAccount : public XCBase // // Deconstructor ... - void ~XCAccount() + ~XCAccount() { } @@ -376,7 +376,7 @@ class XCAccount : public XCBase /** * Retrieve Specified Message for Report Balance ... - * + * * @return ( string ) */ string GetBalanceReportMessage() diff --git a/Classes/x-saherelm.x-bar.analyser.class.mq5 b/Classes/x-saherelm.x-bar.analyser.class.mq5 index 32477c41..a3b0e992 100644 --- a/Classes/x-saherelm.x-bar.analyser.class.mq5 +++ b/Classes/x-saherelm.x-bar.analyser.class.mq5 @@ -74,13 +74,13 @@ class XCBarAnalyser : public XCBase // // Constructor(s) ... - void XCBarAnalyser() + XCBarAnalyser() { } // // Deconstructor ... - void ~XCBarAnalyser() + ~XCBarAnalyser() { } diff --git a/Classes/x-saherelm.x-cobject.class.mq5 b/Classes/x-saherelm.x-cobject.class.mq5 index df976315..6451853a 100644 --- a/Classes/x-saherelm.x-cobject.class.mq5 +++ b/Classes/x-saherelm.x-cobject.class.mq5 @@ -761,13 +761,13 @@ class XCSignalObject : public XCBaseObject // // Constructor ... - void XCSignalObject() + XCSignalObject() { } // // Deconstructor ... - void ~XCSignalObject() + ~XCSignalObject() { } @@ -2150,7 +2150,8 @@ class XCPositionObject : public XCBaseObject // // Change Risk Style if Risk Freed Position ... - if (isRiskFreed) { + if (isRiskFreed) + { // riskStyle.fill = true; riskStyle.clr = rewardStyle.clr; diff --git a/Classes/x-saherelm.x-helper.class.mq5 b/Classes/x-saherelm.x-helper.class.mq5 index ef721663..b2bf7362 100644 --- a/Classes/x-saherelm.x-helper.class.mq5 +++ b/Classes/x-saherelm.x-helper.class.mq5 @@ -38,7 +38,7 @@ class XCBaseHelper : public XCBase public: // // Constructor ... - void XCBaseHelper( + XCBaseHelper( string symbol, // Trading Symbol ENUM_TIMEFRAMES period // Trading Time Frame ) @@ -50,7 +50,7 @@ class XCBaseHelper : public XCBase // // Deconstructor ... - void ~XCBaseHelper() + ~XCBaseHelper() { // IndicatorRelease(mHandler); diff --git a/Classes/x-saherelm.x-http.class.mq5 b/Classes/x-saherelm.x-http.class.mq5 index 631532f2..88c21858 100644 --- a/Classes/x-saherelm.x-http.class.mq5 +++ b/Classes/x-saherelm.x-http.class.mq5 @@ -46,11 +46,11 @@ class XCHttp : public XCBase public: // // Constructor ... - void XCHttp() + XCHttp() { XCHttp("", 10000); } - void XCHttp( + XCHttp( string path, // Base Folder to Store Data int timeout // base timeout for Requests ) @@ -62,7 +62,7 @@ class XCHttp : public XCBase // // Deconstructor ... - void ~XCHttp() + ~XCHttp() { } diff --git a/Classes/x-saherelm.x-poi.drawer.class.mq5 b/Classes/x-saherelm.x-poi.drawer.class.mq5 index 5455bdfa..0df9b0c6 100644 --- a/Classes/x-saherelm.x-poi.drawer.class.mq5 +++ b/Classes/x-saherelm.x-poi.drawer.class.mq5 @@ -51,7 +51,7 @@ class XCPOIDrawer : public XCBase // // Constructor ... - void XCPOIDrawer() + XCPOIDrawer() { // Default(); @@ -59,7 +59,7 @@ class XCPOIDrawer : public XCBase // // Deconstructor ... - void ~XCPOIDrawer() + ~XCPOIDrawer() { // boxBullishStyle.Clean(); diff --git a/Classes/x-saherelm.x-rm.panel.class.mq5 b/Classes/x-saherelm.x-rm.panel.class.mq5 index b8132b95..718e4469 100644 --- a/Classes/x-saherelm.x-rm.panel.class.mq5 +++ b/Classes/x-saherelm.x-rm.panel.class.mq5 @@ -49,7 +49,7 @@ class XCRMPanel : public XCAppDialog // // Constructor(s) ... - void XCRMPanel() + XCRMPanel() { // Default(); @@ -57,7 +57,7 @@ class XCRMPanel : public XCAppDialog // // Deconstructor ... - void ~XCRMPanel() + ~XCRMPanel() { // HandleRemoveObjects(); diff --git a/Classes/x-saherelm.x-trade.class.mq5 b/Classes/x-saherelm.x-trade.class.mq5 index 12a60119..9af25efc 100644 --- a/Classes/x-saherelm.x-trade.class.mq5 +++ b/Classes/x-saherelm.x-trade.class.mq5 @@ -528,7 +528,7 @@ class XCTrade : public XCBase // // Constructors ... - void XCTrade( + XCTrade( int slippage, // Specify Slippage ulong magicNumber, // Specify Magic Number double maxAllowedSpread = 0, // Max Allowed Spred for Opening Trades diff --git a/Documents/Helpers/x-saherelm.x121.x3ma.helper.mq5 b/Documents/Helpers/x-saherelm.x121.x3ma.helper.mq5 index 54cefa50..ebbdc6a7 100644 --- a/Documents/Helpers/x-saherelm.x121.x3ma.helper.mq5 +++ b/Documents/Helpers/x-saherelm.x121.x3ma.helper.mq5 @@ -312,12 +312,12 @@ struct X121X3MAConditions // Buffers ... // - Clean(fastBuffer); - Clean(mediumBuffer); - Clean(slowBuffer); - Clean(fastStateBuffer); - Clean(mediumStateBuffer); - Clean(slowStateBuffer); + XClean(fastBuffer); + XClean(mediumBuffer); + XClean(slowBuffer); + XClean(fastStateBuffer); + XClean(mediumStateBuffer); + XClean(slowStateBuffer); // ArraySetAsSeries(fastBuffer, true); diff --git a/X121XKIEA/Classes/x-saherelm.x121.xki.parser.class.mq5 b/X121XKIEA/Classes/x-saherelm.x121.xki.parser.class.mq5 index 02c7f7ab..e1300407 100644 --- a/X121XKIEA/Classes/x-saherelm.x121.xki.parser.class.mq5 +++ b/X121XKIEA/Classes/x-saherelm.x121.xki.parser.class.mq5 @@ -274,6 +274,108 @@ class XCX121XKIHelperParser : XCBase // return result; } + + int CountKIFastTouches( + int barIndex = 0, + int loopback = 5, + ENUM_X_DIRECTION forDir = X_DIRECTION_NONE, + ENUM_X_BOUNDARY_PRICE priceType = X_BOUNDARY_PRICE_HIGH_LOW // + ) + { + // + int result = 0; + + // + // Normalize ... + loopback = NormalizeInt(loopback, 1); + barIndex = NormalizeBarIndex(barIndex); + + // + if (!IsValid()) + { + return result; + } + + // + XOHCL iBar; + bool has = false; + double iValue = 0; + double affectedValue = 0; + double iConfirnValue = 0; + bool isBullish = !HasDirection(forDir) || IsXBullish(forDir); + bool isBearish = !HasDirection(forDir) || IsXBearish(forDir); + ENUM_X_PRICE bullishTouchUpperPriceType = priceType == X_BOUNDARY_PRICE_HIGH_LOW + ? X_PRICE_HIGH + : X_PRICE_UP; + ENUM_X_PRICE bullishTouchLowerPriceType = priceType == X_BOUNDARY_PRICE_HIGH_LOW + ? X_PRICE_LOW + : X_PRICE_DOWN; + ENUM_X_PRICE bearishTouchUpperPriceType = priceType == X_BOUNDARY_PRICE_HIGH_LOW + ? X_PRICE_HIGH + : X_PRICE_UP; + ENUM_X_PRICE bearishTouchLowerPriceType = priceType == X_BOUNDARY_PRICE_HIGH_LOW + ? X_PRICE_LOW + : X_PRICE_DOWN; + for (int i = barIndex; i < barIndex + loopback; i++) + { + // + has = iBar.Init(symbol, period, i); + if (!has) + { + continue; + } + + // + affectedValue = helper.GetKIFast(i); + + // + // Bullish Touches ... + if (isBullish) + { + // + iValue = iBar.GetPrice(bullishTouchLowerPriceType); + iConfirnValue = iBar.GetPrice(bullishTouchUpperPriceType); + has = + NotEmptyZero(iValue) && + NotEmptyZero(affectedValue) && + NotEmptyZero(iConfirnValue) && + iValue <= affectedValue && + iConfirnValue >= affectedValue; + if (has) + { + result++; + } + } + + // + // Bearish Touches ... + if (isBearish) + { + // + iValue = iBar.GetPrice(bearishTouchUpperPriceType); + iConfirnValue = iBar.GetPrice(bearishTouchLowerPriceType); + has = + NotEmptyZero(iValue) && + NotEmptyZero(affectedValue) && + NotEmptyZero(iConfirnValue) && + iValue >= affectedValue && + iConfirnValue <= affectedValue; + if (has) + { + result++; + } + } + + // + iBar.Clean(); + } + + // + iBar.Clean(); + + // + return result; + } // #endregion // #region KI Slow ... diff --git a/X121XKIEA/Classes/x-saherelm.x121.xki.signaller.class.mq5 b/X121XKIEA/Classes/x-saherelm.x121.xki.signaller.class.mq5 index 445bb9ce..5c318476 100644 --- a/X121XKIEA/Classes/x-saherelm.x121.xki.signaller.class.mq5 +++ b/X121XKIEA/Classes/x-saherelm.x121.xki.signaller.class.mq5 @@ -989,6 +989,8 @@ class XCX121XKIStrategy1Signaller : public XCX121XKIBaseSignaller } // + XBoxZone swingLow; + XBoxZone swingHigh; ENUM_X_DIRECTION patternsDir[]; ENUM_X_BAR_PATTERN patterns[]; poiDetector.FillStrategy1Patterns( @@ -997,34 +999,7 @@ class XCX121XKIStrategy1Signaller : public XCX121XKIBaseSignaller ); // - isBullish = poiDetector.HasRecentPatternRejected( - zone, - patterns, - patternsDir, - barIndex, - 3, // Loopback .. - iBar.period, - X_DIRECTION_BULLISH // - ); - if (!isBullish) - { - // - isBearish = poiDetector.HasRecentPatternRejected( - zone, - patterns, - patternsDir, - barIndex, - 3, // Loopback .. - iBar.period, - X_DIRECTION_BEARISH // - ); - } - - // #region Swings/OrderFlow ... - // - // Swings ... - XBoxZone swingLow; - XBoxZone swingHigh; + // Reading Swings ... poiDetector.DetectRecentSwings( swingHigh, swingLow, @@ -1032,16 +1007,64 @@ class XCX121XKIStrategy1Signaller : public XCX121XKIBaseSignaller ); // - // Order Flow ... + // Reading Order Flow ... // + // Bullish Order Flow ... XBoxZone bullishOrderFlow[]; + int bullishOrderFlowRejectdIDX = -1; poiDetector.HasOrderFlow(bullishOrderFlow, barIndex, 4, X_DIRECTION_BULLISH, 15); // + // Bearish Order Flow ... XBoxZone bearishOrderFlow[]; + int bearishOrderFlowRejectdIDX = -1; poiDetector.HasOrderFlow(bearishOrderFlow, barIndex, 4, X_DIRECTION_BEARISH, 15); - // #endregion + + // + // Base Conditions ... + + // + isBullish = + IsTFBullishPattern(barIndex, PERIOD_M1) && + IsTFBullishPattern(barIndex, PERIOD_M5) && + IsTFBullishPattern(barIndex, iBar.period) && + HasRejected( + bullishOrderFlowRejectdIDX, + iBar, + bullishOrderFlow // + ) && + poiDetector.HasRecentPatternRejected( + zone, + patterns, + patternsDir, + barIndex, + 3, // Loopback .. + iBar.period, + X_DIRECTION_BULLISH // + ); + if (!isBullish) + { + // + isBearish = + IsTFBearishPattern(barIndex, PERIOD_M1) && + IsTFBearishPattern(barIndex, PERIOD_M5) && + IsTFBearishPattern(barIndex, iBar.period) && + HasRejected( + bearishOrderFlowRejectdIDX, + iBar, + bearishOrderFlow // + ) && + poiDetector.HasRecentPatternRejected( + zone, + patterns, + patternsDir, + barIndex, + 3, // Loopback .. + iBar.period, + X_DIRECTION_BEARISH // + ); + } // // Validate Conditions ... 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 ca379ee6..3cceca21 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 @@ -1267,7 +1267,7 @@ class XCX121XKIPOIDetector : public XCMarketPatternDetector // return result; - } + } // #endregion // #region Zone Detectors ...