This commit is contained in:
2025-06-03 16:22:01 +03:30
parent 48123642b7
commit 078dc35ae0
9 changed files with 3005 additions and 45 deletions
+447 -7
View File
@@ -84,6 +84,10 @@ class XCXCATBEAPOIDrawer : public XCBase
// Drawers ...
bool drawPeakPivots;
bool drawValePivots;
bool drawMTBullishPivots;
bool drawMTBearishPivots;
bool drawOBBullishPivots;
bool drawOBBearishPivots;
//
// Styling ...
@@ -96,6 +100,14 @@ class XCXCATBEAPOIDrawer : public XCBase
XCATBPivotStyle peakPivotStyle;
XCATBPivotStyle valePivotStyle;
//
XCATBPivotStyle mtBullishPivotStyle;
XCATBPivotStyle mtBearishPivotStyle;
//
XCATBPivotStyle obBullishPivotStyle;
XCATBPivotStyle obBearishPivotStyle;
//
// Constructors ...
XCXCATBEAPOIDrawer(
@@ -138,6 +150,10 @@ class XCXCATBEAPOIDrawer : public XCBase
// Drawing ...
drawPeakPivots = false;
drawValePivots = false;
drawMTBullishPivots = false;
drawMTBearishPivots = false;
drawOBBullishPivots = false;
drawOBBearishPivots = false;
//
// Styling ...
@@ -161,6 +177,16 @@ class XCXCATBEAPOIDrawer : public XCBase
// PV ...
peakPivotStyle = defaultBearishStyle;
valePivotStyle = defaultBullishStyle;
//
// MT ...
mtBullishPivotStyle = defaultBearishStyle;
mtBearishPivotStyle = defaultBullishStyle;
//
// OB ...
obBullishPivotStyle = defaultBearishStyle;
obBearishPivotStyle = defaultBullishStyle;
}
//
@@ -170,6 +196,16 @@ class XCXCATBEAPOIDrawer : public XCBase
// PV ...
DrawPeakPivots(to);
DrawValePivots(to);
//
// MT ...
DrawMTBullishPivots(to);
DrawMTBearishPivots(to);
//
// OB ...
DrawOBBullishPivots(to);
DrawOBBearishPivots(to);
}
//
@@ -226,7 +262,7 @@ class XCXCATBEAPOIDrawer : public XCBase
switch (iType)
{
//
case XCA_PEAK:
case XCATB_PEAK:
//
DrawPeakPivot(
box,
@@ -235,13 +271,49 @@ class XCXCATBEAPOIDrawer : public XCBase
break;
//
case XCA_VALE:
case XCATB_VALE:
//
DrawValePivot(
box,
to //
);
break;
//
case XCATB_BULLISH_MT:
//
DrawMTBullishPivot(
box,
to //
);
break;
//
case XCATB_BEARISH_MT:
//
DrawMTBearishPivot(
box,
to //
);
break;
//
case XCATB_BULLISH_OB:
//
DrawOBBullishPivot(
box,
to //
);
break;
//
case XCATB_BEARISH_OB:
//
DrawOBBearishPivot(
box,
to //
);
break;
}
}
//
@@ -370,12 +442,20 @@ class XCXCATBEAPOIDrawer : public XCBase
// Cleanup Styles ...
peakPivotStyle.Clean();
valePivotStyle.Clean();
mtBullishPivotStyle.Clean();
mtBearishPivotStyle.Clean();
obBullishPivotStyle.Clean();
obBearishPivotStyle.Clean();
//
// Cleanup Pivot Objects Holder ...
mObjects.Clear();
mPeakPivotObjects.Clear();
mValePivotObjects.Clear();
mMTBullishPivotObjects.Clear();
mMTBearishPivotObjects.Clear();
mOBBullishPivotObjects.Clear();
mOBBearishPivotObjects.Clear();
}
//
@@ -451,6 +531,146 @@ class XCXCATBEAPOIDrawer : public XCBase
}
}
//
void DrawMTBullishPivots(datetime to = NULL)
{
//
bool has = drawMTBullishPivots;
if (!has)
{
return;
}
//
has = detector.HasMTBullishPivots();
if (!has)
{
return;
}
//
int count = detector.CountMTBullishPivots();
for (int i = 0; i < count; i++)
{
//
XBoxZone iBox = detector.mtBullishPivots[i];
//
DrawMTBullishPivot(
iBox,
to //
);
//
iBox.Clean();
}
}
//
void DrawMTBearishPivots(datetime to = NULL)
{
//
bool has = drawMTBearishPivots;
if (!has)
{
return;
}
//
has = detector.HasMTBearishPivots();
if (!has)
{
return;
}
//
int count = detector.CountMTBearishPivots();
for (int i = 0; i < count; i++)
{
//
XBoxZone iBox = detector.mtBearishPivots[i];
//
DrawMTBearishPivot(
iBox,
to //
);
//
iBox.Clean();
}
}
//
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();
}
}
//
// One Item Drawers ...
@@ -469,8 +689,8 @@ class XCXCATBEAPOIDrawer : public XCBase
//
has = item.IsValid() &&
item.type == GetBoxType(XCA_PEAK) &&
item.dir == GetDirection(XCA_PEAK);
item.type == GetBoxType(XCATB_PEAK) &&
item.dir == GetDirection(XCATB_PEAK);
if (!has)
{
return;
@@ -522,8 +742,8 @@ class XCXCATBEAPOIDrawer : public XCBase
//
has = item.IsValid() &&
item.type == GetBoxType(XCA_VALE) &&
item.dir == GetDirection(XCA_VALE);
item.type == GetBoxType(XCATB_VALE) &&
item.dir == GetDirection(XCATB_VALE);
if (!has)
{
return;
@@ -560,6 +780,218 @@ class XCXCATBEAPOIDrawer : public XCBase
ZeroMemory(iObj);
}
//
void DrawMTBullishPivot(
XBoxZone &item,
datetime to = NULL //
)
{
//
bool has = drawMTBullishPivots;
if (!has)
{
return;
}
//
has = item.IsValid() &&
item.type == GetBoxType(XCATB_BULLISH_MT) &&
item.dir == GetDirection(XCATB_BULLISH_MT);
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,
mtBullishPivotStyle //
);
//
// Store Object ...
mMTBullishPivotObjects.Add(iObj);
}
//
ZeroMemory(iObj);
}
//
void DrawMTBearishPivot(
XBoxZone &item,
datetime to = NULL //
)
{
//
bool has = drawMTBearishPivots;
if (!has)
{
return;
}
//
has = item.IsValid() &&
item.type == GetBoxType(XCATB_BEARISH_MT) &&
item.dir == GetDirection(XCATB_BEARISH_MT);
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,
mtBearishPivotStyle //
);
//
// Store Object ...
mMTBearishPivotObjects.Add(iObj);
}
//
ZeroMemory(iObj);
}
//
void DrawOBBullishPivot(
XBoxZone &item,
datetime to = NULL //
)
{
//
bool has = drawOBBullishPivots;
if (!has)
{
return;
}
//
has = item.IsValid() &&
item.type == GetBoxType(XCATB_BULLISH_OB) &&
item.dir == GetDirection(XCATB_BULLISH_OB);
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(XCATB_BEARISH_OB) &&
item.dir == GetDirection(XCATB_BEARISH_OB);
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);
}
//
// Protected ...
protected:
@@ -590,7 +1022,7 @@ class XCXCATBEAPOIDrawer : public XCBase
//
// Props ...
XCXCATBEAPOIDetector *detector;
//
CArrayObj mObjects;
@@ -598,6 +1030,14 @@ class XCXCATBEAPOIDrawer : public XCBase
CArrayObj mPeakPivotObjects;
CArrayObj mValePivotObjects;
//
CArrayObj mMTBullishPivotObjects;
CArrayObj mMTBearishPivotObjects;
//
CArrayObj mOBBullishPivotObjects;
CArrayObj mOBBearishPivotObjects;
//
};