last ...
This commit is contained in:
@@ -39,6 +39,12 @@ class XCXFIMAPOIDetector : public XCMarketPatternDetector
|
||||
XCBarAnalyser *barAnalyser; // Bar Analyser ...
|
||||
XCXFIMAHelper *fimaHelper; // XFIMA Helper ...
|
||||
|
||||
//
|
||||
XBoxZone obs[];
|
||||
XBoxZone fvgs[];
|
||||
XBoxZone supports[];
|
||||
XBoxZone resistances[];
|
||||
|
||||
//
|
||||
// Constructor ...
|
||||
XCXFIMAPOIDetector(
|
||||
@@ -475,6 +481,12 @@ class XCXFIMAPOIDetector : public XCMarketPatternDetector
|
||||
*/
|
||||
void Destroy()
|
||||
{
|
||||
//
|
||||
SpecifiedClean(obs);
|
||||
SpecifiedClean(fvgs);
|
||||
SpecifiedClean(supports);
|
||||
SpecifiedClean(resistances);
|
||||
|
||||
//
|
||||
delete barAnalyser;
|
||||
ZeroMemory(barAnalyser);
|
||||
@@ -515,6 +527,7 @@ class XCXFIMAPOIDetector : public XCMarketPatternDetector
|
||||
|
||||
//
|
||||
bool has = false;
|
||||
int maxAllowedCollecting = 50;
|
||||
ENUM_X_DIRECTION iDir = X_DIRECTION_NONE;
|
||||
|
||||
//
|
||||
@@ -539,6 +552,33 @@ class XCXFIMAPOIDetector : public XCMarketPatternDetector
|
||||
{
|
||||
structure.ob.Clean();
|
||||
}
|
||||
|
||||
//
|
||||
// Detect Touches ...
|
||||
if (isOB)
|
||||
{
|
||||
//
|
||||
AddIfNotExists(
|
||||
structure.ob,
|
||||
obs,
|
||||
maxAllowedCollecting //
|
||||
);
|
||||
|
||||
//
|
||||
XOHCL pBar;
|
||||
bool has = forBar.GetPreviousBar(pBar);
|
||||
if (has)
|
||||
{
|
||||
//
|
||||
structure.isOBTouched =
|
||||
isBullishOB
|
||||
? pBar.low < structure.ob.upper
|
||||
: pBar.high > structure.ob.lower;
|
||||
}
|
||||
|
||||
//
|
||||
pBar.Clean();
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
@@ -552,14 +592,41 @@ class XCXFIMAPOIDetector : public XCMarketPatternDetector
|
||||
structure.fvg,
|
||||
config.fvgLoopback //
|
||||
);
|
||||
bool isBullishOB = isFVG &&
|
||||
IsSpecifiedBullish(iDir);
|
||||
bool isBearishOB = isFVG &&
|
||||
IsSpecifiedBearish(iDir);
|
||||
bool isBullishFVG = isFVG &&
|
||||
IsSpecifiedBullish(iDir);
|
||||
bool isBearishFVG = isFVG &&
|
||||
IsSpecifiedBearish(iDir);
|
||||
if (!isFVG)
|
||||
{
|
||||
structure.fvg.Clean();
|
||||
}
|
||||
|
||||
//
|
||||
// Detect Touches ...
|
||||
if (isFVG)
|
||||
{
|
||||
//
|
||||
AddIfNotExists(
|
||||
structure.fvg,
|
||||
fvgs,
|
||||
maxAllowedCollecting //
|
||||
);
|
||||
|
||||
//
|
||||
XOHCL pBar;
|
||||
bool has = forBar.GetPreviousBar(pBar);
|
||||
if (has)
|
||||
{
|
||||
//
|
||||
structure.isFVGTouched =
|
||||
isBullishFVG
|
||||
? pBar.low < structure.fvg.upper
|
||||
: pBar.high > structure.fvg.lower;
|
||||
}
|
||||
|
||||
//
|
||||
pBar.Clean();
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
@@ -796,10 +863,29 @@ class XCXFIMAPOIDetector : public XCMarketPatternDetector
|
||||
has = ToSupportBox(support, supportBox);
|
||||
if (has)
|
||||
{
|
||||
//
|
||||
AddIfNotExists(
|
||||
supportBox,
|
||||
supports,
|
||||
maxAllowedCollecting //
|
||||
);
|
||||
|
||||
//
|
||||
structure.support = supportBox;
|
||||
}
|
||||
|
||||
//
|
||||
// Check for Support Touches ...
|
||||
XOHCL pBar;
|
||||
has = has &&
|
||||
forBar.GetPreviousBar(pBar);
|
||||
if (has)
|
||||
{
|
||||
structure.isSupportTouched = pBar.low < supportBox.upper;
|
||||
}
|
||||
|
||||
//
|
||||
pBar.Clean();
|
||||
supportBox.Clean();
|
||||
}
|
||||
support.Clean();
|
||||
@@ -824,10 +910,29 @@ class XCXFIMAPOIDetector : public XCMarketPatternDetector
|
||||
has = ToResistanceBox(resistance, resistanceBox);
|
||||
if (has)
|
||||
{
|
||||
//
|
||||
AddIfNotExists(
|
||||
resistanceBox,
|
||||
resistances,
|
||||
maxAllowedCollecting //
|
||||
);
|
||||
|
||||
//
|
||||
structure.resistance = resistanceBox;
|
||||
}
|
||||
|
||||
//
|
||||
// Check for Resistance Touches ...
|
||||
XOHCL pBar;
|
||||
has = has &&
|
||||
forBar.GetPreviousBar(pBar);
|
||||
if (has)
|
||||
{
|
||||
structure.isResistanceTouched = pBar.high > resistanceBox.upper;
|
||||
}
|
||||
|
||||
//
|
||||
pBar.Clean();
|
||||
resistanceBox.Clean();
|
||||
}
|
||||
resistance.Clean();
|
||||
|
||||
Reference in New Issue
Block a user