last works ...
This commit is contained in:
@@ -564,21 +564,6 @@ class XCXFIMAPOIDetector : public XCMarketPatternDetector
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -612,21 +597,6 @@ class XCXFIMAPOIDetector : public XCMarketPatternDetector
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -891,16 +861,6 @@ class XCXFIMAPOIDetector : public XCMarketPatternDetector
|
||||
|
||||
//
|
||||
// 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();
|
||||
@@ -951,17 +911,6 @@ class XCXFIMAPOIDetector : public XCMarketPatternDetector
|
||||
}
|
||||
|
||||
//
|
||||
// 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();
|
||||
@@ -1047,46 +996,11 @@ class XCXFIMAPOIDetector : public XCMarketPatternDetector
|
||||
//
|
||||
// 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];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// Detect Recently Tested Zones ...
|
||||
if ((config.detectSupport ||
|
||||
config.detectResistance) &&
|
||||
config.recentlyTestedZonesMaxLookup > 0)
|
||||
config.detectResistance) &&
|
||||
config.recentlyZonesMaxLookupLength > 0)
|
||||
{
|
||||
//
|
||||
XOHCL iBar;
|
||||
@@ -1094,146 +1008,133 @@ class XCXFIMAPOIDetector : public XCMarketPatternDetector
|
||||
bool has = false;
|
||||
|
||||
//
|
||||
int start = forBar.Index() + 1;
|
||||
int end = start + config.recentlyTestedZonesMaxLookup;
|
||||
for (int i = start; i < end; i++) {
|
||||
int start = forBar.Index();
|
||||
int end = start + config.recentlyZonesMaxLookupLength;
|
||||
for (int i = start; i < end; i++)
|
||||
{
|
||||
//
|
||||
// Initialize Indexed Bar ...
|
||||
has = forBar.BarAt(i, iBar);
|
||||
if (!has) {
|
||||
if (!has)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
//
|
||||
// Selecting Support and Resistances ...
|
||||
|
||||
|
||||
//
|
||||
// Supports ...
|
||||
idx = GetYoungestBefore(iBar.time, supports);
|
||||
has = IsValidIndex(idx);
|
||||
if (has) {
|
||||
if (has)
|
||||
{
|
||||
//
|
||||
// Check Testing ...
|
||||
has = IsTested(iBar, supports[idx]);
|
||||
if (has) {
|
||||
if (has)
|
||||
{
|
||||
//
|
||||
AddIfNotExists(
|
||||
supports[idx],
|
||||
structure.recentlyTestedZones //
|
||||
);
|
||||
}
|
||||
|
||||
//
|
||||
// Check Breaked ...
|
||||
has = IsBreaked(iBar, supports[idx]);
|
||||
if (has)
|
||||
{
|
||||
//
|
||||
AddIfNotExists(
|
||||
supports[idx],
|
||||
structure.recentlyBreakedZones //
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// Resistances ...
|
||||
idx = GetYoungestBefore(iBar.time, resistances);
|
||||
has = IsValidIndex(idx);
|
||||
if (has) {
|
||||
if (has)
|
||||
{
|
||||
//
|
||||
// Check Testing ...
|
||||
has = IsTested(iBar, resistances[idx]);
|
||||
if (has) {
|
||||
if (has)
|
||||
{
|
||||
//
|
||||
AddIfNotExists(
|
||||
resistances[idx],
|
||||
structure.recentlyTestedZones //
|
||||
);
|
||||
}
|
||||
|
||||
//
|
||||
// Check Breaked ...
|
||||
has = IsBreaked(iBar, resistances[idx]);
|
||||
if (has)
|
||||
{
|
||||
//
|
||||
AddIfNotExists(
|
||||
resistances[idx],
|
||||
structure.recentlyBreakedZones //
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// Checkup for FakeBreaked Zones ...
|
||||
if (config.detectSupport ||
|
||||
config.detectResistance)
|
||||
if ((config.detectSupport ||
|
||||
config.detectResistance) &&
|
||||
HasChild(structure.recentlyBreakedZones))
|
||||
{
|
||||
//
|
||||
// Retrieve Previous Bar ...
|
||||
int idx = -1;
|
||||
XOHCL pForBar;
|
||||
bool has = false;
|
||||
|
||||
//
|
||||
// Detect Youngest Recently Breaked Zones ...
|
||||
idx = GetYoungest(structure.recentlyBreakedZones);
|
||||
has = IsValidIndex(idx);
|
||||
if (has)
|
||||
{
|
||||
//
|
||||
structure.fakeBreakedZone = structure.recentlyBreakedZones[idx];
|
||||
|
||||
//
|
||||
// Update To Time ...
|
||||
structure.fakeBreakedZone.to = forBar.time;
|
||||
}
|
||||
|
||||
//
|
||||
// Check Price Going Back to Zone Area ...
|
||||
has = structure.fakeBreakedZone.IsValid();
|
||||
if (has)
|
||||
{
|
||||
//
|
||||
// Check Current Bar Acted Based on Zone ...
|
||||
has = structure.fakeBreakedZone.IsBullish()
|
||||
? forBar.close > structure.fakeBreakedZone.upper
|
||||
: forBar.close < structure.fakeBreakedZone.lower;
|
||||
}
|
||||
|
||||
//
|
||||
// Try to Validate Breake Length ...
|
||||
|
||||
//
|
||||
// Get Youngest Breaker Bar ...
|
||||
XOHCL breakerBar;
|
||||
XBoxZone pSupport;
|
||||
XOHCL pBreakerBar;
|
||||
XBoxZone pResistance;
|
||||
|
||||
//
|
||||
// Selecting Previously Touched Support / Resistance ...
|
||||
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 ...
|
||||
// Selecting pTestedZone ...
|
||||
has = pSupport.IsValid() ||
|
||||
pResistance.IsValid();
|
||||
if (has)
|
||||
{
|
||||
//
|
||||
// Support ...
|
||||
has = pSupport.IsValid();
|
||||
if (has)
|
||||
{
|
||||
//
|
||||
structure.isPTest = true;
|
||||
structure.pTestedZone = pSupport;
|
||||
}
|
||||
|
||||
//
|
||||
// Resistance ...
|
||||
has = pResistance.IsValid();
|
||||
if (has)
|
||||
{
|
||||
//
|
||||
structure.isPTest = true;
|
||||
structure.pTestedZone = pResistance;
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// Check pTestedZone Existance ...
|
||||
has = structure.isPTest &&
|
||||
structure.pTestedZone.IsValid();
|
||||
if (has)
|
||||
{
|
||||
//
|
||||
// Get Breaker Bars ...
|
||||
XOHCL breakerBars[];
|
||||
int breakerBarsCount = GetBreakerBars(
|
||||
structure.pTestedZone,
|
||||
structure.fakeBreakedZone,
|
||||
breakerBars //
|
||||
);
|
||||
has = IsValidSize(breakerBarsCount);
|
||||
@@ -1247,36 +1148,381 @@ class XCXFIMAPOIDetector : public XCMarketPatternDetector
|
||||
breakerBar = breakerBars[idx];
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
SpecifiedClean(breakerBars);
|
||||
}
|
||||
has = breakerBar.IsValid();
|
||||
|
||||
//
|
||||
// Check Zone Breaker Bar Exists ...
|
||||
// Validate Zone Fake Breake Langth ...
|
||||
has = breakerBar.IsValid();
|
||||
// Validate BreakerBars Length ...
|
||||
if (has)
|
||||
{
|
||||
//
|
||||
// Validate Breake Length ...
|
||||
has = (breakerBar.Index() - pForBar.Index()) <= config.supportAndResistanceBreakeValidationLength;
|
||||
int diff = breakerBar.Index() - forBar.Index();
|
||||
|
||||
//
|
||||
has =
|
||||
config.supportAndResistanceBreakeValidationLength <= 0
|
||||
? true
|
||||
: diff <= config.supportAndResistanceBreakeValidationLength;
|
||||
}
|
||||
|
||||
//
|
||||
if (!has)
|
||||
{
|
||||
structure.fakeBreakedZone.Clean();
|
||||
}
|
||||
|
||||
//
|
||||
// Cleanup Resources ...
|
||||
breakerBar.Clean();
|
||||
}
|
||||
|
||||
//
|
||||
// Detect Recently Patterns ...
|
||||
if (config.recentlyPatternsMaxLookupLength > 0)
|
||||
{
|
||||
//
|
||||
if (!has)
|
||||
XOHCL iBar;
|
||||
XPivot iPivot;
|
||||
XBoxZone iBox;
|
||||
bool has = false;
|
||||
string iPrefix = NULL;
|
||||
int start = forBar.Index();
|
||||
ENUM_X_SORT_BY iSortBy = X_SORT_BY_DATE;
|
||||
ENUM_X_DIRECTION iDir = X_DIRECTION_NONE;
|
||||
ENUM_X_DIRECTION iSortDir = X_DIRECTION_BULLISH;
|
||||
int end = start + config.recentlyPatternsMaxLookupLength;
|
||||
|
||||
//
|
||||
// Order Blocks ...
|
||||
if (config.detectOB)
|
||||
{
|
||||
//
|
||||
structure.isPTest = false;
|
||||
structure.pTestedZone.Clean();
|
||||
Copy(
|
||||
obs,
|
||||
structure.obs //
|
||||
);
|
||||
Sort(
|
||||
structure.obs,
|
||||
iSortBy,
|
||||
iSortDir,
|
||||
config.recentlyPatternsMaxAllowedCollecting //
|
||||
);
|
||||
}
|
||||
pForBar.Clean();
|
||||
pSupport.Clean();
|
||||
breakerBar.Clean();
|
||||
pBreakerBar.Clean();
|
||||
pResistance.Clean();
|
||||
|
||||
//
|
||||
// Fair Value Gaps ...
|
||||
if (config.detectFVG)
|
||||
{
|
||||
//
|
||||
Copy(
|
||||
fvgs,
|
||||
structure.fvgs //
|
||||
);
|
||||
Sort(
|
||||
structure.fvgs,
|
||||
iSortBy,
|
||||
iSortDir,
|
||||
config.recentlyPatternsMaxAllowedCollecting //
|
||||
);
|
||||
}
|
||||
|
||||
//
|
||||
// Loop through Items ...
|
||||
for (int i = start; i < end; i++)
|
||||
{
|
||||
//
|
||||
iPivot.Clean();
|
||||
|
||||
//
|
||||
// Initialize Indexed Bar ...
|
||||
has = forBar.BarAt(i, iBar);
|
||||
if (!has)
|
||||
{
|
||||
//
|
||||
iBar.Clean();
|
||||
continue;
|
||||
}
|
||||
|
||||
//
|
||||
// Bars Detecting ...
|
||||
|
||||
//
|
||||
// Momentum Bars ...
|
||||
if (config.detectMomentum)
|
||||
{
|
||||
//
|
||||
iPrefix = "MomentumBar";
|
||||
has = IsMomentumBar(
|
||||
iBar,
|
||||
iDir,
|
||||
config.momentumBarRangeLength,
|
||||
config.momentumBarApprovedMultiplier //
|
||||
);
|
||||
has = has &&
|
||||
ToPivot(
|
||||
iBar,
|
||||
iPivot,
|
||||
iDir,
|
||||
iPrefix //
|
||||
);
|
||||
if (has)
|
||||
{
|
||||
//
|
||||
AddIfNotExists(
|
||||
iPivot,
|
||||
structure.momentumBars //
|
||||
);
|
||||
}
|
||||
iPivot.Clean();
|
||||
}
|
||||
|
||||
//
|
||||
// Engulfed Bars ...
|
||||
if (config.detectEngulfed)
|
||||
{
|
||||
//
|
||||
iPrefix = "EngulfedBar";
|
||||
has = IsEngulfedBar(
|
||||
iBar,
|
||||
iDir //
|
||||
);
|
||||
has = has &&
|
||||
ToPivot(
|
||||
iBar,
|
||||
iPivot,
|
||||
iDir,
|
||||
iPrefix //
|
||||
);
|
||||
if (has)
|
||||
{
|
||||
//
|
||||
AddIfNotExists(
|
||||
iPivot,
|
||||
structure.engulfBars //
|
||||
);
|
||||
}
|
||||
iPivot.Clean();
|
||||
}
|
||||
|
||||
//
|
||||
// TruGaped Bars ...
|
||||
if (config.detectTrueGaped)
|
||||
{
|
||||
//
|
||||
iPrefix = "TruGapedBar";
|
||||
has = IsTrueGapedBar(
|
||||
forBar,
|
||||
iDir,
|
||||
config.truwGapApprovedPointMultiplier //
|
||||
);
|
||||
has = has &&
|
||||
ToPivot(
|
||||
iBar,
|
||||
iPivot,
|
||||
iDir,
|
||||
iPrefix //
|
||||
);
|
||||
if (has)
|
||||
{
|
||||
//
|
||||
AddIfNotExists(
|
||||
iPivot,
|
||||
structure.trueGapBars //
|
||||
);
|
||||
}
|
||||
iPivot.Clean();
|
||||
}
|
||||
|
||||
//
|
||||
// Pin Bars ...
|
||||
if (config.detectTrueGaped)
|
||||
{
|
||||
//
|
||||
iPrefix = "PinBar";
|
||||
has = IsPinnedBar(
|
||||
forBar,
|
||||
iDir,
|
||||
config.pinnedBaarShadowApprovedMultiplier,
|
||||
config.pinnedBarMinimumPinBarRangeMultiplier,
|
||||
config.pinnedBarForceDirection //
|
||||
);
|
||||
has = has &&
|
||||
ToPivot(
|
||||
iBar,
|
||||
iPivot,
|
||||
iDir,
|
||||
iPrefix //
|
||||
);
|
||||
if (has)
|
||||
{
|
||||
//
|
||||
AddIfNotExists(
|
||||
iPivot,
|
||||
structure.pinBars //
|
||||
);
|
||||
}
|
||||
iPivot.Clean();
|
||||
}
|
||||
|
||||
//
|
||||
// Patterns Detecting ...
|
||||
|
||||
//
|
||||
// Star Pattern ...
|
||||
if (config.detectStarPattern)
|
||||
{
|
||||
//
|
||||
iPrefix = "Star";
|
||||
has = IsStartPattern(
|
||||
forBar,
|
||||
iDir //
|
||||
);
|
||||
has = has &&
|
||||
ToBox(
|
||||
forBar,
|
||||
iBox,
|
||||
iDir,
|
||||
iPrefix //
|
||||
);
|
||||
if (has)
|
||||
{
|
||||
//
|
||||
AddIfNotExists(
|
||||
iBox,
|
||||
structure.starPatterns //
|
||||
);
|
||||
}
|
||||
iBox.Clean();
|
||||
}
|
||||
|
||||
//
|
||||
// Piercing Pattern ...
|
||||
if (config.detectPiercingPattern)
|
||||
{
|
||||
//
|
||||
iPrefix = "Piercing";
|
||||
has = IsPiercingPattern(
|
||||
forBar,
|
||||
iDir //
|
||||
);
|
||||
has = has &&
|
||||
ToBox(
|
||||
forBar,
|
||||
iBox,
|
||||
iDir,
|
||||
iPrefix //
|
||||
);
|
||||
if (has)
|
||||
{
|
||||
//
|
||||
AddIfNotExists(
|
||||
iBox,
|
||||
structure.piercingPatterns //
|
||||
);
|
||||
}
|
||||
iBox.Clean();
|
||||
}
|
||||
|
||||
//
|
||||
// Rising Pattern ...
|
||||
if (config.detectRisingPattern)
|
||||
{
|
||||
//
|
||||
iPrefix = "Rising";
|
||||
has = IsRisingPattern(
|
||||
forBar,
|
||||
iDir //
|
||||
);
|
||||
has = has &&
|
||||
ToBox(
|
||||
forBar,
|
||||
iBox,
|
||||
iDir,
|
||||
iPrefix //
|
||||
);
|
||||
if (has)
|
||||
{
|
||||
//
|
||||
AddIfNotExists(
|
||||
iBox,
|
||||
structure.risingPatterns //
|
||||
);
|
||||
}
|
||||
iBox.Clean();
|
||||
}
|
||||
|
||||
//
|
||||
// Flag Pattern ...
|
||||
if (config.detectFlagPattern)
|
||||
{
|
||||
//
|
||||
iPrefix = "Flag";
|
||||
XOHCL swingBar;
|
||||
has = IsFlagPattern(
|
||||
forBar,
|
||||
iDir,
|
||||
swingBar,
|
||||
config.flagPatternMinimumPullbackBars //
|
||||
);
|
||||
has = has &&
|
||||
ToBox(
|
||||
forBar,
|
||||
iBox,
|
||||
iDir,
|
||||
iPrefix //
|
||||
);
|
||||
if (has)
|
||||
{
|
||||
//
|
||||
AddIfNotExists(
|
||||
iBox,
|
||||
structure.flagPatterns //
|
||||
);
|
||||
}
|
||||
iBox.Clean();
|
||||
}
|
||||
|
||||
//
|
||||
// SignalKey Bar Pattern ...
|
||||
if (config.detectSignalKeyBarPattern)
|
||||
{
|
||||
//
|
||||
iPrefix = "SignalKeyBar";
|
||||
has = IsSignalKeyBarPattern(
|
||||
forBar,
|
||||
iDir,
|
||||
config.signalKeyBarShadowApprovedMultiplier,
|
||||
config.signalKeyBarMinimumPinBarRangeMultiplier,
|
||||
config.signalKeyBarForceDirection //
|
||||
);
|
||||
has = has &&
|
||||
ToBox(
|
||||
forBar,
|
||||
iBox,
|
||||
iDir,
|
||||
iPrefix //
|
||||
);
|
||||
if (has)
|
||||
{
|
||||
//
|
||||
AddIfNotExists(
|
||||
iBox,
|
||||
structure.signalKeyBarPatterns //
|
||||
);
|
||||
}
|
||||
iBox.Clean();
|
||||
}
|
||||
|
||||
//
|
||||
iBar.Clean();
|
||||
}
|
||||
|
||||
//
|
||||
// Cleanup Resources ...
|
||||
iBar.Clean();
|
||||
iBox.Clean();
|
||||
iPivot.Clean();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -32,6 +32,22 @@ class XCXFIMAPOIDrawer : public XCPOIDrawer
|
||||
//
|
||||
public:
|
||||
//
|
||||
// Props ...
|
||||
|
||||
//
|
||||
// Tested Zones ...
|
||||
color testedBullishColor;
|
||||
color testedBearishColor;
|
||||
|
||||
//
|
||||
// Breaked Zones ...
|
||||
color breakedBullishColor;
|
||||
color breakedBearishColor;
|
||||
|
||||
//
|
||||
// FakeBreaked Zones ...
|
||||
color fakeBreakedBullishColor;
|
||||
color fakeBreakedBearishColor;
|
||||
|
||||
//
|
||||
// Constructor ...
|
||||
@@ -75,6 +91,16 @@ class XCXFIMAPOIDrawer : public XCPOIDrawer
|
||||
//
|
||||
boxBullishStyle = defaultBullishStyle;
|
||||
boxBearishStyle = defaultBearishStyle;
|
||||
|
||||
//
|
||||
testedBullishColor = clrLime;
|
||||
breakedBullishColor = clrGreen;
|
||||
fakeBreakedBullishColor = clrYellow;
|
||||
|
||||
//
|
||||
testedBearishColor = clrRed;
|
||||
breakedBearishColor = clrDarkRed;
|
||||
fakeBreakedBearishColor = clrDarkOrange;
|
||||
}
|
||||
|
||||
//
|
||||
@@ -161,6 +187,135 @@ class XCXFIMAPOIDrawer : public XCPOIDrawer
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Tested Zone Style ...
|
||||
*
|
||||
* @param style: reference to hold result ...
|
||||
* @param zone: Specified Zone ...
|
||||
*
|
||||
* @return ( bool )
|
||||
*/
|
||||
bool GetTestedStyle(
|
||||
XPOIStyle &style,
|
||||
XBoxZone &zone //
|
||||
)
|
||||
{
|
||||
//
|
||||
bool result = false;
|
||||
|
||||
//
|
||||
style.Clean();
|
||||
|
||||
//
|
||||
result = zone.IsValid();
|
||||
if (!result)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
GetBoxStyle(
|
||||
style,
|
||||
zone.dir //
|
||||
);
|
||||
|
||||
//
|
||||
style.width = 3;
|
||||
style.clr =
|
||||
zone.IsBullish()
|
||||
? testedBullishColor
|
||||
: testedBearishColor;
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Breaked Zone Style ...
|
||||
*
|
||||
* @param style: reference to hold result ...
|
||||
* @param zone: Specified Zone ...
|
||||
*
|
||||
* @return ( bool )
|
||||
*/
|
||||
bool GetBreakedStyle(
|
||||
XPOIStyle &style,
|
||||
XBoxZone &zone //
|
||||
)
|
||||
{
|
||||
//
|
||||
bool result = false;
|
||||
|
||||
//
|
||||
style.Clean();
|
||||
|
||||
//
|
||||
result = zone.IsValid();
|
||||
if (!result)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
GetBoxStyle(
|
||||
style,
|
||||
zone.dir //
|
||||
);
|
||||
|
||||
//
|
||||
style.width = 3;
|
||||
style.clr =
|
||||
zone.IsBullish()
|
||||
? breakedBullishColor
|
||||
: breakedBearishColor;
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Fake Breaked Zone Style ...
|
||||
*
|
||||
* @param style: reference to hold result ...
|
||||
* @param zone: Specified Zone ...
|
||||
*
|
||||
* @return ( bool )
|
||||
*/
|
||||
bool GetFakeBreakedStyle(
|
||||
XPOIStyle &style,
|
||||
XBoxZone &zone //
|
||||
)
|
||||
{
|
||||
//
|
||||
bool result = false;
|
||||
|
||||
//
|
||||
style.Clean();
|
||||
|
||||
//
|
||||
result = zone.IsValid();
|
||||
if (!result)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
GetBoxStyle(
|
||||
style,
|
||||
zone.dir //
|
||||
);
|
||||
|
||||
//
|
||||
style.width = 3;
|
||||
style.clr =
|
||||
zone.IsBullish()
|
||||
? fakeBreakedBullishColor
|
||||
: fakeBreakedBearishColor;
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Fill Arrow Based Drawing Specs ...
|
||||
*
|
||||
@@ -199,6 +354,102 @@ class XCXFIMAPOIDrawer : public XCPOIDrawer
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Apply Tested Style ...
|
||||
*
|
||||
* @param object: reference pointer to Object ...
|
||||
* @param zone: reference to Zone ...
|
||||
*/
|
||||
void ApplyTestedStyle(
|
||||
XCBoxObject *&object,
|
||||
XBoxZone &zone //
|
||||
)
|
||||
{
|
||||
//
|
||||
if (!zone.IsValid() ||
|
||||
object == NULL)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
//
|
||||
XPOIStyle style;
|
||||
if (!GetTestedStyle(style, zone))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
//
|
||||
ApplyBoxStyle(
|
||||
object,
|
||||
style //
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Apply Breaked Style ...
|
||||
*
|
||||
* @param object: reference pointer to Object ...
|
||||
* @param zone: reference to Zone ...
|
||||
*/
|
||||
void ApplyBreakedStyle(
|
||||
XCBoxObject *&object,
|
||||
XBoxZone &zone //
|
||||
)
|
||||
{
|
||||
//
|
||||
if (!zone.IsValid() ||
|
||||
object == NULL)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
//
|
||||
XPOIStyle style;
|
||||
if (!GetBreakedStyle(style, zone))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
//
|
||||
ApplyBoxStyle(
|
||||
object,
|
||||
style //
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Apply Tested Style ...
|
||||
*
|
||||
* @param object: reference pointer to Object ...
|
||||
* @param zone: reference to Zone ...
|
||||
*/
|
||||
void ApplyFakeBreakStyle(
|
||||
XCBoxObject *&object,
|
||||
XBoxZone &zone //
|
||||
)
|
||||
{
|
||||
//
|
||||
if (!zone.IsValid() ||
|
||||
object == NULL)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
//
|
||||
XPOIStyle style;
|
||||
if (!GetFakeBreakedStyle(style, zone))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
//
|
||||
ApplyBoxStyle(
|
||||
object,
|
||||
style //
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Draw Specified Market Structure Based on Given Configs ...
|
||||
*
|
||||
@@ -229,6 +480,7 @@ class XCXFIMAPOIDrawer : public XCPOIDrawer
|
||||
objects.Clear();
|
||||
|
||||
//
|
||||
int count = 0;
|
||||
bool has = false;
|
||||
int arrowCode = -1;
|
||||
int arrowWidth = 3;
|
||||
@@ -729,6 +981,8 @@ class XCXFIMAPOIDrawer : public XCPOIDrawer
|
||||
has = DrawPivotAnalysis(
|
||||
structure.pvAnalysis,
|
||||
iObj,
|
||||
config.drawFIMAPVPivotsAnalysisTrends,
|
||||
config.drawFIMAPVPivotsAnalysisZones,
|
||||
config.drawFIMAPVPivotsAnalysisPivots,
|
||||
bearArrowCode,
|
||||
bullArrowCode //
|
||||
@@ -754,6 +1008,8 @@ class XCXFIMAPOIDrawer : public XCPOIDrawer
|
||||
has = DrawPivotAnalysis(
|
||||
structure.pvAnalysis,
|
||||
iObj,
|
||||
config.drawFIMAMAPivotsAnalysisTrends,
|
||||
config.drawFIMAMAPivotsAnalysisZones,
|
||||
config.drawFIMAMAPivotsAnalysisPivots,
|
||||
bearArrowCode,
|
||||
bullArrowCode //
|
||||
@@ -779,6 +1035,8 @@ class XCXFIMAPOIDrawer : public XCPOIDrawer
|
||||
has = DrawPivotAnalysis(
|
||||
structure.pvAnalysis,
|
||||
iObj,
|
||||
config.drawFIMASARPivotsAnalysisTrends,
|
||||
config.drawFIMASARPivotsAnalysisZones,
|
||||
config.drawFIMASARPivotsAnalysisPivots,
|
||||
bearArrowCode,
|
||||
bullArrowCode //
|
||||
@@ -804,6 +1062,8 @@ class XCXFIMAPOIDrawer : public XCPOIDrawer
|
||||
has = DrawPivotAnalysis(
|
||||
structure.pvAnalysis,
|
||||
iObj,
|
||||
config.drawFIMAZigZagPivotsAnalysisTrends,
|
||||
config.drawFIMAZigZagPivotsAnalysisZones,
|
||||
config.drawFIMAZigZagPivotsAnalysisPivots,
|
||||
bearArrowCode,
|
||||
bullArrowCode //
|
||||
@@ -815,6 +1075,186 @@ class XCXFIMAPOIDrawer : public XCPOIDrawer
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// Fake Breaked Zone ...
|
||||
if (config.drawFakeBreakedZone &&
|
||||
structure.fakeBreakedZone.IsValid())
|
||||
{
|
||||
//
|
||||
XCBoxObject *iObj;
|
||||
has = DrawBox(
|
||||
structure.fakeBreakedZone,
|
||||
iObj //
|
||||
);
|
||||
if (has)
|
||||
{
|
||||
//
|
||||
// Apply Style ...
|
||||
ApplyFakeBreakStyle(
|
||||
iObj,
|
||||
structure.fakeBreakedZone //
|
||||
);
|
||||
|
||||
//
|
||||
objects.Add(iObj);
|
||||
}
|
||||
|
||||
//
|
||||
ZeroMemory(iObj);
|
||||
}
|
||||
|
||||
//
|
||||
// Recently Tested Zones ...
|
||||
if (config.drawRecentlyTestedZones &&
|
||||
HasChild(structure.recentlyTestedZones))
|
||||
{
|
||||
//
|
||||
XCBoxObject *iObj;
|
||||
count = ArraySize(structure.recentlyTestedZones);
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
//
|
||||
// Draw Box ...
|
||||
has = DrawBox(
|
||||
structure.recentlyTestedZones[i],
|
||||
iObj //
|
||||
);
|
||||
if (has)
|
||||
{
|
||||
//
|
||||
ApplyTestedStyle(
|
||||
iObj,
|
||||
structure.recentlyTestedZones[i] //
|
||||
);
|
||||
|
||||
//
|
||||
objects.Add(iObj);
|
||||
}
|
||||
|
||||
//
|
||||
ZeroMemory(iObj);
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// Recently Breaked Zones ...
|
||||
if (config.drawRecentlyBreakedZones &&
|
||||
HasChild(structure.recentlyBreakedZones))
|
||||
{
|
||||
//
|
||||
XCBoxObject *iObj;
|
||||
count = ArraySize(structure.recentlyBreakedZones);
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
//
|
||||
// Draw Box ...
|
||||
has = DrawBox(
|
||||
structure.recentlyBreakedZones[i],
|
||||
iObj //
|
||||
);
|
||||
if (has)
|
||||
{
|
||||
//
|
||||
ApplyBreakedStyle(
|
||||
iObj,
|
||||
structure.recentlyBreakedZones[i] //
|
||||
);
|
||||
|
||||
//
|
||||
objects.Add(iObj);
|
||||
}
|
||||
|
||||
//
|
||||
ZeroMemory(iObj);
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// Draw Recent Patterns ...
|
||||
if (config.drawRecentPatterns)
|
||||
{
|
||||
//
|
||||
// Pin Bars ...
|
||||
if (config.drawPinned &&
|
||||
HasChild(structure.pinBars))
|
||||
{
|
||||
//
|
||||
// TODO: Complete this ...
|
||||
}
|
||||
|
||||
//
|
||||
// Engulf Bars ...
|
||||
if (config.drawEngulfed &&
|
||||
HasChild(structure.engulfBars))
|
||||
{
|
||||
//
|
||||
// TODO: Complete this ...
|
||||
}
|
||||
|
||||
//
|
||||
// TrueGap Bars ...
|
||||
if (config.drawTrueGaped &&
|
||||
HasChild(structure.trueGapBars))
|
||||
{
|
||||
//
|
||||
// TODO: Complete this ...
|
||||
}
|
||||
|
||||
//
|
||||
// TrueGap Bars ...
|
||||
if (config.drawMomentum &&
|
||||
HasChild(structure.momentumBars))
|
||||
{
|
||||
//
|
||||
// TODO: Complete this ...
|
||||
}
|
||||
|
||||
//
|
||||
// Flag Pattern ...
|
||||
if (config.drawFlagPattern &&
|
||||
HasChild(structure.flagPatterns))
|
||||
{
|
||||
//
|
||||
// TODO: Complete this ...
|
||||
}
|
||||
|
||||
//
|
||||
// Star Pattern ...
|
||||
if (config.drawStarPattern &&
|
||||
HasChild(structure.starPatterns))
|
||||
{
|
||||
//
|
||||
// TODO: Complete this ...
|
||||
}
|
||||
|
||||
//
|
||||
// Rising Pattern ...
|
||||
if (config.drawRisingPattern &&
|
||||
HasChild(structure.risingPatterns))
|
||||
{
|
||||
//
|
||||
// TODO: Complete this ...
|
||||
}
|
||||
|
||||
//
|
||||
// Piercing Pattern ...
|
||||
if (config.drawPiercingPattern &&
|
||||
HasChild(structure.piercingPatterns))
|
||||
{
|
||||
//
|
||||
// TODO: Complete this ...
|
||||
}
|
||||
|
||||
//
|
||||
// SignalKeyBar Pattern ...
|
||||
if (config.drawSignalKeyBarPattern &&
|
||||
HasChild(structure.signalKeyBarPatterns))
|
||||
{
|
||||
//
|
||||
// TODO: Complete this ...
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
result = objects.Total();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user