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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
|
||||
@@ -86,7 +86,9 @@ struct XFIMAPatternDetectorConfig
|
||||
//
|
||||
// Support and Resistance ...
|
||||
int supportAndResistanceValidationLength;
|
||||
int minAllowdSupportAndResistanceStrength;
|
||||
int supportAndResistanceMaxAllowedLoopback;
|
||||
int supportAndResistanceBreakeValidationLength;
|
||||
|
||||
//
|
||||
// TrueGap ...
|
||||
@@ -161,7 +163,9 @@ struct XFIMAPatternDetectorConfig
|
||||
trendingNumberOfSwings = 0;
|
||||
trendingSwingShoulders = 0;
|
||||
supportAndResistanceValidationLength = 0;
|
||||
minAllowdSupportAndResistanceStrength = 0;
|
||||
supportAndResistanceMaxAllowedLoopback = 0;
|
||||
supportAndResistanceBreakeValidationLength = 0;
|
||||
truwGapApprovedPointMultiplier = 0;
|
||||
flagPatternMinimumPullbackBars = 0;
|
||||
momentumBarRangeLength = 0;
|
||||
@@ -176,6 +180,9 @@ struct XFIMAPatternDetectorConfig
|
||||
maPivotsValidationLength = 0;
|
||||
numberOfRequiredPivotsForAnalysis = 0;
|
||||
maxAllowedLoopbackLengthForAnalysis = 0;
|
||||
|
||||
//
|
||||
ZeroMemory(this);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -229,7 +236,9 @@ struct XFIMAPatternDetectorConfig
|
||||
//
|
||||
// Support and Resistance ...
|
||||
supportAndResistanceValidationLength = 100;
|
||||
minAllowdSupportAndResistanceStrength = 1;
|
||||
supportAndResistanceMaxAllowedLoopback = 1500;
|
||||
supportAndResistanceBreakeValidationLength = 3;
|
||||
|
||||
//
|
||||
// TrueGap ...
|
||||
@@ -360,12 +369,25 @@ struct XFIMAMarketStructure
|
||||
XBoxZone support;
|
||||
XBoxZone resistance;
|
||||
|
||||
//
|
||||
// Previous Support or Resistance based on current ...
|
||||
//
|
||||
// Current Support is Touched => Prev Support;
|
||||
// Current Resistance is Touched => Prev Resistance;
|
||||
XBoxZone prevZone;
|
||||
|
||||
//
|
||||
bool isOBTouched;
|
||||
bool isFVGTouched;
|
||||
bool isSupportTouched;
|
||||
bool isResistanceTouched;
|
||||
|
||||
//
|
||||
// TODO: For Test ...
|
||||
bool isPTest;
|
||||
XBoxZone pTestedZone;
|
||||
XBoxZone recentlyTestedZone;
|
||||
|
||||
//
|
||||
// Analysis ...
|
||||
XPivotAnalysis pvAnalysis;
|
||||
@@ -420,6 +442,9 @@ struct XFIMAMarketStructure
|
||||
isSupportTouched = false;
|
||||
isResistanceTouched = false;
|
||||
|
||||
//
|
||||
prevZone.Clean();
|
||||
|
||||
//
|
||||
bar.Clean();
|
||||
flagSwing.Clean();
|
||||
@@ -444,6 +469,9 @@ struct XFIMAMarketStructure
|
||||
|
||||
//
|
||||
SpecifiedClean(trendSwings);
|
||||
|
||||
//
|
||||
ZeroMemory(this);
|
||||
}
|
||||
|
||||
//
|
||||
@@ -542,6 +570,9 @@ struct XFIMAMarketStructureDrawerConfig
|
||||
drawFIMAMAPivotsAnalysisPivots = false;
|
||||
drawFIMASARPivotsAnalysisPivots = false;
|
||||
drawFIMAZigZagPivotsAnalysisPivots = false;
|
||||
|
||||
//
|
||||
ZeroMemory(this);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user