last works ...
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user