last ...
This commit is contained in:
@@ -2902,6 +2902,11 @@ class XCPOIDrawer : public XCBase
|
||||
long chartID = ChartIdentification();
|
||||
int window = SubWindowIdentification();
|
||||
|
||||
//
|
||||
color czColor = IsBullish(zone.breakDir)
|
||||
? BarBullishColor()
|
||||
: BarBearishColor();
|
||||
|
||||
//
|
||||
object = new XCConsolidationZoneObject();
|
||||
result = object.Create(
|
||||
@@ -2911,6 +2916,12 @@ class XCPOIDrawer : public XCBase
|
||||
prefix //
|
||||
);
|
||||
|
||||
//
|
||||
if (result)
|
||||
{
|
||||
object.ZoneColor(czColor);
|
||||
}
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -68,8 +68,9 @@ enum ENUM_XPOIS
|
||||
X_POI_BEARISH_ORDERBLOCK, // Bearish Order Block ...
|
||||
//
|
||||
// Fair Value Gaps ...
|
||||
X_POI_BULLISH_FVG, // Bullish Order Block ...
|
||||
X_POI_BEARISH_FVG, // Bearish Order Block ...
|
||||
X_POI_BULLISH_FVG, // Bullish Order Block ...
|
||||
X_POI_BEARISH_FVG, // Bearish Order Block ...
|
||||
X_POI_CONSOLIDATION_ZONE, // Consolidation Zone ...
|
||||
};
|
||||
|
||||
//
|
||||
@@ -5557,8 +5558,8 @@ struct XConsolidationZone
|
||||
int loopback; // Loopback ...
|
||||
|
||||
//
|
||||
ENUM_X_DIRECTION breakDirection; // Break Direction ...
|
||||
XOHCL breakerBar; // Breaker Bar ...
|
||||
ENUM_X_DIRECTION breakDir; // Break Direction ...
|
||||
XOHCL breakerBar; // Breaker Bar ...
|
||||
|
||||
//
|
||||
// Constructor ...
|
||||
@@ -5712,11 +5713,11 @@ struct XConsolidationZone
|
||||
//
|
||||
// Calculate Break Direction ...
|
||||
breakerBar = cBar;
|
||||
breakDirection = isBreakTop
|
||||
? X_DIRECTION_BULLISH
|
||||
: isBreakBottom
|
||||
? X_DIRECTION_BEARISH
|
||||
: X_DIRECTION_NONE;
|
||||
breakDir = isBreakTop
|
||||
? X_DIRECTION_BULLISH
|
||||
: isBreakBottom
|
||||
? X_DIRECTION_BEARISH
|
||||
: X_DIRECTION_NONE;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -5732,7 +5733,7 @@ struct XConsolidationZone
|
||||
period = NULL;
|
||||
initTime = NULL;
|
||||
breakerBar.Clean();
|
||||
breakDirection = X_DIRECTION_NONE;
|
||||
breakDir = X_DIRECTION_NONE;
|
||||
|
||||
//
|
||||
ZeroMemory(this);
|
||||
@@ -5775,7 +5776,7 @@ struct XConsolidationZone
|
||||
|
||||
//
|
||||
result = breakerBar.IsValid() &&
|
||||
HasDirection(breakDirection);
|
||||
HasDirection(breakDir);
|
||||
|
||||
//
|
||||
return result;
|
||||
@@ -5795,7 +5796,7 @@ struct XConsolidationZone
|
||||
|
||||
//
|
||||
result = IsBreaked() &&
|
||||
breakDirection == X_DIRECTION_BEARISH;
|
||||
breakDir == X_DIRECTION_BEARISH;
|
||||
if (!result)
|
||||
{
|
||||
return result;
|
||||
@@ -5854,7 +5855,7 @@ struct XConsolidationZone
|
||||
|
||||
//
|
||||
result = IsBreaked() &&
|
||||
breakDirection == X_DIRECTION_BULLISH;
|
||||
breakDir == X_DIRECTION_BULLISH;
|
||||
if (!result)
|
||||
{
|
||||
return result;
|
||||
@@ -8665,12 +8666,12 @@ int FilterZones(
|
||||
bool isPricePassed =
|
||||
//
|
||||
isInside =
|
||||
ignoreOutOfBox
|
||||
? isInside
|
||||
: isInside &&
|
||||
(isIBullish
|
||||
? isAbove
|
||||
: isBelow)
|
||||
ignoreOutOfBox
|
||||
? isInside
|
||||
: isInside &&
|
||||
(isIBullish
|
||||
? isAbove
|
||||
: isBelow)
|
||||
//
|
||||
;
|
||||
if (!isPricePassed)
|
||||
|
||||
@@ -430,6 +430,95 @@ class XC121SMCCycleHelper : public XCBase
|
||||
//
|
||||
// Consolidation Zones Implement here ...
|
||||
|
||||
//
|
||||
int czLoopback = 5;
|
||||
int maxAllowed = 20;
|
||||
bool isActiveConsolidationZoneBreaked = false;
|
||||
bool hasActiveConsolidationZone = mActiveConsolidationZone.IsValid();
|
||||
if (hasActiveConsolidationZone)
|
||||
{
|
||||
//
|
||||
isActiveConsolidationZoneBreaked = mActiveConsolidationZone.IsBreaked();
|
||||
|
||||
//
|
||||
if (isActiveConsolidationZoneBreaked)
|
||||
{
|
||||
//
|
||||
AddRef(
|
||||
mActiveConsolidationZone,
|
||||
mConsolidationZones //
|
||||
);
|
||||
|
||||
//
|
||||
Add(
|
||||
CONSOLIDATION_BREAKED_DETECTED,
|
||||
events //
|
||||
);
|
||||
|
||||
//
|
||||
CleanupArray(
|
||||
mConsolidationZones,
|
||||
maxAllowed //
|
||||
);
|
||||
|
||||
// //
|
||||
// XCConsolidationZoneObject *czObj;
|
||||
// bool isCreated = mPOIDrawer.CreateConsolidationZone(
|
||||
// mActiveConsolidationZone,
|
||||
// czObj //
|
||||
// );
|
||||
// if (isCreated)
|
||||
// {
|
||||
// mConsolidationObjects.Add(czObj);
|
||||
// }
|
||||
|
||||
//
|
||||
mActiveConsolidationZone.Clean();
|
||||
}
|
||||
else
|
||||
{
|
||||
mActiveConsolidationZone.Update();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
//
|
||||
XOHCL mBar;
|
||||
bool hasBar = GetBar(
|
||||
mBar,
|
||||
0 //
|
||||
);
|
||||
if (hasBar)
|
||||
{
|
||||
//
|
||||
double upper = 0;
|
||||
double lower = 0;
|
||||
bool hasConsolidationZone =
|
||||
mBarAnalyser.IsConsolidate(
|
||||
mBar,
|
||||
upper,
|
||||
lower,
|
||||
czLoopback //
|
||||
);
|
||||
|
||||
//
|
||||
if (hasConsolidationZone)
|
||||
{
|
||||
//
|
||||
mActiveConsolidationZone.Init(
|
||||
GetSymbol(),
|
||||
GetPeriod(),
|
||||
upper,
|
||||
lower,
|
||||
loopback //
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
mBar.Clean();
|
||||
}
|
||||
|
||||
//
|
||||
result = conditions.IsValid();
|
||||
|
||||
@@ -461,6 +550,11 @@ class XC121SMCCycleHelper : public XCBase
|
||||
string mSymbol;
|
||||
ENUM_TIMEFRAMES mPeriod;
|
||||
|
||||
//
|
||||
CArrayObj mConsolidationObjects;
|
||||
XConsolidationZone mActiveConsolidationZone;
|
||||
XConsolidationZone mConsolidationZones[];
|
||||
|
||||
//
|
||||
// Actions ...
|
||||
|
||||
@@ -478,6 +572,10 @@ class XC121SMCCycleHelper : public XCBase
|
||||
delete mX121Helper;
|
||||
delete mPOIDetector;
|
||||
delete mBarAnalyser;
|
||||
|
||||
//
|
||||
Clean(mConsolidationZones);
|
||||
mActiveConsolidationZone.Clean();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -400,10 +400,10 @@ bool DetectX121SMCGuards(
|
||||
isConsolidationZoneBreaked = x121SMCConsolidationZone.IsBreaked();
|
||||
isConsolidationZoneBreakedUp =
|
||||
isConsolidationZoneBreaked &&
|
||||
IsBullish(x121SMCConsolidationZone.breakDirection);
|
||||
IsBullish(x121SMCConsolidationZone.breakDir);
|
||||
isConsolidationZoneBreakedDown =
|
||||
isConsolidationZoneBreaked &&
|
||||
IsBearish(x121SMCConsolidationZone.breakDirection);
|
||||
IsBearish(x121SMCConsolidationZone.breakDir);
|
||||
|
||||
//
|
||||
// consolidationZoneUpper = triggerXConditions.peaksBuffer[1];
|
||||
|
||||
Reference in New Issue
Block a user