Files
MQL5Data/XCAEA/Classes/xcaea.x-poi.drawer.class.mq5
T
2025-04-26 17:40:03 +03:30

1473 lines
33 KiB
Plaintext

///////////////////////////////////////////////////////
//
// SaherElm IT Center MQL5 Indicator
// -------------------------------------------------
// Name: XCXCAEAPOIDrawer ...
// Description: Class for XCAEA POI Drawer ...
//
//
// Maintainer:
// ------------
// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com)
//
//////////////////////////////////////////////////////
//
// Global Properties ...
#property library
#property copyright "Copyright 2023, SaherElm IT Center"
#property link "https://saherelm.ir"
#property version "1.00"
#property description "SaherElm Class for XCAEA POI Drawer"
#property strict
//
// Imports ...
#include "../../Classes/x-saherelm.x-poi.drawer.class.mq5"
#include "../Classes/xcaea.x-poi.detector.class.mq5"
//
// Definitions ...
//
// Implementations ...
class XCXCAEAPOIDrawer : public XCBase
{
//
// Public ...
public:
//
// Props ...
//
bool ignoreUpdateOSCTos;
//
// Drawers ...
bool drawTrendLine;
bool drawTickPivots;
bool drawVolumePivots;
bool drawRSIPeakPivots;
bool drawRSIValePivots;
bool drawCCIPeakPivots;
bool drawCCIValePivots;
bool drawFVGBullishPivots;
bool drawFVGBearishPivots;
bool drawValeSupSWLPivots;
bool drawPeakResSWHPivots;
bool drawPVFVGBullishPivots;
bool drawPVFVGBearishPivots;
bool drawRSICrossedOverOSPivots;
bool drawRSICrossedUnderOBPivots;
bool drawCCICrossedOverOSPivots;
bool drawCCICrossedUnderOBPivots;
//
// Colors ...
//
color defaultBullishColor;
color defaultBearishColor;
//
color tickPivotsColor;
color volumePivotsColor;
color rsiPeakPivotsColor;
color rsiValePivotsColor;
color cciPeakPivotsColor;
color cciValePivotsColor;
color fvgBullishPivotsColor;
color fvgBearishPivotsColor;
color valeSupSWLPivotsColor;
color peakResSWHPivotsColor;
color trendLineBullishColor;
color trendLineBearishColor;
color pvFVGBullishPivotsColor;
color pvFVGBearishPivotsColor;
color rsiCrossedOverOSPivotsColor;
color rsiCrossedUnderOBPivotsColor;
color cciCrossedOverOSPivotsColor;
color cciCrossedUnderOBPivotsColor;
//
// Width ...
//
int defaultBullishWidth;
int defaultBearishWidth;
//
int tickPivotsWidth;
int volumePivotsWidth;
int rsiPeakPivotsWidth;
int rsiValePivotsWidth;
int cciPeakPivotsWidth;
int cciValePivotsWidth;
int fvgBullishPivotsWidth;
int fvgBearishPivotsWidth;
int valeSupSWLPivotsWidth;
int peakResSWHPivotsWidth;
int trendLineBullishWidth;
int trendLineBearishWidth;
int pvFVGBullishPivotsWidth;
int pvFVGBearishPivotsWidth;
int rsiCrossedOverOSPivotsWidth;
int rsiCrossedUnderOBPivotsWidth;
int cciCrossedOverOSPivotsWidth;
int cciCrossedUnderOBPivotsWidth;
//
// Style ...
//
ENUM_LINE_STYLE defaultBullishStyle;
ENUM_LINE_STYLE defaultBearishStyle;
//
ENUM_LINE_STYLE tickPivotsStyle;
ENUM_LINE_STYLE volumePivotsStyle;
ENUM_LINE_STYLE rsiPeakPivotsStyle;
ENUM_LINE_STYLE rsiValePivotsStyle;
ENUM_LINE_STYLE cciPeakPivotsStyle;
ENUM_LINE_STYLE cciValePivotsStyle;
ENUM_LINE_STYLE fvgBullishPivotsStyle;
ENUM_LINE_STYLE fvgBearishPivotsStyle;
ENUM_LINE_STYLE valeSupSWLPivotsStyle;
ENUM_LINE_STYLE peakResSWHPivotsStyle;
ENUM_LINE_STYLE trendLineBullishStyle;
ENUM_LINE_STYLE trendLineBearishStyle;
ENUM_LINE_STYLE pvFVGBullishPivotsStyle;
ENUM_LINE_STYLE pvFVGBearishPivotsStyle;
ENUM_LINE_STYLE rsiCrossedOverOSPivotsStyle;
ENUM_LINE_STYLE rsiCrossedUnderOBPivotsStyle;
ENUM_LINE_STYLE cciCrossedOverOSPivotsStyle;
ENUM_LINE_STYLE cciCrossedUnderOBPivotsStyle;
//
// Colorize Props ...
//
// Width Props ...
//
// Style Props ...
//
// Constructors ...
XCXCAEAPOIDrawer(
XCXCAEAPOIDetector *_detector //
)
{
//
detector = _detector;
drawer = new XCPOIDrawer();
//
Default();
}
//
// De Constructors ...
~XCXCAEAPOIDrawer()
{
//
Clear();
//
ZeroMemory(drawer);
ZeroMemory(detector);
}
//
// Properties ...
//
// Tools ...
//
virtual void Default()
{
//
ignoreUpdateOSCTos = true;
//
drawTrendLine = false;
drawTickPivots = false;
drawVolumePivots = false;
drawRSIPeakPivots = false;
drawRSIValePivots = false;
drawCCIPeakPivots = false;
drawCCIValePivots = false;
drawFVGBullishPivots = false;
drawFVGBearishPivots = false;
drawValeSupSWLPivots = false;
drawPeakResSWHPivots = false;
drawPVFVGBullishPivots = false;
drawPVFVGBearishPivots = false;
drawRSICrossedOverOSPivots = false;
drawRSICrossedUnderOBPivots = false;
drawCCICrossedOverOSPivots = false;
drawCCICrossedUnderOBPivots = false;
//
defaultBullishColor = clrLime;
defaultBearishColor = clrRed;
//
tickPivotsColor = defaultBullishColor;
volumePivotsColor = defaultBearishColor;
//
rsiValePivotsColor = defaultBullishColor;
cciValePivotsColor = defaultBullishColor;
fvgBullishPivotsColor = defaultBullishColor;
valeSupSWLPivotsColor = defaultBullishColor;
trendLineBullishColor = defaultBullishColor;
pvFVGBullishPivotsColor = defaultBullishColor;
rsiCrossedOverOSPivotsColor = defaultBullishColor;
cciCrossedOverOSPivotsColor = defaultBullishColor;
//
rsiPeakPivotsColor = defaultBearishColor;
cciPeakPivotsColor = defaultBearishColor;
fvgBearishPivotsColor = defaultBearishColor;
peakResSWHPivotsColor = defaultBearishColor;
trendLineBearishColor = defaultBearishColor;
pvFVGBearishPivotsColor = defaultBearishColor;
rsiCrossedUnderOBPivotsColor = defaultBearishColor;
cciCrossedUnderOBPivotsColor = defaultBearishColor;
//
defaultBullishWidth = 1;
defaultBearishWidth = 1;
//
tickPivotsWidth = defaultBullishWidth;
volumePivotsWidth = defaultBearishWidth;
//
rsiValePivotsWidth = defaultBullishWidth;
cciValePivotsWidth = defaultBullishWidth;
fvgBullishPivotsWidth = defaultBullishWidth;
valeSupSWLPivotsWidth = defaultBullishWidth;
trendLineBullishWidth = defaultBullishWidth;
pvFVGBullishPivotsWidth = defaultBullishWidth;
rsiCrossedOverOSPivotsWidth = defaultBullishWidth;
cciCrossedOverOSPivotsWidth = defaultBullishWidth;
//
rsiPeakPivotsWidth = defaultBearishWidth;
cciPeakPivotsWidth = defaultBearishWidth;
fvgBearishPivotsWidth = defaultBearishWidth;
peakResSWHPivotsWidth = defaultBearishWidth;
trendLineBearishWidth = defaultBearishWidth;
pvFVGBearishPivotsWidth = defaultBearishWidth;
rsiCrossedUnderOBPivotsWidth = defaultBearishWidth;
cciCrossedUnderOBPivotsWidth = defaultBearishWidth;
//
defaultBullishStyle = STYLE_SOLID;
defaultBearishStyle = STYLE_SOLID;
//
tickPivotsStyle = defaultBullishStyle;
volumePivotsStyle = defaultBearishStyle;
//
rsiValePivotsStyle = defaultBullishStyle;
cciValePivotsStyle = defaultBullishStyle;
fvgBullishPivotsStyle = defaultBullishStyle;
valeSupSWLPivotsStyle = defaultBullishStyle;
trendLineBullishStyle = defaultBullishStyle;
pvFVGBullishPivotsStyle = defaultBullishStyle;
rsiCrossedOverOSPivotsStyle = defaultBullishStyle;
cciCrossedOverOSPivotsStyle = defaultBullishStyle;
//
rsiPeakPivotsStyle = defaultBearishStyle;
cciPeakPivotsStyle = defaultBearishStyle;
fvgBearishPivotsStyle = defaultBearishStyle;
peakResSWHPivotsStyle = defaultBearishStyle;
trendLineBearishStyle = defaultBearishStyle;
pvFVGBearishPivotsStyle = defaultBearishStyle;
rsiCrossedUnderOBPivotsStyle = defaultBearishStyle;
cciCrossedUnderOBPivotsStyle = defaultBearishStyle;
}
//
void Draw(datetime to = NULL)
{
//
DrawTrendLine();
DrawTickPivots(to);
DrawVolumePivots(to);
DrawRSIPeakPivots(to);
DrawRSIValePivots(to);
DrawCCIPeakPivots(to);
DrawCCIValePivots(to);
DrawFVGBullishPivots(to);
DrawFVGBearishPivots(to);
DrawValeSupSWLPivots(to);
DrawPeakResSWHPivots(to);
DrawPVFVGBullishPivots(to);
DrawPVFVGBearishPivots(to);
DrawRSICrossedOverOSPivots(to);
DrawRSICrossedUnderOBPivots(to);
DrawCCICrossedOverOSPivots(to);
DrawCCICrossedUnderOBPivots(to);
}
//
void Clear()
{
//
mTrendLineObjects.Clear();
mTickPivotObjects.Clear();
mVolumePivotObjects.Clear();
mRSIPeakPivotObjects.Clear();
mRSIValePivotObjects.Clear();
mCCIPeakPivotObjects.Clear();
mCCIValePivotObjects.Clear();
mFVGBullishPivotObjects.Clear();
mFVGBearishPivotObjects.Clear();
mValeSupSWLPivotObjects.Clear();
mPeakResSWHPivotObjects.Clear();
mPVFVGBullishPivotObjects.Clear();
mPVFVGBearishPivotObjects.Clear();
mRSICrossedOverOSPivotObjects.Clear();
mRSICrossedUnderOBPivotObjects.Clear();
mCCICrossedOverOSPivotObjects.Clear();
mCCICrossedUnderOBPivotObjects.Clear();
}
//
//
//
//
void DrawTrendLine()
{
//
if (!drawTrendLine)
{
return;
}
//
mTrendLineObjects.Clear();
//
ENUM_X_DIRECTION trend = X_DIRECTION_NONE;
bool has = detector.MarketTrend(trend);
if (!has)
{
return;
}
//
long chartID = drawer.ChartIdentification();
int subWindow = drawer.SubWindowIdentification();
//
bool hasBullishTrend = IsBullish(trend);
//
double pPrice = hasBullishTrend
? detector.trendPivotP.lower
: detector.trendPivotP.upper;
//
datetime pTime = detector.trendPivotP.from;
//
double cPrice = hasBullishTrend
? detector.trendPivotC.lower
: detector.trendPivotC.upper;
//
datetime cTime = detector.trendPivotC.from;
//
string tlName = ToString(trend) +
"_TL_" +
ToString(pPrice) +
"_" +
ToString(cPrice);
//
int tlWidth = hasBullishTrend
? trendLineBullishWidth
: trendLineBearishWidth;
//
color tlColor = hasBullishTrend
? trendLineBullishColor
: trendLineBearishColor;
//
ENUM_LINE_STYLE tlStyle = hasBullishTrend
? trendLineBullishStyle
: trendLineBearishStyle;
//
CChartObjectTrend *iObj;
iObj = new CChartObjectTrend();
has = iObj.Create(
chartID,
tlName,
subWindow,
pTime,
pPrice,
cTime,
cPrice //
);
if (has)
{
//
// Style Object ...
iObj.Color(tlColor);
iObj.Width(tlWidth);
iObj.Style(tlStyle);
iObj.RayRight(true);
//
// Store Object ...
mTrendLineObjects.Add(iObj);
}
//
ZeroMemory(iObj);
}
//
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)
{
//
bool has = drawRSIPeakPivots;
if (!has)
{
return;
}
//
has = detector.HasRSIPeakPivots();
if (!has)
{
return;
}
//
if (ignoreUpdateOSCTos)
{
to = NULL;
}
bool canUpdateTo = IsValid(to);
//
int count = detector.CountRSIPeakPivots();
for (int i = 0; i < count; i++)
{
//
XBoxZone iBox = detector.rsiPeakPivots[i];
//
if (canUpdateTo)
{
iBox.to = to;
}
//
XCBoxObject *iObj;
has = drawer.DrawBox(
iBox,
iObj //
);
if (has)
{
//
// Style Object ...
iObj.BoxColor(rsiPeakPivotsColor);
iObj.BoxWidth(rsiPeakPivotsWidth);
iObj.BoxStyle(rsiPeakPivotsStyle);
//
// Store Object ...
mRSIPeakPivotObjects.Add(iObj);
}
//
iBox.Clean();
ZeroMemory(iObj);
}
}
//
void DrawRSIValePivots(datetime to = NULL)
{
//
bool has = drawRSIValePivots;
if (!has)
{
return;
}
//
has = detector.HasRSIValePivots();
if (!has)
{
return;
}
//
if (ignoreUpdateOSCTos)
{
to = NULL;
}
bool canUpdateTo = IsValid(to);
//
int count = detector.CountRSIValePivots();
for (int i = 0; i < count; i++)
{
//
XBoxZone iBox = detector.rsiValePivots[i];
//
if (canUpdateTo)
{
iBox.to = to;
}
//
XCBoxObject *iObj;
has = drawer.DrawBox(
iBox,
iObj //
);
if (has)
{
//
// Style Object ...
iObj.BoxColor(rsiValePivotsColor);
iObj.BoxWidth(rsiValePivotsWidth);
iObj.BoxStyle(rsiValePivotsStyle);
//
// Store Object ...
mRSIValePivotObjects.Add(iObj);
}
//
iBox.Clean();
ZeroMemory(iObj);
}
}
//
void DrawCCIPeakPivots(datetime to = NULL)
{
//
bool has = drawCCIPeakPivots;
if (!has)
{
return;
}
//
has = detector.HasCCIPeakPivots();
if (!has)
{
return;
}
//
if (ignoreUpdateOSCTos)
{
to = NULL;
}
bool canUpdateTo = IsValid(to);
//
int count = detector.CountCCIPeakPivots();
for (int i = 0; i < count; i++)
{
//
XBoxZone iBox = detector.cciPeakPivots[i];
//
if (canUpdateTo)
{
iBox.to = to;
}
//
XCBoxObject *iObj;
has = drawer.DrawBox(
iBox,
iObj //
);
if (has)
{
//
// Style Object ...
iObj.BoxColor(cciPeakPivotsColor);
iObj.BoxWidth(cciPeakPivotsWidth);
iObj.BoxStyle(cciPeakPivotsStyle);
//
// Store Object ...
mCCIPeakPivotObjects.Add(iObj);
}
//
iBox.Clean();
ZeroMemory(iObj);
}
}
//
void DrawCCIValePivots(datetime to = NULL)
{
//
bool has = drawCCIValePivots;
if (!has)
{
return;
}
//
has = detector.HasCCIValePivots();
if (!has)
{
return;
}
//
if (ignoreUpdateOSCTos)
{
to = NULL;
}
bool canUpdateTo = IsValid(to);
//
int count = detector.CountCCIValePivots();
for (int i = 0; i < count; i++)
{
//
XBoxZone iBox = detector.cciValePivots[i];
//
if (canUpdateTo)
{
iBox.to = to;
}
//
XCBoxObject *iObj;
has = drawer.DrawBox(
iBox,
iObj //
);
if (has)
{
//
// Style Object ...
iObj.BoxColor(cciValePivotsColor);
iObj.BoxWidth(cciValePivotsWidth);
iObj.BoxStyle(cciValePivotsStyle);
//
// Store Object ...
mCCIValePivotObjects.Add(iObj);
}
//
iBox.Clean();
ZeroMemory(iObj);
}
}
//
void DrawFVGBullishPivots(datetime to = NULL)
{
//
bool has = drawFVGBullishPivots;
if (!has)
{
return;
}
//
has = detector.HasFVGBullishPivots();
if (!has)
{
return;
}
//
bool canUpdateTo = IsValid(to);
//
int count = detector.CountFVGBullishPivots();
for (int i = 0; i < count; i++)
{
//
XBoxZone iBox = detector.fvgBullishPivots[i];
//
if (canUpdateTo)
{
iBox.to = to;
}
//
XCBoxObject *iObj;
has = drawer.DrawBox(
iBox,
iObj //
);
if (has)
{
//
// Style Object ...
iObj.BoxColor(fvgBullishPivotsColor);
iObj.BoxWidth(fvgBullishPivotsWidth);
iObj.BoxStyle(fvgBullishPivotsStyle);
//
// Store Object ...
mFVGBullishPivotObjects.Add(iObj);
}
//
iBox.Clean();
ZeroMemory(iObj);
}
}
//
void DrawFVGBearishPivots(datetime to = NULL)
{
//
bool has = drawFVGBearishPivots;
if (!has)
{
return;
}
//
has = detector.HasFVGBearishPivots();
if (!has)
{
return;
}
//
bool canUpdateTo = IsValid(to);
//
int count = detector.CountFVGBearishPivots();
for (int i = 0; i < count; i++)
{
//
XBoxZone iBox = detector.fvgBearishPivots[i];
//
if (canUpdateTo)
{
iBox.to = to;
}
//
XCBoxObject *iObj;
has = drawer.DrawBox(
iBox,
iObj //
);
if (has)
{
//
// Style Object ...
iObj.BoxColor(fvgBearishPivotsColor);
iObj.BoxWidth(fvgBearishPivotsWidth);
iObj.BoxStyle(fvgBearishPivotsStyle);
//
// Store Object ...
mFVGBearishPivotObjects.Add(iObj);
}
//
iBox.Clean();
ZeroMemory(iObj);
}
}
//
void DrawValeSupSWLPivots(datetime to = NULL)
{
//
bool has = drawValeSupSWLPivots;
if (!has)
{
return;
}
//
has = detector.HasValeSupSWLPivots();
if (!has)
{
return;
}
//
bool canUpdateTo = IsValid(to);
//
int count = detector.CountValeSupSWLPivots();
for (int i = 0; i < count; i++)
{
//
XBoxZone iBox = detector.valeSupSWLPivots[i];
//
if (canUpdateTo)
{
iBox.to = to;
}
//
XCBoxObject *iObj;
has = drawer.DrawBox(
iBox,
iObj //
);
if (has)
{
//
// Style Object ...
iObj.BoxColor(valeSupSWLPivotsColor);
iObj.BoxWidth(valeSupSWLPivotsWidth);
iObj.BoxStyle(valeSupSWLPivotsStyle);
//
// Store Object ...
mValeSupSWLPivotObjects.Add(iObj);
}
//
iBox.Clean();
ZeroMemory(iObj);
}
}
//
void DrawPeakResSWHPivots(datetime to = NULL)
{
//
bool has = drawPeakResSWHPivots;
if (!has)
{
return;
}
//
has = detector.HasPeakResSWHPivots();
if (!has)
{
return;
}
//
bool canUpdateTo = IsValid(to);
//
int count = detector.CountPeakResSWHPivots();
for (int i = 0; i < count; i++)
{
//
XBoxZone iBox = detector.peakResSWHPivots[i];
//
if (canUpdateTo)
{
iBox.to = to;
}
//
XCBoxObject *iObj;
has = drawer.DrawBox(
iBox,
iObj //
);
if (has)
{
//
// Style Object ...
iObj.BoxColor(peakResSWHPivotsColor);
iObj.BoxWidth(peakResSWHPivotsWidth);
iObj.BoxStyle(peakResSWHPivotsStyle);
//
// Store Object ...
mPeakResSWHPivotObjects.Add(iObj);
}
//
iBox.Clean();
ZeroMemory(iObj);
}
}
//
void DrawPVFVGBullishPivots(datetime to = NULL)
{
//
bool has = drawPVFVGBullishPivots;
if (!has)
{
return;
}
//
has = detector.HasPVFVGBullishPivots();
if (!has)
{
return;
}
//
bool canUpdateTo = IsValid(to);
//
int count = detector.CountPVFVGBullishPivots();
for (int i = 0; i < count; i++)
{
//
XBoxZone iBox;
has = detector.pvFVGBullishPivots[i].GetSelectedFVG(iBox);
if (!has)
{
//
iBox.Clean();
continue;
}
//
if (canUpdateTo)
{
iBox.to = to;
}
//
XCBoxObject *iObj;
has = drawer.DrawBox(
iBox,
iObj //
);
//
if (has)
{
//
// Style Object ...
iObj.BoxColor(pvFVGBullishPivotsColor);
iObj.BoxWidth(pvFVGBullishPivotsWidth);
iObj.BoxStyle(pvFVGBullishPivotsStyle);
//
// Store Object ...
mPVFVGBullishPivotObjects.Add(iObj);
}
//
iBox.Clean();
ZeroMemory(iObj);
}
}
//
void DrawPVFVGBearishPivots(datetime to = NULL)
{
//
bool has = drawPVFVGBearishPivots;
if (!has)
{
return;
}
//
has = detector.HasPVFVGBearishPivots();
if (!has)
{
return;
}
//
bool canUpdateTo = IsValid(to);
//
int count = detector.CountPVFVGBearishPivots();
for (int i = 0; i < count; i++)
{
//
XBoxZone iBox;
has = detector.pvFVGBearishPivots[i].GetSelectedFVG(iBox);
if (!has)
{
//
iBox.Clean();
continue;
}
//
if (canUpdateTo)
{
iBox.to = to;
}
//
XCBoxObject *iObj;
has = drawer.DrawBox(
iBox,
iObj //
);
//
if (has)
{
//
// Style Object ...
iObj.BoxColor(pvFVGBearishPivotsColor);
iObj.BoxWidth(pvFVGBearishPivotsWidth);
iObj.BoxStyle(pvFVGBearishPivotsStyle);
//
// Store Object ...
mPVFVGBearishPivotObjects.Add(iObj);
}
//
iBox.Clean();
ZeroMemory(iObj);
}
}
//
void DrawRSICrossedOverOSPivots(datetime to = NULL)
{
//
bool has = drawRSICrossedOverOSPivots;
if (!has)
{
return;
}
//
has = detector.HasRSICrossedOverOSPivots();
if (!has)
{
return;
}
//
if (ignoreUpdateOSCTos)
{
to = NULL;
}
//
bool canUpdateTo = IsValid(to);
//
int count = detector.CountRSICrossedOverOSPivots();
for (int i = 0; i < count; i++)
{
//
XBoxZone iBox = detector.rsiCrossedOverOSPivots[i];
//
if (canUpdateTo)
{
iBox.to = to;
}
//
XCBoxObject *iObj;
has = drawer.DrawBox(
iBox,
iObj //
);
//
if (has)
{
//
// Style Object ...
iObj.BoxColor(rsiCrossedOverOSPivotsColor);
iObj.BoxWidth(rsiCrossedOverOSPivotsWidth);
iObj.BoxStyle(rsiCrossedOverOSPivotsStyle);
//
// Store Object ...
mRSICrossedOverOSPivotObjects.Add(iObj);
}
//
iBox.Clean();
ZeroMemory(iObj);
}
}
//
void DrawRSICrossedUnderOBPivots(datetime to = NULL)
{
//
bool has = drawRSICrossedUnderOBPivots;
if (!has)
{
return;
}
//
has = detector.HasRSICrossedUnderOBPivots();
if (!has)
{
return;
}
//
if (ignoreUpdateOSCTos)
{
to = NULL;
}
//
bool canUpdateTo = IsValid(to);
//
int count = detector.CountRSICrossedUnderOBPivots();
for (int i = 0; i < count; i++)
{
//
XBoxZone iBox = detector.rsiCrossedUnderOBPivots[i];
//
if (canUpdateTo)
{
iBox.to = to;
}
//
XCBoxObject *iObj;
has = drawer.DrawBox(
iBox,
iObj //
);
//
if (has)
{
//
// Style Object ...
iObj.BoxColor(rsiCrossedUnderOBPivotsColor);
iObj.BoxWidth(rsiCrossedUnderOBPivotsWidth);
iObj.BoxStyle(rsiCrossedUnderOBPivotsStyle);
//
// Store Object ...
mRSICrossedUnderOBPivotObjects.Add(iObj);
}
//
iBox.Clean();
ZeroMemory(iObj);
}
}
//
void DrawCCICrossedOverOSPivots(datetime to = NULL)
{
//
bool has = drawCCICrossedOverOSPivots;
if (!has)
{
return;
}
//
has = detector.HasCCICrossedOverOSPivots();
if (!has)
{
return;
}
//
if (ignoreUpdateOSCTos)
{
to = NULL;
}
//
bool canUpdateTo = IsValid(to);
//
int count = detector.CountCCICrossedOverOSPivots();
for (int i = 0; i < count; i++)
{
//
XBoxZone iBox = detector.cciCrossedOverOSPivots[i];
//
if (canUpdateTo)
{
iBox.to = to;
}
//
XCBoxObject *iObj;
has = drawer.DrawBox(
iBox,
iObj //
);
//
if (has)
{
//
// Style Object ...
iObj.BoxColor(cciCrossedOverOSPivotsColor);
iObj.BoxWidth(cciCrossedOverOSPivotsWidth);
iObj.BoxStyle(cciCrossedOverOSPivotsStyle);
//
// Store Object ...
mCCICrossedOverOSPivotObjects.Add(iObj);
}
//
iBox.Clean();
ZeroMemory(iObj);
}
}
//
void DrawCCICrossedUnderOBPivots(datetime to = NULL)
{
//
bool has = drawCCICrossedUnderOBPivots;
if (!has)
{
return;
}
//
has = detector.HasCCICrossedUnderOBPivots();
if (!has)
{
return;
}
//
if (ignoreUpdateOSCTos)
{
to = NULL;
}
//
bool canUpdateTo = IsValid(to);
//
int count = detector.CountCCICrossedUnderOBPivots();
for (int i = 0; i < count; i++)
{
//
XBoxZone iBox = detector.cciCrossedUnderOBPivots[i];
//
if (canUpdateTo)
{
iBox.to = to;
}
//
XCBoxObject *iObj;
has = drawer.DrawBox(
iBox,
iObj //
);
//
if (has)
{
//
// Style Object ...
iObj.BoxColor(cciCrossedUnderOBPivotsColor);
iObj.BoxWidth(cciCrossedUnderOBPivotsWidth);
iObj.BoxStyle(cciCrossedUnderOBPivotsStyle);
//
// Store Object ...
mCCICrossedUnderOBPivotObjects.Add(iObj);
}
//
iBox.Clean();
ZeroMemory(iObj);
}
}
//
// Protected ...
protected:
//
// Props ...
//
// Prrivate ...
private:
//
// Props ...
//
XCPOIDrawer *drawer;
XCXCAEAPOIDetector *detector;
//
CArrayObj mTickPivotObjects;
CArrayObj mTrendLineObjects;
CArrayObj mVolumePivotObjects;
CArrayObj mRSIPeakPivotObjects;
CArrayObj mRSIValePivotObjects;
CArrayObj mCCIPeakPivotObjects;
CArrayObj mCCIValePivotObjects;
CArrayObj mFVGBullishPivotObjects;
CArrayObj mFVGBearishPivotObjects;
CArrayObj mValeSupSWLPivotObjects;
CArrayObj mPeakResSWHPivotObjects;
CArrayObj mPVFVGBullishPivotObjects;
CArrayObj mPVFVGBearishPivotObjects;
CArrayObj mRSICrossedOverOSPivotObjects;
CArrayObj mRSICrossedUnderOBPivotObjects;
CArrayObj mCCICrossedOverOSPivotObjects;
CArrayObj mCCICrossedUnderOBPivotObjects;
//
};
//