This commit is contained in:
2025-04-24 09:09:22 +03:30
parent cd932c7648
commit e85a4afb69
6 changed files with 816 additions and 161 deletions
+138
View File
@@ -43,6 +43,8 @@ class XCXCAEAPOIDrawer : public XCBase
//
// Drawers ...
bool drawTickPivots;
bool drawVolumePivots;
bool drawRSIPeakPivots;
bool drawRSIValePivots;
bool drawCCIPeakPivots;
@@ -62,6 +64,8 @@ class XCXCAEAPOIDrawer : public XCBase
color defaultBearishColor;
//
color tickPivotsColor;
color volumePivotsColor;
color rsiPeakPivotsColor;
color rsiValePivotsColor;
color cciPeakPivotsColor;
@@ -81,6 +85,8 @@ class XCXCAEAPOIDrawer : public XCBase
int defaultBearishWidth;
//
int tickPivotsWidth;
int volumePivotsWidth;
int rsiPeakPivotsWidth;
int rsiValePivotsWidth;
int cciPeakPivotsWidth;
@@ -100,6 +106,8 @@ class XCXCAEAPOIDrawer : public XCBase
ENUM_LINE_STYLE defaultBearishStyle;
//
ENUM_LINE_STYLE tickPivotsStyle;
ENUM_LINE_STYLE volumePivotsStyle;
ENUM_LINE_STYLE rsiPeakPivotsStyle;
ENUM_LINE_STYLE rsiValePivotsStyle;
ENUM_LINE_STYLE cciPeakPivotsStyle;
@@ -159,6 +167,8 @@ class XCXCAEAPOIDrawer : public XCBase
ignoreUpdateOSCTos = true;
//
drawTickPivots = false;
drawVolumePivots = false;
drawRSIPeakPivots = false;
drawRSIValePivots = false;
drawCCIPeakPivots = false;
@@ -174,6 +184,10 @@ class XCXCAEAPOIDrawer : public XCBase
defaultBullishColor = clrLime;
defaultBearishColor = clrRed;
//
tickPivotsColor = defaultBullishColor;
volumePivotsColor = defaultBearishColor;
//
rsiValePivotsColor = defaultBullishColor;
cciValePivotsColor = defaultBullishColor;
@@ -192,6 +206,10 @@ class XCXCAEAPOIDrawer : public XCBase
defaultBullishWidth = 1;
defaultBearishWidth = 1;
//
tickPivotsWidth = defaultBullishWidth;
volumePivotsWidth = defaultBearishWidth;
//
rsiValePivotsWidth = defaultBullishWidth;
cciValePivotsWidth = defaultBullishWidth;
@@ -210,6 +228,10 @@ class XCXCAEAPOIDrawer : public XCBase
defaultBullishStyle = STYLE_SOLID;
defaultBearishStyle = STYLE_SOLID;
//
tickPivotsStyle = defaultBullishStyle;
volumePivotsStyle = defaultBearishStyle;
//
rsiValePivotsStyle = defaultBullishStyle;
cciValePivotsStyle = defaultBullishStyle;
@@ -229,6 +251,8 @@ class XCXCAEAPOIDrawer : public XCBase
void Draw(datetime to = NULL)
{
//
DrawTickPivots(to);
DrawVolumePivots(to);
DrawRSIPeakPivots(to);
DrawRSIValePivots(to);
DrawCCIPeakPivots(to);
@@ -245,6 +269,8 @@ class XCXCAEAPOIDrawer : public XCBase
void Clear()
{
//
mTickPivotObjects.Clear();
mVolumePivotObjects.Clear();
mRSIPeakPivotObjects.Clear();
mRSIValePivotObjects.Clear();
mCCIPeakPivotObjects.Clear();
@@ -261,6 +287,116 @@ class XCXCAEAPOIDrawer : public XCBase
//
//
//
void DrawTickPivots(datetime to = NULL)
{
//
bool has = drawTickPivots;
if (!has)
{
return;
}
//
has = detector.HasTickPivots();
if (!has)
{
return;
}
//
bool canUpdateTo = IsValid(to);
//
int count = detector.CountTickPivots();
for (int i = 0; i < count; i++) {
//
XBoxZone iBox = detector.tickPivots[i];
//
if (canUpdateTo) {
iBox.to = to;
}
//
XCBoxObject *iObj;
has = drawer.DrawBox(
iBox,
iObj //
);
if (has) {
//
// Style Pivot ...
iObj.BoxColor(tickPivotsColor);
iObj.BoxWidth(tickPivotsWidth);
iObj.BoxStyle(tickPivotsStyle);
//
// Store Pivot ...
mTickPivotObjects.Add(iObj);
}
//
iBox.Clean();
ZeroMemory(iObj);
}
}
//
void DrawVolumePivots(datetime to = NULL)
{
//
bool has = drawVolumePivots;
if (!has)
{
return;
}
//
has = detector.HasVolumePivots();
if (!has)
{
return;
}
//
bool canUpdateTo = IsValid(to);
//
int count = detector.CountVolumePivots();
for (int i = 0; i < count; i++) {
//
XBoxZone iBox = detector.volumePivots[i];
//
if (canUpdateTo) {
iBox.to = to;
}
//
XCBoxObject *iObj;
has = drawer.DrawBox(
iBox,
iObj //
);
if (has) {
//
// Style Pivot ...
iObj.BoxColor(volumePivotsColor);
iObj.BoxWidth(volumePivotsWidth);
iObj.BoxStyle(volumePivotsStyle);
//
// Store Pivot ...
mVolumePivotObjects.Add(iObj);
}
//
iBox.Clean();
ZeroMemory(iObj);
}
}
//
void DrawRSIPeakPivots(datetime to = NULL)
{
@@ -892,6 +1028,8 @@ class XCXCAEAPOIDrawer : public XCBase
XCXCAEAPOIDetector *detector;
//
CArrayObj mTickPivotObjects;
CArrayObj mVolumePivotObjects;
CArrayObj mRSIPeakPivotObjects;
CArrayObj mRSIValePivotObjects;
CArrayObj mCCIPeakPivotObjects;