This commit is contained in:
2025-11-03 01:49:22 +03:30
parent 9bb1b6073b
commit c0ccce5dd0
2 changed files with 87 additions and 8 deletions
+74 -1
View File
@@ -2671,6 +2671,78 @@ class XCMarketPatternDetector : public XCBase
return result;
}
/**
* Count Same Bars ...
*
* @param bar: XOHCL, Specified Bar ...
* @param sameBars: XOHCL, collection reference to holds same Bars ...
* @param dir: ENUM_X_DIRECTION, refrence to Founded Bars Direction holding ...
* @param forDir: ENUM_X_DIRECTION, Specified Looking Bar ...
*
* @return ( int )
*/
int CountSameBars(
XOHCL &bar,
XOHCL &sameBars[],
ENUM_X_DIRECTION &dir,
ENUM_X_DIRECTION forDir //
)
{
//
int result = 0;
//
// Prepare ...
XClean(sameBars);
//
// Validate ...
bool has = bar.IsValid();
if (!has)
{
return result;
}
//
XOHCL tmpBar;
ENUM_X_DIRECTION tmpDir = forDir;
int idx = bar.Index();
while (has)
{
//
idx++;
tmpBar.Clean();
has = bar.BarAt(idx, tmpBar);
if (has && !HasDirection(tmpDir))
{
tmpDir = tmpBar.GetDirection();
}
has = has &&
tmpBar.GetDirection() == tmpDir;
if (!has)
{
break;
}
//
AddIfNotExists(tmpBar, sameBars);
}
//
result = ArraySize(sameBars);
if (IsValidSize(result))
{
dir = tmpDir;
}
//
// Cleanup ...
tmpBar.Clean();
//
return result;
}
//
// Trending ...
@@ -4414,7 +4486,8 @@ class XCMarketPatternDetector : public XCBase
//
// Validate Zones Range ...
if (zonesRangeValidationFactor > 0) {
if (zonesRangeValidationFactor > 0)
{
//
double points = GetPoints(bar.symbol);
double minAllowedRange = points * zonesRangeValidationFactor;
@@ -1063,10 +1063,10 @@ class XCXFIMAStrategy1Signaller : public XCXFIMABaseSignaller
//
// Validator Flags ...
bool validateByZones = false;
bool validateHasLiquidity = true;
bool validateByXFIMARejected = true;
bool validateByXFIMAMACrossed = true;
bool validateByCyclesMATresnding = true;
bool validateHasLiquidity = false;
bool validateByXFIMARejected = false;
bool validateByXFIMAMACrossed = false;
bool validateByCyclesMATresnding = false;
bool validateByHasDirectionalZones = false;
bool validateByHasInDirectionalZones = false;
bool validateByInDirectionalZonesPlacement = false;
@@ -1151,8 +1151,11 @@ class XCXFIMAStrategy1Signaller : public XCXFIMABaseSignaller
//
// Detect Pin Bar ...
bool isPBarIsPinBar = poiDetector.IsPinnedBar(
p2Bar,
dir //
pBar,
dir,
3,
4,
true //
);
bool isPBarIsPinBarBullish = isPBarIsPinBar && IsXBullish(dir);
bool isPBarIsPinBarBearish = isPBarIsPinBar && IsXBearish(dir);
@@ -1161,7 +1164,10 @@ class XCXFIMAStrategy1Signaller : public XCXFIMABaseSignaller
// Detect Signal Key Bar ...
bool isPBarSignalKeyBar = poiDetector.IsSignalKeyBarPattern(
pBar,
dir //
dir,
3,
4,
true //
);
bool isPBarSignalKeyBarBullish = isPBarSignalKeyBar && IsXBullish(dir);
bool isPBarSignalKeyBarBearish = isPBarSignalKeyBar && IsXBearish(dir);