This commit is contained in:
2025-09-21 05:59:18 +03:30
parent 73a97a80b3
commit 98b62aba96
6 changed files with 3108 additions and 196 deletions
+78 -2
View File
@@ -164,6 +164,7 @@ int eaCTHandler = INVALID_HANDLE; // Candle Timer Handler ...
//
bool eaIsNewBar; // Check New Bar ...
XZigZagAnalysis zigzagAnalysis;
ENUM_X_DIRECTION trendDir = X_DIRECTION_NONE;
//
@@ -1198,13 +1199,88 @@ void DetectPatterns()
cBar,
fima2Signaller.fimaHelper,
zigzags,
3 //
15 //
);
has = IsValidSize(zigzagsCount);
if (has)
{
//
Print("Detected ZigZags Points: ", zigzagsCount);
// Analyse Using ZigZag ...
XZigZagAnalysis cZGAnalysis;
//
// Check ZG Analysis Exists ...
has = cZGAnalysis.Analyse(
cBar,
zigzags //
);
//
// Check Exists ZG Analysis isn't Same Trend as Prev ...
has =
has &&
(!zigzagAnalysis.IsValid()
? true
: !zigzagAnalysis.IsSameTrendAs(cZGAnalysis));
if (has)
{
//
// Update Prev Analysis ...
zigzagAnalysis = cZGAnalysis;
//
// Notify Only When New Trending Happens ...
Print("Detected ZigZags Pivots Analysis: ", zigzagAnalysis.GetMessage());
//
// Draw Trend Line ...
//
string iObjID = zigzagAnalysis.GetObjectID();
string iNameType = ToXString(zigzagAnalysis.dir) + "_Trend";
//
// Upper Line ...
string iUpperName = iNameType + "_Upper_" + iObjID;
CChartObjectTrend *iUpperObj;
has = eaDrawer.DrawTrendLine(
zigzagAnalysis.lastPeak.value,
zigzagAnalysis.lastPeak.time,
zigzagAnalysis.recentPeak.value,
zigzagAnalysis.recentPeak.time,
iUpperObj,
ToMD5(iUpperName),
true //
);
//
// Lower Line ...
string iLowerName = iNameType + "_Lower_" + iObjID;
CChartObjectTrend *iLowerObj;
has =
has &&
eaDrawer.DrawTrendLine(
zigzagAnalysis.lastVale.value,
zigzagAnalysis.lastVale.time,
zigzagAnalysis.recentVale.value,
zigzagAnalysis.recentVale.time,
iLowerObj,
ToMD5(iLowerName),
true //
);
//
if (has) {
//
// Apply Style on Trend Lines ...
//
draws.Add(iUpperObj);
draws.Add(iLowerObj);
}
}
//
}
}
}