This commit is contained in:
2025-10-30 18:41:45 +03:30
parent 574c79afcc
commit 7ed6fb61bd
5 changed files with 956 additions and 94 deletions
@@ -1925,11 +1925,13 @@ class XCXFIMAStrategy1Signaller : public XCXFIMABaseSignaller
XOHCL tmpBar;
XPivot tmpPivot;
XBoxZone atrBox;
XBoxZone zones[];
XBoxZone tmpZone;
XBoxZone scPVZone;
XBoxZone mcPVZone;
XBoxZone lcPVZone;
XBoxZone hcPVZone;
XBoxZone tmpZones[];
XBoxZone pinBarZone;
XBoxZone supports[];
XBoxZone resistances[];
@@ -2151,6 +2153,65 @@ class XCXFIMAStrategy1Signaller : public XCXFIMABaseSignaller
}
}
//
// Collecting Zones ...
//
int collectedZonesCount = poiDetector.DetectZones(
bar,
zones,
true, // Validated Zones ...
false, // Remove Used Zones ...
false, // Contains Order Blocks ...
true, // Contains Fair Value Gaps ...
true, // Contains Supports ...
true, // Contains Resistances ...
X_DIRECTION_NONE, // For Dir (Contains All Direction Zones) ...
X_SORT_BY_DATE, // Sort By ...
X_DIRECTION_BEARISH, // Sort Dir ...
3, // Zones Loopback ...
3, // Zones Validation Length ...
0, // Count (All Zones) ...
100 // Loop back for Detection ...
);
bool hasCollectedZones = IsValidSize(collectedZonesCount) &&
collectedZonesCount > 1;
int affectedZonesCount = 0;
bool hasAffectedZone = false;
int collectedZonesBullishCount = 0;
int collectedZonesBearishCount = 0;
bool hasBullishAffectedZone = false;
bool hasBearishAffectedZone = false;
bool hasBullishCollectedZones = false;
bool hasBearishCollectedZones = false;
if (hasCollectedZones)
{
//
// Bullish ...
XClean(tmpZones);
collectedZonesBullishCount = ExtractByDirection(tmpZones, zones, X_DIRECTION_BULLISH);
hasBullishCollectedZones = IsValidSize(collectedZonesBullishCount);
//
// Bearish ...
XClean(tmpZones);
collectedZonesBearishCount = ExtractByDirection(tmpZones, zones, X_DIRECTION_BEARISH);
hasBearishCollectedZones = IsValidSize(collectedZonesBearishCount);
//
// Extract Affected Zones ...
XClean(tmpZones);
int affectedZonesCount = ExtractAffectedZones(p2Bar, zones, tmpZones);
int idx = GetYoungest(tmpZones);
if (IsValidIndex(idx))
{
affectedZone = tmpZones[idx];
}
hasAffectedZone = affectedZone.IsValid();
hasBullishAffectedZone = hasAffectedZone && affectedZone.IsBullish();
hasBearishAffectedZone = hasAffectedZone && affectedZone.IsBearish();
}
//
// Reading Cycle PVS ...
bool hasSCPV = poiDetector.GetSCZone(pBar, scPVZone);
@@ -2230,10 +2291,32 @@ class XCXFIMAStrategy1Signaller : public XCXFIMABaseSignaller
bool isP2BarPinnedBearish = isP2BarIsPinBar && IsXBearish(tmpDir);
//
// Checking ATR Box ...
bool hasATRBox = fimaParser.GetATRBox(
atrBox,
bar.Index() //
);
bool hasATRBoxBullish = hasATRBox && atrBox.IsBullish();
bool hasATRBoxBearish = hasATRBox && atrBox.IsBearish();
//
// Checking Double Patterns ...
ENUM_X_DIRECTION iDBDir;
XPatternAnalysis iPatterns;
XPatternAnalysis iPPatterns;
ENUM_X_BAR_PATTERN doublePatterns[];
GetCandlestickPatterns(doublePatterns);
bool hasDoublePatterns = poiDetector.HasDoublePatterns(
pBar,
iDBDir,
iPatterns,
iPPatterns,
doublePatterns,
iPatternsConfig,
5 //
);
bool hasBullishDoublePatterns = hasDoublePatterns && IsXBullish(iDBDir);
bool hasBearishDoublePatterns = hasDoublePatterns && IsXBearish(iDBDir);
//
isBullish =
@@ -2241,10 +2324,14 @@ class XCXFIMAStrategy1Signaller : public XCXFIMABaseSignaller
hasSupport &&
hasResistance &&
isCyclesBullish &&
hasATRBoxBullish &&
isCyclePVBullish &&
isP2BarPinnedBullish &&
hasBullishAffectedZone &&
isPBarHasBullishPatterns &&
hasBullishCollectedZones &&
isP2BarHasBullishPatterns &&
collectedZonesBullishCount > collectedZonesBearishCount &&
true
//
;
@@ -2255,10 +2342,14 @@ class XCXFIMAStrategy1Signaller : public XCXFIMABaseSignaller
hasSupport &&
hasResistance &&
isCyclesBearish &&
hasATRBoxBearish &&
isCyclePVBearish &&
isP2BarPinnedBearish &&
hasBearishAffectedZone &&
isPBarHasBearishPatterns &&
hasBearishCollectedZones &&
isP2BarHasBearishPatterns &&
collectedZonesBearishCount > collectedZonesBullishCount &&
true
//
;
@@ -2314,9 +2405,11 @@ class XCXFIMAStrategy1Signaller : public XCXFIMABaseSignaller
//
poiDrawer.DrawZone(pinBarZone, iConfig);
poiDrawer.DrawZone(affectedZone, iConfig);
poiDrawer.DrawTrendLine(pinBarZoneTrend, iConfig);
//
// poiDrawer.DrawZones(zones, iConfig);
poiDrawer.DrawZones(supports, iConfig);
poiDrawer.DrawZones(resistances, iConfig);
@@ -2326,6 +2419,14 @@ class XCXFIMAStrategy1Signaller : public XCXFIMABaseSignaller
poiDrawer.DrawZone(atrBox, iConfig);
}
//
if (hasDoublePatterns)
{
//
poiDrawer.DrawPatternAnalysis(iPatterns, iPatternsConfig);
poiDrawer.DrawPatternAnalysis(iPPatterns, iPatternsConfig);
}
//
iConfig.Clean();
iPatternsConfig.Clean();
@@ -2358,9 +2459,11 @@ class XCXFIMAStrategy1Signaller : public XCXFIMABaseSignaller
pBar.Clean();
p2Bar.Clean();
p3Bar.Clean();
XClean(zones);
tmpBar.Clean();
tmpZone.Clean();
XClean(supports);
XClean(tmpZones);
scPVZone.Clean();
mcPVZone.Clean();
lcPVZone.Clean();
@@ -488,6 +488,14 @@ class XCXFIMAPOIDetector : public XCMarketPatternDetector
return result;
}
/**
* Detect XPV Zone ...
*
* @param zone: XBoxZone, reference to Holds detected Zone ...
* @param barIndex: int, Specified Bar Index ...
*
* @return ( bool )
*/
bool DetectXPVZone(
XBoxZone &zone,
int barIndex = 0 //
@@ -1600,6 +1608,15 @@ class XCXFIMAPOIDetector : public XCMarketPatternDetector
return result;
}
/**
* Collect Specified ZOnes Boundary Min / Max Values ...
*
* @param uppers: XPivot, collection reference to holds Peaks of Zone's Boundary ...
* @param lowers: XPivot, collection reference to holds Vales of Zone's Boundary ...
* @param zone: XBoxZone, reference to Provide Specified Zone for Boundary Detection ...
*
* @return ( int )
*/
int CollectZonesBoundary(
XPivot &uppers[],
XPivot &lowers[],