last ...
This commit is contained in:
@@ -43,6 +43,7 @@ class XCXCAEAPOIDrawer : public XCBase
|
||||
|
||||
//
|
||||
// Drawers ...
|
||||
bool drawTrendLine;
|
||||
bool drawTickPivots;
|
||||
bool drawVolumePivots;
|
||||
bool drawRSIPeakPivots;
|
||||
@@ -74,6 +75,8 @@ class XCXCAEAPOIDrawer : public XCBase
|
||||
color fvgBearishPivotsColor;
|
||||
color valeSupSWLPivotsColor;
|
||||
color peakResSWHPivotsColor;
|
||||
color trendLineBullishColor;
|
||||
color trendLineBearishColor;
|
||||
color pvFVGBullishPivotsColor;
|
||||
color pvFVGBearishPivotsColor;
|
||||
|
||||
@@ -95,6 +98,8 @@ class XCXCAEAPOIDrawer : public XCBase
|
||||
int fvgBearishPivotsWidth;
|
||||
int valeSupSWLPivotsWidth;
|
||||
int peakResSWHPivotsWidth;
|
||||
int trendLineBullishWidth;
|
||||
int trendLineBearishWidth;
|
||||
int pvFVGBullishPivotsWidth;
|
||||
int pvFVGBearishPivotsWidth;
|
||||
|
||||
@@ -116,6 +121,8 @@ class XCXCAEAPOIDrawer : public XCBase
|
||||
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;
|
||||
|
||||
@@ -167,6 +174,7 @@ class XCXCAEAPOIDrawer : public XCBase
|
||||
ignoreUpdateOSCTos = true;
|
||||
|
||||
//
|
||||
drawTrendLine = false;
|
||||
drawTickPivots = false;
|
||||
drawVolumePivots = false;
|
||||
drawRSIPeakPivots = false;
|
||||
@@ -193,6 +201,7 @@ class XCXCAEAPOIDrawer : public XCBase
|
||||
cciValePivotsColor = defaultBullishColor;
|
||||
fvgBullishPivotsColor = defaultBullishColor;
|
||||
valeSupSWLPivotsColor = defaultBullishColor;
|
||||
trendLineBullishColor = defaultBullishColor;
|
||||
pvFVGBullishPivotsColor = defaultBullishColor;
|
||||
|
||||
//
|
||||
@@ -200,6 +209,7 @@ class XCXCAEAPOIDrawer : public XCBase
|
||||
cciPeakPivotsColor = defaultBearishColor;
|
||||
fvgBearishPivotsColor = defaultBearishColor;
|
||||
peakResSWHPivotsColor = defaultBearishColor;
|
||||
trendLineBearishColor = defaultBearishColor;
|
||||
pvFVGBearishPivotsColor = defaultBearishColor;
|
||||
|
||||
//
|
||||
@@ -215,6 +225,7 @@ class XCXCAEAPOIDrawer : public XCBase
|
||||
cciValePivotsWidth = defaultBullishWidth;
|
||||
fvgBullishPivotsWidth = defaultBullishWidth;
|
||||
valeSupSWLPivotsWidth = defaultBullishWidth;
|
||||
trendLineBullishWidth = defaultBullishWidth;
|
||||
pvFVGBullishPivotsWidth = defaultBullishWidth;
|
||||
|
||||
//
|
||||
@@ -222,6 +233,7 @@ class XCXCAEAPOIDrawer : public XCBase
|
||||
cciPeakPivotsWidth = defaultBearishWidth;
|
||||
fvgBearishPivotsWidth = defaultBearishWidth;
|
||||
peakResSWHPivotsWidth = defaultBearishWidth;
|
||||
trendLineBearishWidth = defaultBearishWidth;
|
||||
pvFVGBearishPivotsWidth = defaultBearishWidth;
|
||||
|
||||
//
|
||||
@@ -237,6 +249,7 @@ class XCXCAEAPOIDrawer : public XCBase
|
||||
cciValePivotsStyle = defaultBullishStyle;
|
||||
fvgBullishPivotsStyle = defaultBullishStyle;
|
||||
valeSupSWLPivotsStyle = defaultBullishStyle;
|
||||
trendLineBullishStyle = defaultBullishStyle;
|
||||
pvFVGBullishPivotsStyle = defaultBullishStyle;
|
||||
|
||||
//
|
||||
@@ -244,6 +257,7 @@ class XCXCAEAPOIDrawer : public XCBase
|
||||
cciPeakPivotsStyle = defaultBearishStyle;
|
||||
fvgBearishPivotsStyle = defaultBearishStyle;
|
||||
peakResSWHPivotsStyle = defaultBearishStyle;
|
||||
trendLineBearishStyle = defaultBearishStyle;
|
||||
pvFVGBearishPivotsStyle = defaultBearishStyle;
|
||||
}
|
||||
|
||||
@@ -251,6 +265,7 @@ class XCXCAEAPOIDrawer : public XCBase
|
||||
void Draw(datetime to = NULL)
|
||||
{
|
||||
//
|
||||
DrawTrendLine();
|
||||
DrawTickPivots(to);
|
||||
DrawVolumePivots(to);
|
||||
DrawRSIPeakPivots(to);
|
||||
@@ -269,6 +284,7 @@ class XCXCAEAPOIDrawer : public XCBase
|
||||
void Clear()
|
||||
{
|
||||
//
|
||||
mTrendLineObjects.Clear();
|
||||
mTickPivotObjects.Clear();
|
||||
mVolumePivotObjects.Clear();
|
||||
mRSIPeakPivotObjects.Clear();
|
||||
@@ -287,6 +303,97 @@ class XCXCAEAPOIDrawer : public XCBase
|
||||
//
|
||||
//
|
||||
|
||||
//
|
||||
void DrawTrendLine()
|
||||
{
|
||||
//
|
||||
if (!drawTrendLine)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
//
|
||||
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.trendPivotC.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);
|
||||
|
||||
//
|
||||
// Store Object ...
|
||||
mTrendLineObjects.Add(iObj);
|
||||
}
|
||||
|
||||
//
|
||||
ZeroMemory(iObj);
|
||||
}
|
||||
|
||||
//
|
||||
void DrawTickPivots(datetime to = NULL)
|
||||
{
|
||||
@@ -309,12 +416,14 @@ class XCXCAEAPOIDrawer : public XCBase
|
||||
|
||||
//
|
||||
int count = detector.CountTickPivots();
|
||||
for (int i = 0; i < count; i++) {
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
//
|
||||
XBoxZone iBox = detector.tickPivots[i];
|
||||
|
||||
//
|
||||
if (canUpdateTo) {
|
||||
if (canUpdateTo)
|
||||
{
|
||||
iBox.to = to;
|
||||
}
|
||||
|
||||
@@ -324,7 +433,8 @@ class XCXCAEAPOIDrawer : public XCBase
|
||||
iBox,
|
||||
iObj //
|
||||
);
|
||||
if (has) {
|
||||
if (has)
|
||||
{
|
||||
//
|
||||
// Style Pivot ...
|
||||
iObj.BoxColor(tickPivotsColor);
|
||||
@@ -364,12 +474,14 @@ class XCXCAEAPOIDrawer : public XCBase
|
||||
|
||||
//
|
||||
int count = detector.CountVolumePivots();
|
||||
for (int i = 0; i < count; i++) {
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
//
|
||||
XBoxZone iBox = detector.volumePivots[i];
|
||||
|
||||
//
|
||||
if (canUpdateTo) {
|
||||
if (canUpdateTo)
|
||||
{
|
||||
iBox.to = to;
|
||||
}
|
||||
|
||||
@@ -379,7 +491,8 @@ class XCXCAEAPOIDrawer : public XCBase
|
||||
iBox,
|
||||
iObj //
|
||||
);
|
||||
if (has) {
|
||||
if (has)
|
||||
{
|
||||
//
|
||||
// Style Pivot ...
|
||||
iObj.BoxColor(volumePivotsColor);
|
||||
@@ -1029,6 +1142,7 @@ class XCXCAEAPOIDrawer : public XCBase
|
||||
|
||||
//
|
||||
CArrayObj mTickPivotObjects;
|
||||
CArrayObj mTrendLineObjects;
|
||||
CArrayObj mVolumePivotObjects;
|
||||
CArrayObj mRSIPeakPivotObjects;
|
||||
CArrayObj mRSIValePivotObjects;
|
||||
|
||||
Reference in New Issue
Block a user