add conditionsFilling to XCH Strategy and also Notify Specified Signal Event Handlers ...

This commit is contained in:
2024-08-01 02:33:22 +03:30
parent 49a52f54d4
commit 3a2ef261b5
+122
View File
@@ -55,6 +55,35 @@ struct XCHStrategyConditions
ENUM_TIMEFRAMES period; ENUM_TIMEFRAMES period;
datetime time; 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 ... // Helper Conditions ...
XPVConditions pvConditions; XPVConditions pvConditions;
@@ -606,6 +635,33 @@ public:
return result; 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 ... // Previous Bar of Last Bar ...
XOHCL pBar; XOHCL pBar;
@@ -794,6 +850,10 @@ public:
// //
DetectImportantAreas(); DetectImportantAreas();
//
// Attached Important Areas to Conditions ...
FillConditionsImportantAreas(conditions);
// //
int pushers = 0; int pushers = 0;
string signallers[]; string signallers[];
@@ -1183,7 +1243,15 @@ public:
); );
if (result) if (result)
{ {
//
signal.pushers = pushers; 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 ... // XCHE Custom Data ...