last ...
This commit is contained in:
@@ -526,6 +526,7 @@ class XCXFIMAPOIDetector : public XCMarketPatternDetector
|
||||
structure.bar = forBar;
|
||||
|
||||
//
|
||||
int idx = -1;
|
||||
bool has = false;
|
||||
int maxAllowedCollecting = 50;
|
||||
ENUM_X_DIRECTION iDir = X_DIRECTION_NONE;
|
||||
@@ -861,6 +862,20 @@ class XCXFIMAPOIDetector : public XCMarketPatternDetector
|
||||
//
|
||||
XBoxZone supportBox;
|
||||
has = ToSupportBox(support, supportBox);
|
||||
|
||||
//
|
||||
// Validate Zone Strength if Provided ...
|
||||
if (config.minAllowdSupportAndResistanceStrength > 0)
|
||||
{
|
||||
//
|
||||
has = has &&
|
||||
ValidateStrength(
|
||||
supportBox,
|
||||
config.minAllowdSupportAndResistanceStrength //
|
||||
);
|
||||
}
|
||||
|
||||
//
|
||||
if (has)
|
||||
{
|
||||
//
|
||||
@@ -908,6 +923,20 @@ class XCXFIMAPOIDetector : public XCMarketPatternDetector
|
||||
//
|
||||
XBoxZone resistanceBox;
|
||||
has = ToResistanceBox(resistance, resistanceBox);
|
||||
|
||||
//
|
||||
// Validate Zone Strength if Provided ...
|
||||
if (config.minAllowdSupportAndResistanceStrength > 0)
|
||||
{
|
||||
//
|
||||
has = has &&
|
||||
ValidateStrength(
|
||||
resistanceBox,
|
||||
config.minAllowdSupportAndResistanceStrength //
|
||||
);
|
||||
}
|
||||
|
||||
//
|
||||
if (has)
|
||||
{
|
||||
//
|
||||
@@ -1014,6 +1043,129 @@ class XCXFIMAPOIDetector : public XCMarketPatternDetector
|
||||
structure.zigzagAnalysis = analysis;
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// COMPLEX Actions ...
|
||||
|
||||
//
|
||||
// Lockup For Previous Zone ...
|
||||
has = structure.isSupportTouched ||
|
||||
structure.isResistanceTouched;
|
||||
if (has)
|
||||
{
|
||||
//
|
||||
if (structure.isSupportTouched)
|
||||
{
|
||||
//
|
||||
idx = GetYoungestBefore(
|
||||
structure.support.from,
|
||||
supports //
|
||||
);
|
||||
has = IsValidIndex(idx);
|
||||
if (has)
|
||||
{
|
||||
structure.prevZone = supports[idx];
|
||||
}
|
||||
}
|
||||
else if (structure.isResistanceTouched)
|
||||
{
|
||||
//
|
||||
idx = GetYoungestBefore(
|
||||
structure.resistance.from,
|
||||
resistances //
|
||||
);
|
||||
has = IsValidIndex(idx);
|
||||
if (has)
|
||||
{
|
||||
structure.prevZone = resistances[idx];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// Checkup for FakeBreaked Zones ...
|
||||
if (config.detectSupport ||
|
||||
config.detectResistance)
|
||||
{
|
||||
//
|
||||
// Retrieve Previous Bar ...
|
||||
int idx = -1;
|
||||
XOHCL pForBar;
|
||||
XBoxZone pSupport;
|
||||
XOHCL pBreakerBar;
|
||||
XBoxZone pResistance;
|
||||
has = forBar.GetPreviousBar(pForBar);
|
||||
if (has)
|
||||
{
|
||||
//
|
||||
// Detecting Nearest Above Lows Support ...
|
||||
idx = GetYoungestAbove(
|
||||
pForBar.low,
|
||||
supports //
|
||||
);
|
||||
has = IsValidIndex(idx) &&
|
||||
IsBreaked(
|
||||
forBar,
|
||||
supports[idx] //
|
||||
);
|
||||
if (has)
|
||||
{
|
||||
pSupport = supports[idx];
|
||||
}
|
||||
|
||||
//
|
||||
// Detecting Nearest Below Highs Resistance ...
|
||||
idx = GetYoungestBelow(
|
||||
pForBar.high,
|
||||
resistances //
|
||||
);
|
||||
has = IsValidIndex(idx) &&
|
||||
IsBreaked(
|
||||
forBar,
|
||||
resistances[idx] //
|
||||
);
|
||||
if (has)
|
||||
{
|
||||
pResistance = resistances[idx];
|
||||
}
|
||||
|
||||
//
|
||||
// Check at least a zone Exists ...
|
||||
has = pSupport.IsValid() ||
|
||||
pResistance.IsValid();
|
||||
if (has)
|
||||
{
|
||||
//
|
||||
// Support ...
|
||||
has = pSupport.IsValid();
|
||||
if (has)
|
||||
{
|
||||
//
|
||||
structure.isPTest = true;
|
||||
structure.pTestedZone = pSupport;
|
||||
// has = FindBreakerBar();
|
||||
}
|
||||
|
||||
//
|
||||
// Resistance ...
|
||||
has = pResistance.IsValid();
|
||||
if (has)
|
||||
{
|
||||
//
|
||||
structure.isPTest = true;
|
||||
structure.pTestedZone = pResistance;
|
||||
// has = FindBreakerBar();
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// Cleanup Resources ...
|
||||
pForBar.Clean();
|
||||
pSupport.Clean();
|
||||
pBreakerBar.Clean();
|
||||
pResistance.Clean();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
|
||||
Reference in New Issue
Block a user