last works ...

This commit is contained in:
2025-09-19 22:59:49 +03:30
parent 6f3639ef0b
commit 6788675c4a
9 changed files with 1122 additions and 8 deletions
@@ -1030,6 +1030,7 @@ class XCMarketPatternDetector : public XCBase
//
// Prepare ...
fvg.Clean();
CleanDirection(dir);
//
@@ -1113,6 +1114,116 @@ class XCMarketPatternDetector : public XCBase
return result;
}
//
// OB ...
/**
* Check For OB Exists in Specified Loopback Period ...
*
* @param bar: XOHCL, Specified Bar ...
* @param dir: ENUM_X_DIRECTION a reference for Direction ...
* @param ob: XBoxZone, reference for Holding OB ...
* @param maxLoopback: int, Max Allowed Loopback to Lookup OB ...
*
* @return ( bool )
*/
bool HasOB(
XOHCL &bar,
ENUM_X_DIRECTION &dir,
XBoxZone &ob,
int maxLoopback = 5 //
)
{
//
bool result = false;
//
// Prepare ...
ob.Clean();
CleanDirection(dir);
//
// Normalize ...
maxLoopback = NormalizeInt(maxLoopback, 3);
//
// Validate ...
result = bar.IsValid();
if (!result)
{
return result;
}
//
XOHCL iBar;
bool has = false;
int start = bar.Index();
int end = start + maxLoopback;
for (int i = start; i < end; i++)
{
//
// Initialize iBar ...
has = iBar.Init(
bar.symbol,
bar.period,
i //
);
if (!has)
{
continue;
}
//
// Check iBar is OB or not ...
has = barAnalyser.IsOB(
iBar,
ob,
true, // Force FVG Bar Type ...
true // Force OB First Two Bar InDirection ...
);
if (!has)
{
//
ob.Clean();
iBar.Clean();
CleanDirection(dir);
//
continue;
}
//
iBar.Clean();
dir = ob.dir;
//
break;
}
//
// Check OB Exists ...
result = ob.IsValid();
//
// Check Direction Exists ...
result =
result &&
HasDirection(dir);
//
// Cleanup Resources ...
if (!result)
{
//
ob.Clean();
CleanDirection(dir);
}
iBar.Clean();
//
return result;
}
//
// Trending ...
@@ -1382,6 +1493,16 @@ class XCMarketPatternDetector : public XCBase
return result;
}
/**
* Check Specified Bar Has Support or not ...
*
* @param bar: XOHCL, Specified Bar ...
* @param support: XOHCL, Supported Bar ...
* @param validationLength: int, Validation Length ...
* @param maxAllowedLoopback: int, Max Allowed Loopback to Detection ...
*
* @return ( bool )
*/
bool HasSupport(
XOHCL &bar,
XOHCL &support,
@@ -1476,6 +1597,16 @@ class XCMarketPatternDetector : public XCBase
return result;
}
/**
* Check Specified Bar Has Resistance or not ...
*
* @param bar: XOHCL, Specified Bar ...
* @param resistence: XOHCL, Resistanced Bar ...
* @param validationLength: int, Validation Length ...
* @param maxAllowedLoopback: int, Max Allowed Loopback to Detection ...
*
* @return ( bool )
*/
bool HasResistance(
XOHCL &bar,
XOHCL &resistence,