Cleanup Trigger Block Detection from xcaea detector and Drawer for Managing it's Differences ...

This commit is contained in:
2025-05-18 08:53:04 +03:30
parent ccbb9e0105
commit 29527083b4
6 changed files with 5290 additions and 1045 deletions
-216
View File
@@ -94,8 +94,6 @@ class XCXCAEAPOIDrawer : public XCBase
bool drawFVGBearishPivots;
bool drawTrendBullishPivots;
bool drawTrendBearishPivots;
bool drawTriggerBlockBullishPivots;
bool drawTriggerBlockBearishPivots;
//
// Styling ...
@@ -124,10 +122,6 @@ class XCXCAEAPOIDrawer : public XCBase
XCAPivotStyle trendBullishPivotStyle;
XCAPivotStyle trendBearishPivotStyle;
//
XCAPivotStyle triggerBlockBullishPivotStyle;
XCAPivotStyle triggerBlockBearishPivotStyle;
//
// Constructors ...
XCXCAEAPOIDrawer(
@@ -175,8 +169,6 @@ class XCXCAEAPOIDrawer : public XCBase
drawFVGBearishPivots = false;
drawTrendBullishPivots = false;
drawTrendBearishPivots = false;
drawTriggerBlockBullishPivots = false;
drawTriggerBlockBearishPivots = false;
//
// Styling ...
@@ -220,11 +212,6 @@ class XCXCAEAPOIDrawer : public XCBase
// TREND ...
trendBullishPivotStyle = defaultBullishStyle;
trendBearishPivotStyle = defaultBearishStyle;
//
// TRIGGER ...
triggerBlockBullishPivotStyle = defaultBullishStyle;
triggerBlockBearishPivotStyle = defaultBearishStyle;
}
//
@@ -254,11 +241,6 @@ class XCXCAEAPOIDrawer : public XCBase
// TREND ...
DrawTrendBullishPivots(to);
DrawTrendBearishPivots(to);
//
// TRIGGER ...
DrawTriggerBullishPivots(to);
DrawTriggerBearishPivots(to);
}
//
@@ -403,24 +385,6 @@ class XCXCAEAPOIDrawer : public XCBase
to //
);
break;
//
case XCA_TRIGGER_BULL:
//
DrawTriggerBlockBullishPivot(
box,
to //
);
break;
//
case XCA_TRIGGER_BEAR:
//
DrawTriggerBlockBearishPivot(
box,
to //
);
break;
}
}
//
@@ -926,76 +890,6 @@ class XCXCAEAPOIDrawer : public XCBase
}
}
//
void DrawTriggerBullishPivots(datetime to = NULL)
{
//
bool has = drawTriggerBlockBullishPivots;
if (!has)
{
return;
}
//
has = detector.HasTriggerBlockBullishPivots();
if (!has)
{
return;
}
//
int count = detector.CountTriggerBlockBullishPivots();
for (int i = 0; i < count; i++)
{
//
XBoxZone iBox = detector.triggerBlockBullishPivots[i];
//
DrawTriggerBlockBullishPivot(
iBox,
to //
);
//
iBox.Clean();
}
}
//
void DrawTriggerBearishPivots(datetime to = NULL)
{
//
bool has = drawTriggerBlockBearishPivots;
if (!has)
{
return;
}
//
has = detector.HasTriggerBlockBearishPivots();
if (!has)
{
return;
}
//
int count = detector.CountTriggerBlockBearishPivots();
for (int i = 0; i < count; i++)
{
//
XBoxZone iBox = detector.triggerBlockBearishPivots[i];
//
DrawTriggerBlockBearishPivot(
iBox,
to //
);
//
iBox.Clean();
}
}
//
// One Item Drawers ...
@@ -1529,116 +1423,6 @@ class XCXCAEAPOIDrawer : public XCBase
ZeroMemory(iObj);
}
//
void DrawTriggerBlockBullishPivot(
XBoxZone &item,
datetime to = NULL //
)
{
//
bool has = drawTriggerBlockBullishPivots;
if (!has)
{
return;
}
//
has = item.IsValid() &&
item.type == GetBoxType(XCA_TRIGGER_BULL) &&
item.dir == GetDirection(XCA_TRIGGER_BULL);
if (!has)
{
return;
}
//
// Since Trigger Blocks only Used Once ...
to = NULL;
bool canUpdateTo = IsValid(to);
if (canUpdateTo)
{
item.to = to;
}
//
XCBoxObject *iObj;
has = drawer.DrawBox(
item,
iObj //
);
if (has)
{
//
// Style Object ...
ApplyPivotStyle(
iObj,
triggerBlockBullishPivotStyle //
);
//
// Store Object ...
mTriggerBlockBullishPivotObjects.Add(iObj);
}
//
ZeroMemory(iObj);
}
//
void DrawTriggerBlockBearishPivot(
XBoxZone &item,
datetime to = NULL //
)
{
//
bool has = drawTriggerBlockBearishPivots;
if (!has)
{
return;
}
//
has = item.IsValid() &&
item.type == GetBoxType(XCA_TRIGGER_BEAR) &&
item.dir == GetDirection(XCA_TRIGGER_BEAR);
if (!has)
{
return;
}
//
// Since Trigger Blocks only Used Once ...
to = NULL;
bool canUpdateTo = IsValid(to);
if (canUpdateTo)
{
item.to = to;
}
//
XCBoxObject *iObj;
has = drawer.DrawBox(
item,
iObj //
);
if (has)
{
//
// Style Object ...
ApplyPivotStyle(
iObj,
triggerBlockBearishPivotStyle //
);
//
// Store Object ...
mTriggerBlockBearishPivotObjects.Add(iObj);
}
//
ZeroMemory(iObj);
}
//
// Protected ...
protected: