This commit is contained in:
2025-05-12 03:24:29 +03:30
parent 1623925eb0
commit 1910c42462
6 changed files with 1927 additions and 341 deletions
File diff suppressed because it is too large Load Diff
+589 -50
View File
@@ -84,8 +84,12 @@ class XCXCAEAPOIDrawer : public XCBase
//
// Drawers ...
bool drawSWHPivots;
bool drawSWLPivots;
bool drawPeakPivots;
bool drawValePivots;
bool drawOBBullishPivots;
bool drawOBBearishPivots;
bool drawFVGBullishPivots;
bool drawFVGBearishPivots;
bool drawTrendBullishPivots;
@@ -98,10 +102,18 @@ class XCXCAEAPOIDrawer : public XCBase
XCAPivotStyle defaultBullishStyle;
XCAPivotStyle defaultBearishStyle;
//
XCAPivotStyle swhPivotStyle;
XCAPivotStyle swlPivotStyle;
//
XCAPivotStyle peakPivotStyle;
XCAPivotStyle valePivotStyle;
//
XCAPivotStyle obBullishPivotStyle;
XCAPivotStyle obBearishPivotStyle;
//
XCAPivotStyle fvgBullishPivotStyle;
XCAPivotStyle fvgBearishPivotStyle;
@@ -147,8 +159,12 @@ class XCXCAEAPOIDrawer : public XCBase
{
//
// Drawing ...
drawSWHPivots = false;
drawSWLPivots = false;
drawPeakPivots = false;
drawValePivots = false;
drawOBBullishPivots = false;
drawOBBearishPivots = false;
drawFVGBullishPivots = false;
drawFVGBearishPivots = false;
drawTrendBullishPivots = false;
@@ -172,11 +188,21 @@ class XCXCAEAPOIDrawer : public XCBase
//
// Pivots ...
//
// SWING ...
swhPivotStyle = defaultBearishStyle;
swlPivotStyle = defaultBullishStyle;
//
// PV ...
peakPivotStyle = defaultBearishStyle;
valePivotStyle = defaultBullishStyle;
//
// OB ...
obBullishPivotStyle = defaultBullishStyle;
obBearishPivotStyle = defaultBearishStyle;
//
// FVG ...
fvgBullishPivotStyle = defaultBullishStyle;
@@ -191,11 +217,21 @@ class XCXCAEAPOIDrawer : public XCBase
//
void Draw(datetime to = NULL)
{
//
// SWING ...
DrawSWHPivots(to);
DrawSWLPivots(to);
//
// PV ...
DrawPeakPivots(to);
DrawValePivots(to);
//
// OB ...
DrawOBBullishPivots(to);
DrawOBBearishPivots(to);
//
// FVG ...
DrawFVGBullishPivots(to);
@@ -210,7 +246,9 @@ class XCXCAEAPOIDrawer : public XCBase
//
void DrawBox(
XBoxZone &box,
datetime to = NULL //
datetime to = NULL,
bool drawMiddle = false,
bool ignoreType = false //
)
{
//
@@ -219,78 +257,205 @@ class XCXCAEAPOIDrawer : public XCBase
{
return;
}
//
// Detect Pivot Type ...
ENUM_XCA_PIVOTS iType = GetPivotType(box);
has = IsValid(iType);
if (!has)
bool canUpdateTo = IsValid(to);
if (canUpdateTo)
{
return;
box.to = to;
}
//
switch (iType)
// Draw Box as POI ...
if (!ignoreType)
{
//
case XCA_PEAK:
//
DrawPeakPivot(
box,
to //
);
break;
// Detect Pivot Type ...
ENUM_XCA_PIVOTS iType = GetPivotType(box);
has = IsValid(iType);
if (!has)
{
return;
}
//
case XCA_VALE:
switch (iType)
{
//
DrawValePivot(
box,
to //
);
break;
case XCA_SWH:
//
DrawSWHPivot(
box,
to //
);
break;
//
case XCA_FVG_BULL:
//
DrawFVGBullishPivot(
box,
to //
);
break;
//
case XCA_SWL:
//
DrawSWLPivot(
box,
to //
);
break;
//
case XCA_FVG_BEAR:
//
DrawFVGBearishPivot(
box,
to //
);
break;
case XCA_PEAK:
//
DrawPeakPivot(
box,
to //
);
break;
//
case XCA_TREND_BULL:
//
DrawTrendBullishPivot(
box,
to //
);
break;
//
case XCA_VALE:
//
DrawValePivot(
box,
to //
);
break;
//
case XCA_TREND_BEAR:
//
DrawTrendBearishPivot(
case XCA_OB_BULL:
//
DrawOBBullishPivot(
box,
to //
);
break;
//
case XCA_OB_BEAR:
//
DrawOBBearishPivot(
box,
to //
);
break;
//
case XCA_FVG_BULL:
//
DrawFVGBullishPivot(
box,
to //
);
break;
//
case XCA_FVG_BEAR:
//
DrawFVGBearishPivot(
box,
to //
);
break;
//
case XCA_TREND_BULL:
//
DrawTrendBullishPivot(
box,
to //
);
break;
//
case XCA_TREND_BEAR:
//
DrawTrendBearishPivot(
box,
to //
);
break;
}
}
//
// Draw Regular Box ...
else
{
//
// Select Styling Config ...
XCAPivotStyle style;
//
if (box.IsBullish())
{
style = defaultBullishStyle;
}
else
{
style = defaultBearishStyle;
}
//
// Draw Box itself ...
XCBoxObject *iBoxObj;
has = drawer.DrawBox(
box,
to //
iBoxObj //
);
break;
if (has)
{
//
// Style Object ...
ApplyPivotStyle(
iBoxObj,
style //
);
//
// Store Object ...
mObjects.Add(iBoxObj);
}
//
// Draw Box Middle Range ...
if (drawMiddle)
{
//
double middle = box.GetMid();
string middleName = box.GetMiddleTag();
//
CChartObjectTrend *iMidObj;
iMidObj = new CChartObjectTrend();
has = iMidObj.Create(
drawer.ChartIdentification(),
middleName,
drawer.SubWindowIdentification(),
box.from,
middle,
box.to,
middle //
);
if (has)
{
//
// Styling Object ...
iMidObj.Color(style.clr);
iMidObj.Width(style.width);
iMidObj.Style(style.style);
//
// Store Object ...
mObjects.Add(iMidObj);
}
}
//
style.Clean();
}
}
//
void DrawBoxes(
XBoxZone &boxes[],
datetime to = NULL //
datetime to = NULL,
bool drawMiddle = false,
bool ignoreType = false //
)
{
//
@@ -311,7 +476,9 @@ class XCXCAEAPOIDrawer : public XCBase
// Detect Pivot Type ...
DrawBox(
iBox,
to //
to,
drawMiddle,
ignoreType //
);
//
@@ -329,8 +496,12 @@ class XCXCAEAPOIDrawer : public XCBase
//
// Cleanup Styles ...
swhPivotStyle.Clean();
swlPivotStyle.Clean();
peakPivotStyle.Clean();
valePivotStyle.Clean();
obBullishPivotStyle.Clean();
obBearishPivotStyle.Clean();
fvgBullishPivotStyle.Clean();
fvgBearishPivotStyle.Clean();
trendBullishPivotStyle.Clean();
@@ -338,8 +509,13 @@ class XCXCAEAPOIDrawer : public XCBase
//
// Cleanup Pivot Objects Holder ...
mObjects.Clear();
mSWHPivotObjects.Clear();
mSWLPivotObjects.Clear();
mPeakPivotObjects.Clear();
mValePivotObjects.Clear();
mOBBullishPivotObjects.Clear();
mOBBearishPivotObjects.Clear();
mFVGBullishPivotObjects.Clear();
mFVGBearishPivotObjects.Clear();
mTrendBullishPivotObjects.Clear();
@@ -349,6 +525,76 @@ class XCXCAEAPOIDrawer : public XCBase
//
// Collection Drawers ...
//
void DrawSWHPivots(datetime to = NULL)
{
//
bool has = drawSWHPivots;
if (!has)
{
return;
}
//
has = detector.HasSWHPivots();
if (!has)
{
return;
}
//
int count = detector.CountSWHPivots();
for (int i = 0; i < count; i++)
{
//
XBoxZone iBox = detector.swhPivots[i];
//
DrawSWHPivot(
iBox,
to //
);
//
iBox.Clean();
}
}
//
void DrawSWLPivots(datetime to = NULL)
{
//
bool has = drawSWLPivots;
if (!has)
{
return;
}
//
has = detector.HasSWLPivots();
if (!has)
{
return;
}
//
int count = detector.CountSWLPivots();
for (int i = 0; i < count; i++)
{
//
XBoxZone iBox = detector.swlPivots[i];
//
DrawSWLPivot(
iBox,
to //
);
//
iBox.Clean();
}
}
//
void DrawPeakPivots(datetime to = NULL)
{
@@ -419,6 +665,76 @@ class XCXCAEAPOIDrawer : public XCBase
}
}
//
void DrawOBBullishPivots(datetime to = NULL)
{
//
bool has = drawOBBullishPivots;
if (!has)
{
return;
}
//
has = detector.HasOBBullishPivots();
if (!has)
{
return;
}
//
int count = detector.CountOBBullishPivots();
for (int i = 0; i < count; i++)
{
//
XBoxZone iBox = detector.obBullishPivots[i];
//
DrawOBBullishPivot(
iBox,
to //
);
//
iBox.Clean();
}
}
//
void DrawOBBearishPivots(datetime to = NULL)
{
//
bool has = drawOBBearishPivots;
if (!has)
{
return;
}
//
has = detector.HasOBBearishPivots();
if (!has)
{
return;
}
//
int count = detector.CountOBBearishPivots();
for (int i = 0; i < count; i++)
{
//
XBoxZone iBox = detector.obBearishPivots[i];
//
DrawOBBearishPivot(
iBox,
to //
);
//
iBox.Clean();
}
}
//
void DrawFVGBullishPivots(datetime to = NULL)
{
@@ -562,6 +878,112 @@ class XCXCAEAPOIDrawer : public XCBase
//
// One Item Drawers ...
//
void DrawSWHPivot(
XBoxZone &item,
datetime to = NULL //
)
{
//
bool has = drawSWHPivots;
if (!has)
{
return;
}
//
has = item.IsValid() &&
item.type == GetBoxType(XCA_SWH) &&
item.dir == GetDirection(XCA_SWH);
if (!has)
{
return;
}
//
bool canUpdateTo = IsValid(to);
if (canUpdateTo)
{
item.to = to;
}
//
XCBoxObject *iObj;
has = drawer.DrawBox(
item,
iObj //
);
if (has)
{
//
// Style Object ...
ApplyPivotStyle(
iObj,
swhPivotStyle //
);
//
// Store Object ...
mSWHPivotObjects.Add(iObj);
}
//
ZeroMemory(iObj);
}
//
void DrawSWLPivot(
XBoxZone &item,
datetime to = NULL //
)
{
//
bool has = drawSWLPivots;
if (!has)
{
return;
}
//
has = item.IsValid() &&
item.type == GetBoxType(XCA_SWL) &&
item.dir == GetDirection(XCA_SWL);
if (!has)
{
return;
}
//
bool canUpdateTo = IsValid(to);
if (canUpdateTo)
{
item.to = to;
}
//
XCBoxObject *iObj;
has = drawer.DrawBox(
item,
iObj //
);
if (has)
{
//
// Style Object ...
ApplyPivotStyle(
iObj,
swlPivotStyle //
);
//
// Store Object ...
mSWLPivotObjects.Add(iObj);
}
//
ZeroMemory(iObj);
}
//
void DrawPeakPivot(
XBoxZone &item,
@@ -668,6 +1090,112 @@ class XCXCAEAPOIDrawer : public XCBase
ZeroMemory(iObj);
}
//
void DrawOBBullishPivot(
XBoxZone &item,
datetime to = NULL //
)
{
//
bool has = drawOBBullishPivots;
if (!has)
{
return;
}
//
has = item.IsValid() &&
item.type == GetBoxType(XCA_OB_BULL) &&
item.dir == GetDirection(XCA_OB_BULL);
if (!has)
{
return;
}
//
bool canUpdateTo = IsValid(to);
if (canUpdateTo)
{
item.to = to;
}
//
XCBoxObject *iObj;
has = drawer.DrawBox(
item,
iObj //
);
if (has)
{
//
// Style Object ...
ApplyPivotStyle(
iObj,
obBullishPivotStyle //
);
//
// Store Object ...
mOBBullishPivotObjects.Add(iObj);
}
//
ZeroMemory(iObj);
}
//
void DrawOBBearishPivot(
XBoxZone &item,
datetime to = NULL //
)
{
//
bool has = drawOBBearishPivots;
if (!has)
{
return;
}
//
has = item.IsValid() &&
item.type == GetBoxType(XCA_OB_BEAR) &&
item.dir == GetDirection(XCA_OB_BEAR);
if (!has)
{
return;
}
//
bool canUpdateTo = IsValid(to);
if (canUpdateTo)
{
item.to = to;
}
//
XCBoxObject *iObj;
has = drawer.DrawBox(
item,
iObj //
);
if (has)
{
//
// Style Object ...
ApplyPivotStyle(
iObj,
obBearishPivotStyle //
);
//
// Store Object ...
mOBBearishPivotObjects.Add(iObj);
}
//
ZeroMemory(iObj);
}
//
void DrawFVGBullishPivot(
XBoxZone &item,
@@ -914,10 +1442,21 @@ class XCXCAEAPOIDrawer : public XCBase
XCPOIDrawer *drawer;
XCXCAEAPOIDetector *detector;
//
CArrayObj mObjects;
//
CArrayObj mSWHPivotObjects;
CArrayObj mSWLPivotObjects;
//
CArrayObj mPeakPivotObjects;
CArrayObj mValePivotObjects;
//
CArrayObj mOBBullishPivotObjects;
CArrayObj mOBBearishPivotObjects;
//
CArrayObj mFVGBullishPivotObjects;
CArrayObj mFVGBearishPivotObjects;