last works ...

This commit is contained in:
2025-10-09 12:34:26 +03:30
parent fc318b5c19
commit e97b44b938
7 changed files with 642 additions and 33 deletions
+219 -4
View File
@@ -89,6 +89,223 @@ struct XFIMAMarketStructure
return result;
}
//
// Collectors ...
/**
* Collect Required Zones from Structure ...
*
* @param dest: XBoxZone, reference collection to holds result ...
* @param forDir: ENUM_X_DIRECTION, Specified Collectiong ones Direction ...
* @param containsOB: bool, Contains OB Zones ...
* @param containsFVG: bool, Contains FVG Zones ...
*
* @return ( int )
*/
int CollectZones(
XBoxZone &dest[],
ENUM_X_DIRECTION forDir = X_DIRECTION_NONE,
bool containsOB = false,
bool containsFVG = false //
)
{
//
int result = 0;
//
// Prepare ...
XClean(dest);
//
// Validate ...
bool has = IsValid();
if (!has)
{
return result;
}
//
bool canCollectBullish =
IsXBullish(forDir) ||
!HasDirection(forDir);
//
bool canCollectBearish =
IsXBearish(forDir) ||
!HasDirection(forDir);
//
int count = 0;
XBoxZone tmpBox;
//
// Check Analysis ...
//
// XPV ...
has = pvAnalysis.IsValid();
if (has)
{
//
// Support ...
tmpBox.Clean();
has = pvAnalysis.HasSupportBox(tmpBox);
if (has && canCollectBullish)
{
//
AddIfNotExists(
tmpBox,
dest //
);
}
//
// Resistance ...
tmpBox.Clean();
has = pvAnalysis.HasResistanceBox(tmpBox);
if (has && canCollectBearish)
{
//
AddIfNotExists(
tmpBox,
dest //
);
}
}
//
// XZG ...
has = zgAnalysis.IsValid();
if (has)
{
//
// Support ...
tmpBox.Clean();
has = zgAnalysis.HasSupportBox(tmpBox);
if (has && canCollectBullish)
{
//
AddIfNotExists(
tmpBox,
dest //
);
}
//
// Resistance ...
tmpBox.Clean();
has = zgAnalysis.HasResistanceBox(tmpBox);
if (has && canCollectBearish)
{
//
AddIfNotExists(
tmpBox,
dest //
);
}
}
//
// Bar Patterns ...
has = HasChild(barsAnalysis);
if (has)
{
//
count = ArraySize(barsAnalysis);
for (int i = 0; i < count; i++)
{
//
// Support ...
has = barsAnalysis[i].IsSupport();
if (has && canCollectBullish)
{
//
AddIfNotExists(
barsAnalysis[i].support,
dest //
);
}
//
// Resistance ...
has = barsAnalysis[i].IsResistance();
if (has && canCollectBearish)
{
//
AddIfNotExists(
barsAnalysis[i].resistance,
dest //
);
}
//
// OB ...
if (containsOB)
{
//
has = barsAnalysis[i].IsOB();
if (has)
{
//
has = (canCollectBullish && barsAnalysis[i].ob.IsBullish()) ||
(canCollectBearish && barsAnalysis[i].ob.IsBearish());
if (has)
{
//
AddIfNotExists(
barsAnalysis[i].ob,
dest //
);
}
}
}
//
// FVG ...
if (containsFVG)
{
has = barsAnalysis[i].IsFVG();
if (has)
{
//
has = (canCollectBullish && barsAnalysis[i].fvg.IsBullish()) ||
(canCollectBearish && barsAnalysis[i].fvg.IsBearish());
if (has)
{
//
AddIfNotExists(
barsAnalysis[i].fvg,
dest //
);
}
}
}
}
}
//
result = ArraySize(dest);
has = IsValidSize(result);
if (has)
{
//
// Update To Time ...
// and also we Can Validate Zones Here ...
datetime cTime = TimeCurrent();
for (int i = 0; i < result; i++)
{
dest[i].to = cTime;
}
}
//
// Cleanup ...
tmpBox.Clean();
//
return result;
}
//
};
@@ -281,12 +498,10 @@ struct XFIMAMarketStructureDrawerConfig
XClean(barAnalysisDrawConfig.allowedDrawZones);
Add(
X_BAR_PATTERN_SUPPORT,
barAnalysisDrawConfig.allowedDrawZones
);
barAnalysisDrawConfig.allowedDrawZones);
Add(
X_BAR_PATTERN_RESISTANCE,
barAnalysisDrawConfig.allowedDrawZones
);
barAnalysisDrawConfig.allowedDrawZones);
}
/**