diff --git a/Strategies/x-saherelm.xch.strategy.mq5 b/Strategies/x-saherelm.xch.strategy.mq5 index e73d66ee..58e19e59 100644 --- a/Strategies/x-saherelm.xch.strategy.mq5 +++ b/Strategies/x-saherelm.xch.strategy.mq5 @@ -55,6 +55,35 @@ struct XCHStrategyConditions ENUM_TIMEFRAMES period; datetime time; + // + // Important Ares attached ... + + // + XOHCL support; + XOHCL resistance; + XOHCL bullishOB; + XOHCL bearishOB; + + // + double bullishFVGUpper; + double bullishFVGLower; + XOHCL bullishFVG; + + // + double bearishFVGUpper; + double bearishFVGLower; + XOHCL bearishFVG; + + // + XOHCL bullishTrendSwingHighs[]; + XOHCL bullishTrendSwingLows[]; + XOHCL bullishTrend; + + // + XOHCL bearishTrendSwingHighs[]; + XOHCL bearishTrendSwingLows[]; + XOHCL bearishTrend; + // // Helper Conditions ... XPVConditions pvConditions; @@ -606,6 +635,33 @@ public: return result; } + // + // Prepare Conditions ... + + // + XCHStrategyConditions conditions; + + // + conditions.symbol = mSymbol; + conditions.period = mPeriod; + conditions.time = cBar.time; + + // + conditions.pvConditions = pvConditions; + conditions.chmConditions = chmConditions; + conditions.chhkConditions = chhkConditions; + conditions.chtdConditions = chtdConditions; + conditions.chstrConditions = chstrConditions; + conditions.chcheConditions = chcheConditions; + conditions.chvlmConditions = chvlmConditions; + + // + result = conditions.IsValid(); + if (!result) + { + return result; + } + // // Previous Bar of Last Bar ... XOHCL pBar; @@ -794,6 +850,10 @@ public: // DetectImportantAreas(); + // + // Attached Important Areas to Conditions ... + FillConditionsImportantAreas(conditions); + // int pushers = 0; string signallers[]; @@ -1183,7 +1243,15 @@ public: ); if (result) { + // signal.pushers = pushers; + + // + // Notify XCH Specified Signal Event Handlers ... + NotifyOnXCHSignalEventHandlers( + signal, + conditions // + ); } // @@ -1567,6 +1635,60 @@ private: ); } + // + void FillConditionsImportantAreas(XCHStrategyConditions &conditions) + { + // + if (!conditions.IsValid()) + { + return; + } + + // + conditions.support = support; + conditions.resistance = resistance; + conditions.bullishOB = bullishOB; + conditions.bearishOB = bearishOB; + conditions.bullishFVG = bullishFVG; + conditions.bearishFVG = bearishFVG; + conditions.bullishTrend = bullishTrend; + conditions.bearishTrend = bearishTrend; + + // + conditions.bullishFVGUpper = bullishFVGUpper; + conditions.bullishFVGLower = bullishFVGLower; + conditions.bearishFVGUpper = bearishFVGUpper; + conditions.bearishFVGLower = bearishFVGLower; + + // + Copy( + bullishTrendSwingHighs, + conditions.bullishTrendSwingHighs, + true // + ); + + // + Copy( + bullishTrendSwingLows, + conditions.bullishTrendSwingLows, + true // + ); + + // + Copy( + bearishTrendSwingHighs, + conditions.bearishTrendSwingHighs, + true // + ); + + // + Copy( + bearishTrendSwingLows, + conditions.bearishTrendSwingLows, + true // + ); + } + // // XCHE Custom Data ...