last ...
This commit is contained in:
@@ -227,6 +227,17 @@ class XCMarketPatternDetector : public XCBase
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check a Bar has Same Sequence Directionalo Bar or Not ...
|
||||
*
|
||||
* @param bar: XOHCL, Specified Bar ...
|
||||
* @param dir: ENUM_X_DIRECTION, Detected Bars Direction ...
|
||||
* @param count: int, Number of Same Bars ...
|
||||
* @param validation: int, Validation of Same Bars ...
|
||||
* @param loopback: int, Loopback for Detection ...
|
||||
*
|
||||
* @return ( bool )
|
||||
*/
|
||||
bool HasSameBars(
|
||||
XOHCL &bar,
|
||||
ENUM_X_DIRECTION &dir,
|
||||
@@ -252,12 +263,34 @@ class XCMarketPatternDetector : public XCBase
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
XOHCL tmpBar;
|
||||
bar.GetPreviousBar(tmpBar);
|
||||
while (tmpBar.GetDirection() == bar.GetDirection())
|
||||
{
|
||||
//
|
||||
count++;
|
||||
tmpBar.GetPreviousBar(tmpBar);
|
||||
}
|
||||
|
||||
//
|
||||
// Validate Count ...
|
||||
result = count >= validation;
|
||||
if (result)
|
||||
{
|
||||
dir = bar.GetDirection();
|
||||
}
|
||||
|
||||
//
|
||||
result =
|
||||
result &&
|
||||
count > 0 &&
|
||||
HasDirection(dir) &&
|
||||
count >= validation;
|
||||
|
||||
//
|
||||
tmpBar.Clean();
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user