diff --git a/Libraries/x-saherelm.common.lib.mq5 b/Libraries/x-saherelm.common.lib.mq5 index 404beb99..afbe8bcb 100644 --- a/Libraries/x-saherelm.common.lib.mq5 +++ b/Libraries/x-saherelm.common.lib.mq5 @@ -13258,6 +13258,20 @@ int GetCycleLengthOn( // // Direction ... +// +bool HasDirection(ENUM_X_DIRECTION value) +{ + // + bool result = false; + + // + result = value != X_DIRECTION_NONE && + value != X_DIRECTION_ALL; + + // + return result; +} + // bool IsBullish(ENUM_X_DIRECTION value) { diff --git a/X121SMCEA/Strategy/x-121.smc.test.strategy.class.mq5 b/X121SMCEA/Strategy/x-121.smc.test.strategy.class.mq5 index 614c1ee7..49ce616c 100644 --- a/X121SMCEA/Strategy/x-121.smc.test.strategy.class.mq5 +++ b/X121SMCEA/Strategy/x-121.smc.test.strategy.class.mq5 @@ -361,7 +361,11 @@ class XCX121SMCTestStrategy : public XCX121SMCBaseStrategy // // Detect Fair Value Gaps ... - + bool hasPOI = FindPOIInPivot( + X_POI_SWING_HIGH, + lastPivot, + mVisionPOIStat); + // TODO: // bool isOrderFlowBullish = IsBullish(mOrderFlowDir); @@ -1623,6 +1627,225 @@ class XCX121SMCTestStrategy : public XCX121SMCBaseStrategy ClearDraws(); } + bool FindPOIInPivot( + XCBasePOI *&pois[], + ENUM_XPOIS type, + XPVPivot &pivot, + XPOIState &state, + ENUM_X_DIRECTION dir = X_DIRECTION_NONE // + ) + { + // + bool result = false; + + // + Clean(pois); + + // + // Validate Inputs ... + result = + // + type != X_POI_NONE && + pivot.IsValid() && + state.IsValid() && + state.HasChild() + // + ; + if (!result) + { + return result; + } + + // + int swingHighsCunt = CountSwingHighs(); + int swingLowsCunt = CountSwingLows(); + int bullishMomentumBarsCunt = CountBullishMomentumBars(); + int bearishMomentumBarsCunt = CountBearishMomentumBars(); + int bullishRejectionBarsCunt = CountBullishRejectionBars(); + int bearishRejectionBarsCunt = CountBearishRejectionBars(); + int supportZonesCunt = CountSupportZones(); + int resistanceZonesCunt = CountResistanceZones(); + int supplyZonesCunt = CountSupplyZones(); + int demandZonesCunt = CountDemandZones(); + int bullishOrderBlocksCunt = CountBullishOrderBlocks(); + int bearishOrderBlocksCunt = CountBearishOrderBlocks(); + int bullishFairValueGapsCunt = CountBullishFairValueGaps(); + int bearishFairValueGapsCunt = CountBearishFairValueGaps(); + + // + switch (type) + { + // + case X_POI_MOMENTUM_BAR: { + // + // Validate Direction ... + result = HasDirection(dir); + if (!result) + { + return result; + } + + // + // Validate State POI(s) ... + result = IsValidSize(); + if (!result) + { + break; + } + + // + break; + } + + // + case X_POI_REJECTION_BAR: + // + // Validate Direction ... + result = HasDirection(dir); + if (!result) + { + return result; + } + + // + // Validate State POI(s) ... + result = IsValidSize(); + if (!result) + { + break; + } + + // + break; + + // + case X_POI_SWING_HIGH: + // + result = IsValidSize(); + if (!result) + { + break; + } + + // + break; + + // + case X_POI_SWING_LOW: + // + result = IsValidSize(); + if (!result) + { + break; + } + + // + break; + + // + case X_POI_SUPPORT_ZONE: + // + result = IsValidSize(); + if (!result) + { + break; + } + + // + break; + + // + case X_POI_RESISTANCE_ZONE: + // + result = IsValidSize(); + if (!result) + { + break; + } + + // + break; + + // + case X_POI_SUPPLY_ZONE: + // + result = IsValidSize(); + if (!result) + { + break; + } + + // + break; + + // + case X_POI_DEMAND_ZONE: + // + result = IsValidSize(); + if (!result) + { + break; + } + + // + break; + + // + case X_POI_BULLISH_ORDERBLOCK: + // + result = IsValidSize(); + if (!result) + { + break; + } + + // + break; + + // + case X_POI_BEARISH_ORDERBLOCK: + // + result = IsValidSize(); + if (!result) + { + break; + } + + // + break; + + // + case X_POI_BULLISH_FVG: + // + result = IsValidSize(); + if (!result) + { + break; + } + + // + break; + + // + case X_POI_BEARISH_FVG: + // + result = IsValidSize(); + if (!result) + { + break; + } + + // + break; + } + + // + return result; + } + + // + // Drawings ... + /** * Draw Order Flow ... */