diff --git a/Classes/x-saherelm.x-bar.analyser.class.mq5 b/Classes/x-saherelm.x-bar.analyser.class.mq5 index 51bcbfd8..60e6d162 100644 --- a/Classes/x-saherelm.x-bar.analyser.class.mq5 +++ b/Classes/x-saherelm.x-bar.analyser.class.mq5 @@ -315,6 +315,7 @@ class XCBarAnalyser : public XCBase * @param ranges: double Collection, Calculated Ranges ... * @param bar: XOHCL instance Reference, Start Bar ... * @param forceBody: bool, Force to Calculate Range using Body ... + * @param forceDiff: bool, Force to Calculate Range using Onl Price Diff ... * @param loopback: int, loopback period for Range Calculations ... * * @return ( int ) @@ -323,6 +324,7 @@ class XCBarAnalyser : public XCBase double &ranges[], XOHCL &bar, bool forceBody = false, + bool forceDiff = false, int loopback = 14 // ) { @@ -422,7 +424,11 @@ class XCBarAnalyser : public XCBase for (int i = 0; i < uppersCount; i++) { // - double iValue = lowers[i] + (uppers[i] - lowers[i]); + double iDiff = uppers[i] - lowers[i]; + double iValue = + forceDiff + ? iDiff + : lowers[i] + iDiff; // Add( diff --git a/XCAEA/Classes/xcaea.x-poi.detector.class.mq5 b/XCAEA/Classes/xcaea.x-poi.detector.class.mq5 index 2a279608..82bd3a89 100644 --- a/XCAEA/Classes/xcaea.x-poi.detector.class.mq5 +++ b/XCAEA/Classes/xcaea.x-poi.detector.class.mq5 @@ -1310,7 +1310,7 @@ class XCXCAEAPOIDetector : public XCBase has = helper.GetConditions( conditions, start, - 5 // + 10 // ); if (!has) { @@ -1511,6 +1511,19 @@ class XCXCAEAPOIDetector : public XCBase pCCI < p2CCI && pCCI < zCCI; + // + // ATR ... + double zATR = conditions.atrBuffer[zIDX]; + double cATR = conditions.atrBuffer[cIDX]; + double pATR = conditions.atrBuffer[pIDX]; + double p2ATR = conditions.atrBuffer[p2IDX]; + + // + double atrSum = GetSum(conditions.atrBuffer); + double atrMax = GetMax(conditions.atrBuffer); + double atrMin = GetMin(conditions.atrBuffer); + double atrAvg = GetAverage(conditions.atrBuffer); + // // Extracting Required Data about Trending ... @@ -2919,7 +2932,8 @@ class XCXCAEAPOIDetector : public XCBase // bool detectBullishSpikePivots = true; - if (detectBullishSpikePivots) { + if (detectBullishSpikePivots) + { // // For Spike Detection ... // [] 80% of Bars Must be Same as Direction ... diff --git a/XCAEA/Helpers/xcaea.helper.mq5 b/XCAEA/Helpers/xcaea.helper.mq5 index 4aade460..799380a1 100644 --- a/XCAEA/Helpers/xcaea.helper.mq5 +++ b/XCAEA/Helpers/xcaea.helper.mq5 @@ -174,6 +174,18 @@ struct XCAEAConditions datetime to; datetime from; + // + // Bars ... + XOHCL bars[]; + double bodies[]; + double ranges[]; + double velocities[]; + double scoreBullish; + double scoreBearish; + double volumeBullish; + double volumeBearish; + double priceChangeRate; + // // X3MA ... @@ -810,6 +822,22 @@ struct XCAEAConditions from = NULL; time = NULL; + // + // Bars ... + Clean(bars); + Clean(bodies); + Clean(ranges); + scoreBullish = 0; + scoreBearish = 0; + volumeBullish = 0; + volumeBearish = 0; + Clean(velocities); + priceChangeRate = 0; + ArraySetAsSeries(bars, true); + ArraySetAsSeries(bodies, true); + ArraySetAsSeries(ranges, true); + ArraySetAsSeries(velocities, true); + // // X3MA ... @@ -2705,13 +2733,18 @@ struct XCAEAConditions ; // - if (onlyCommons && !onlyConditions) { - result += commonStr = separator; - } else if (onlyConditions && !onlyCommons) { + if (onlyCommons && !onlyConditions) + { + result += commonStr = separator; + } + else if (onlyConditions && !onlyCommons) + { result += conditionsStr + separator; - } else { + } + else + { // - result += + result += // commonStr + separator + conditionsStr + separator @@ -3299,6 +3332,25 @@ class XCXCAEAHelper : XCBase conditions.period = mPeriod; conditions.time = TimeCurrent(); + // + // Filling Bars ... + int barsCount = GetBars( + conditions.bars, + mSymbol, + mPeriod, + barIndex, + loopback // + ); + result = barsCount == loopback; + if (!result) + { + // + conditions.Clean(); + + // + return result; + } + // int zIndex = barIndex; int cIndex = zIndex + 1; @@ -3990,6 +4042,65 @@ class XCXCAEAHelper : XCBase conditions.isStochasticCrossedOverSignal = xocsConditions.isStochasticCrossedOverSignal; conditions.isStochasticCrossedUnderSignal = xocsConditions.isStochasticCrossedUnderSignal; + // + int bodiesCount = barAnalyser.GetPriceRange( + conditions.bodies, + zBar, + true, // Force Body ... + true, // Force Price Diff ... + loopback // + ); + int rangesCount = barAnalyser.GetPriceRange( + conditions.ranges, + zBar, + true, // Force Body ... + true, // Force Price Diff ... + loopback // + ); + + // + int velocitiesCount = + barAnalyser + .GetPriceVelocity( + conditions.velocities, + zBar, + X_PRICE_CLOSE, + loopback // + ); + + // + double bullishVolume = 0.0; + double bearishVolume = 0.0; + barAnalyser + .CalculateRangeVolume( + zBar, + bullishVolume, + bearishVolume, + loopback // + ); + conditions.scoreBullish = bullishVolume; + conditions.scoreBearish = bearishVolume; + + // + double bullishScore = 0.0; + double bearishScore = 0.0; + conditions.GenerateScore( + bullishScore, + bearishScore // + ); + conditions.volumeBullish = bullishScore; + conditions.volumeBearish = bearishScore; + + // + double priceChangeRate = + barAnalyser + .GetPriceChangeRate( + zBar, + X_PRICE_CLOSE, + loopback // + ); + conditions.priceChangeRate = priceChangeRate; + // // Cleanup Resource ... @@ -4002,6 +4113,7 @@ class XCXCAEAHelper : XCBase // xcaConditions.Clean(); xocsConditions.Clean(); + x3maConditions.Clean(); // Free(); diff --git a/XCAEA/Libraries/xcaea.signaller.lib.mq5 b/XCAEA/Libraries/xcaea.signaller.lib.mq5 index bfdff0b6..10ef0afd 100644 --- a/XCAEA/Libraries/xcaea.signaller.lib.mq5 +++ b/XCAEA/Libraries/xcaea.signaller.lib.mq5 @@ -660,6 +660,9 @@ bool DetectXCAEAConditions( bool isScoreBearish = bearishScore > bullishScore; + // + bool isScoreNeutural = MathAbs(bullishScore - bearishScore) == 0; + // // Generating Conditions Summary ... string summary = @@ -672,7 +675,7 @@ bool DetectXCAEAConditions( // double bullishVolume = 0; double bearishVolume = 0; - int volumeRangeLoopback = 5; + int volumeRangeLoopback = loopback; helper.barAnalyser.CalculateRangeVolume( cBar, bullishVolume, @@ -680,6 +683,9 @@ bool DetectXCAEAConditions( volumeRangeLoopback // ); + // + bool isVolumeNeutural = MathAbs(bullishVolume - bearishVolume) == 0; + // double rangeVolume = bullishVolume = bearishVolume; double rangeVolumeAvg = rangeVolume / volumeRangeLoopback; @@ -1009,6 +1015,14 @@ bool DetectXCAEAConditions( Print(ToString(cBar.GetDirection()), " ATR Growing ..."); } + // + if (isScoreNeutural || + isVolumeNeutural) + { + // + Print("Zero Volume ..."); + } + // bool isLowOverMax = cBar.low > maxCTrendValue; bool isHighUnderMin = cBar.high < minCTrendValue; diff --git a/XCAEA/Signals/xcaea.signaller.class.mq5 b/XCAEA/Signals/xcaea.signaller.class.mq5 index ca02b0c7..dedecec8 100644 --- a/XCAEA/Signals/xcaea.signaller.class.mq5 +++ b/XCAEA/Signals/xcaea.signaller.class.mq5 @@ -888,20 +888,20 @@ class XCXCAEASignaller : XCBase // Configure Detector ... detector.detectTickPivots = false; detector.detectVolumePivots = false; - detector.detectRSIPeakPivots = true; - detector.detectRSIValePivots = true; + detector.detectRSIPeakPivots = false; + detector.detectRSIValePivots = false; detector.detectCCIPeakPivots = false; detector.detectCCIValePivots = false; - detector.detectFVGBullishPivots = true; - detector.detectFVGBearishPivots = true; + detector.detectFVGBullishPivots = false; + detector.detectFVGBearishPivots = false; detector.detectValeSupSWLPivots = true; detector.detectPeakResSWHPivots = true; detector.detectTrendBullishPivots = true; detector.detectTrendBearishPivots = true; detector.detectCCICrossedOverOSPivots = false; detector.detectCCICrossedUnderOBPivots = false; - detector.detectRSICrossedOverOSPivots = true; - detector.detectRSICrossedUnderOBPivots = true; + detector.detectRSICrossedOverOSPivots = false; + detector.detectRSICrossedUnderOBPivots = false; // // Initialize and Configure Drawer ... @@ -916,20 +916,20 @@ class XCXCAEASignaller : XCBase drawer.drawTrendLine = false; drawer.drawTickPivots = false; drawer.drawVolumePivots = false; - drawer.drawRSIPeakPivots = true; - drawer.drawRSIValePivots = true; + drawer.drawRSIPeakPivots = false; + drawer.drawRSIValePivots = false; drawer.drawCCIPeakPivots = false; drawer.drawCCIValePivots = false; - drawer.drawFVGBullishPivots = true; - drawer.drawFVGBearishPivots = true; - drawer.drawValeSupSWLPivots = true; - drawer.drawPeakResSWHPivots = true; + drawer.drawFVGBullishPivots = false; + drawer.drawFVGBearishPivots = false; + drawer.drawValeSupSWLPivots = false; + drawer.drawPeakResSWHPivots = false; drawer.drawTrendBullishPivots = false; drawer.drawTrendBearishPivots = false; drawer.drawCCICrossedOverOSPivots = false; drawer.drawCCICrossedUnderOBPivots = false; - drawer.drawRSICrossedOverOSPivots = true; - drawer.drawRSICrossedUnderOBPivots = true; + drawer.drawRSICrossedOverOSPivots = false; + drawer.drawRSICrossedUnderOBPivots = false; // // Configure Widths ...