last ...
This commit is contained in:
@@ -4623,7 +4623,7 @@ T FindLesserThan(
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
template <typename T>
|
template <typename T>
|
||||||
T FindLesserThan(
|
T FindLesserThanByIndex(
|
||||||
T value, // Specified Value ...
|
T value, // Specified Value ...
|
||||||
int &index, // Item Index ...
|
int &index, // Item Index ...
|
||||||
const T &source[], // Source ...
|
const T &source[], // Source ...
|
||||||
@@ -4749,7 +4749,7 @@ T FindBiggerThan(
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
template <typename T>
|
template <typename T>
|
||||||
T FindBiggerThan(
|
T FindBiggerThanByIndex(
|
||||||
T value, // Specified Value ...
|
T value, // Specified Value ...
|
||||||
int &index, // Item Index ...
|
int &index, // Item Index ...
|
||||||
const T &source[], // Source ...
|
const T &source[], // Source ...
|
||||||
|
|||||||
@@ -5791,6 +5791,36 @@ struct XBoxZone
|
|||||||
//
|
//
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Retrieve Unique Middle Identifier ...
|
||||||
|
*
|
||||||
|
* @return ( string )
|
||||||
|
*/
|
||||||
|
string GetMiddleTag()
|
||||||
|
{
|
||||||
|
//
|
||||||
|
int digits = GetDigits(symbol);
|
||||||
|
double nMid = NormalizeDouble(NormalizePrice(GetMid(), symbol), digits);
|
||||||
|
|
||||||
|
//
|
||||||
|
string typeStr = IsValid(type)
|
||||||
|
? type
|
||||||
|
: "XBOX";
|
||||||
|
string result =
|
||||||
|
//
|
||||||
|
typeStr + "_" +
|
||||||
|
"Mid_" +
|
||||||
|
ToString(dir) + "_" +
|
||||||
|
symbol + "_" +
|
||||||
|
ToString(period) + "_" +
|
||||||
|
ToString(nMid)
|
||||||
|
//
|
||||||
|
;
|
||||||
|
|
||||||
|
//
|
||||||
|
return result;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -84,8 +84,12 @@ class XCXCAEAPOIDrawer : public XCBase
|
|||||||
|
|
||||||
//
|
//
|
||||||
// Drawers ...
|
// Drawers ...
|
||||||
|
bool drawSWHPivots;
|
||||||
|
bool drawSWLPivots;
|
||||||
bool drawPeakPivots;
|
bool drawPeakPivots;
|
||||||
bool drawValePivots;
|
bool drawValePivots;
|
||||||
|
bool drawOBBullishPivots;
|
||||||
|
bool drawOBBearishPivots;
|
||||||
bool drawFVGBullishPivots;
|
bool drawFVGBullishPivots;
|
||||||
bool drawFVGBearishPivots;
|
bool drawFVGBearishPivots;
|
||||||
bool drawTrendBullishPivots;
|
bool drawTrendBullishPivots;
|
||||||
@@ -98,10 +102,18 @@ class XCXCAEAPOIDrawer : public XCBase
|
|||||||
XCAPivotStyle defaultBullishStyle;
|
XCAPivotStyle defaultBullishStyle;
|
||||||
XCAPivotStyle defaultBearishStyle;
|
XCAPivotStyle defaultBearishStyle;
|
||||||
|
|
||||||
|
//
|
||||||
|
XCAPivotStyle swhPivotStyle;
|
||||||
|
XCAPivotStyle swlPivotStyle;
|
||||||
|
|
||||||
//
|
//
|
||||||
XCAPivotStyle peakPivotStyle;
|
XCAPivotStyle peakPivotStyle;
|
||||||
XCAPivotStyle valePivotStyle;
|
XCAPivotStyle valePivotStyle;
|
||||||
|
|
||||||
|
//
|
||||||
|
XCAPivotStyle obBullishPivotStyle;
|
||||||
|
XCAPivotStyle obBearishPivotStyle;
|
||||||
|
|
||||||
//
|
//
|
||||||
XCAPivotStyle fvgBullishPivotStyle;
|
XCAPivotStyle fvgBullishPivotStyle;
|
||||||
XCAPivotStyle fvgBearishPivotStyle;
|
XCAPivotStyle fvgBearishPivotStyle;
|
||||||
@@ -147,8 +159,12 @@ class XCXCAEAPOIDrawer : public XCBase
|
|||||||
{
|
{
|
||||||
//
|
//
|
||||||
// Drawing ...
|
// Drawing ...
|
||||||
|
drawSWHPivots = false;
|
||||||
|
drawSWLPivots = false;
|
||||||
drawPeakPivots = false;
|
drawPeakPivots = false;
|
||||||
drawValePivots = false;
|
drawValePivots = false;
|
||||||
|
drawOBBullishPivots = false;
|
||||||
|
drawOBBearishPivots = false;
|
||||||
drawFVGBullishPivots = false;
|
drawFVGBullishPivots = false;
|
||||||
drawFVGBearishPivots = false;
|
drawFVGBearishPivots = false;
|
||||||
drawTrendBullishPivots = false;
|
drawTrendBullishPivots = false;
|
||||||
@@ -172,11 +188,21 @@ class XCXCAEAPOIDrawer : public XCBase
|
|||||||
//
|
//
|
||||||
// Pivots ...
|
// Pivots ...
|
||||||
|
|
||||||
|
//
|
||||||
|
// SWING ...
|
||||||
|
swhPivotStyle = defaultBearishStyle;
|
||||||
|
swlPivotStyle = defaultBullishStyle;
|
||||||
|
|
||||||
//
|
//
|
||||||
// PV ...
|
// PV ...
|
||||||
peakPivotStyle = defaultBearishStyle;
|
peakPivotStyle = defaultBearishStyle;
|
||||||
valePivotStyle = defaultBullishStyle;
|
valePivotStyle = defaultBullishStyle;
|
||||||
|
|
||||||
|
//
|
||||||
|
// OB ...
|
||||||
|
obBullishPivotStyle = defaultBullishStyle;
|
||||||
|
obBearishPivotStyle = defaultBearishStyle;
|
||||||
|
|
||||||
//
|
//
|
||||||
// FVG ...
|
// FVG ...
|
||||||
fvgBullishPivotStyle = defaultBullishStyle;
|
fvgBullishPivotStyle = defaultBullishStyle;
|
||||||
@@ -191,11 +217,21 @@ class XCXCAEAPOIDrawer : public XCBase
|
|||||||
//
|
//
|
||||||
void Draw(datetime to = NULL)
|
void Draw(datetime to = NULL)
|
||||||
{
|
{
|
||||||
|
//
|
||||||
|
// SWING ...
|
||||||
|
DrawSWHPivots(to);
|
||||||
|
DrawSWLPivots(to);
|
||||||
|
|
||||||
//
|
//
|
||||||
// PV ...
|
// PV ...
|
||||||
DrawPeakPivots(to);
|
DrawPeakPivots(to);
|
||||||
DrawValePivots(to);
|
DrawValePivots(to);
|
||||||
|
|
||||||
|
//
|
||||||
|
// OB ...
|
||||||
|
DrawOBBullishPivots(to);
|
||||||
|
DrawOBBearishPivots(to);
|
||||||
|
|
||||||
//
|
//
|
||||||
// FVG ...
|
// FVG ...
|
||||||
DrawFVGBullishPivots(to);
|
DrawFVGBullishPivots(to);
|
||||||
@@ -210,7 +246,9 @@ class XCXCAEAPOIDrawer : public XCBase
|
|||||||
//
|
//
|
||||||
void DrawBox(
|
void DrawBox(
|
||||||
XBoxZone &box,
|
XBoxZone &box,
|
||||||
datetime to = NULL //
|
datetime to = NULL,
|
||||||
|
bool drawMiddle = false,
|
||||||
|
bool ignoreType = false //
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
@@ -219,78 +257,205 @@ class XCXCAEAPOIDrawer : public XCBase
|
|||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Detect Pivot Type ...
|
bool canUpdateTo = IsValid(to);
|
||||||
ENUM_XCA_PIVOTS iType = GetPivotType(box);
|
if (canUpdateTo)
|
||||||
has = IsValid(iType);
|
|
||||||
if (!has)
|
|
||||||
{
|
{
|
||||||
return;
|
box.to = to;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
switch (iType)
|
// Draw Box as POI ...
|
||||||
|
if (!ignoreType)
|
||||||
{
|
{
|
||||||
//
|
|
||||||
case XCA_PEAK:
|
|
||||||
//
|
//
|
||||||
DrawPeakPivot(
|
// Detect Pivot Type ...
|
||||||
box,
|
ENUM_XCA_PIVOTS iType = GetPivotType(box);
|
||||||
to //
|
has = IsValid(iType);
|
||||||
);
|
if (!has)
|
||||||
break;
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
case XCA_VALE:
|
switch (iType)
|
||||||
|
{
|
||||||
//
|
//
|
||||||
DrawValePivot(
|
case XCA_SWH:
|
||||||
box,
|
//
|
||||||
to //
|
DrawSWHPivot(
|
||||||
);
|
box,
|
||||||
break;
|
to //
|
||||||
|
);
|
||||||
|
break;
|
||||||
|
|
||||||
//
|
//
|
||||||
case XCA_FVG_BULL:
|
case XCA_SWL:
|
||||||
//
|
//
|
||||||
DrawFVGBullishPivot(
|
DrawSWLPivot(
|
||||||
box,
|
box,
|
||||||
to //
|
to //
|
||||||
);
|
);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
//
|
|
||||||
case XCA_FVG_BEAR:
|
|
||||||
//
|
//
|
||||||
DrawFVGBearishPivot(
|
case XCA_PEAK:
|
||||||
box,
|
//
|
||||||
to //
|
DrawPeakPivot(
|
||||||
);
|
box,
|
||||||
break;
|
to //
|
||||||
|
);
|
||||||
|
break;
|
||||||
|
|
||||||
//
|
//
|
||||||
case XCA_TREND_BULL:
|
case XCA_VALE:
|
||||||
//
|
//
|
||||||
DrawTrendBullishPivot(
|
DrawValePivot(
|
||||||
box,
|
box,
|
||||||
to //
|
to //
|
||||||
);
|
);
|
||||||
break;
|
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,
|
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(
|
void DrawBoxes(
|
||||||
XBoxZone &boxes[],
|
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 ...
|
// Detect Pivot Type ...
|
||||||
DrawBox(
|
DrawBox(
|
||||||
iBox,
|
iBox,
|
||||||
to //
|
to,
|
||||||
|
drawMiddle,
|
||||||
|
ignoreType //
|
||||||
);
|
);
|
||||||
|
|
||||||
//
|
//
|
||||||
@@ -329,8 +496,12 @@ class XCXCAEAPOIDrawer : public XCBase
|
|||||||
|
|
||||||
//
|
//
|
||||||
// Cleanup Styles ...
|
// Cleanup Styles ...
|
||||||
|
swhPivotStyle.Clean();
|
||||||
|
swlPivotStyle.Clean();
|
||||||
peakPivotStyle.Clean();
|
peakPivotStyle.Clean();
|
||||||
valePivotStyle.Clean();
|
valePivotStyle.Clean();
|
||||||
|
obBullishPivotStyle.Clean();
|
||||||
|
obBearishPivotStyle.Clean();
|
||||||
fvgBullishPivotStyle.Clean();
|
fvgBullishPivotStyle.Clean();
|
||||||
fvgBearishPivotStyle.Clean();
|
fvgBearishPivotStyle.Clean();
|
||||||
trendBullishPivotStyle.Clean();
|
trendBullishPivotStyle.Clean();
|
||||||
@@ -338,8 +509,13 @@ class XCXCAEAPOIDrawer : public XCBase
|
|||||||
|
|
||||||
//
|
//
|
||||||
// Cleanup Pivot Objects Holder ...
|
// Cleanup Pivot Objects Holder ...
|
||||||
|
mObjects.Clear();
|
||||||
|
mSWHPivotObjects.Clear();
|
||||||
|
mSWLPivotObjects.Clear();
|
||||||
mPeakPivotObjects.Clear();
|
mPeakPivotObjects.Clear();
|
||||||
mValePivotObjects.Clear();
|
mValePivotObjects.Clear();
|
||||||
|
mOBBullishPivotObjects.Clear();
|
||||||
|
mOBBearishPivotObjects.Clear();
|
||||||
mFVGBullishPivotObjects.Clear();
|
mFVGBullishPivotObjects.Clear();
|
||||||
mFVGBearishPivotObjects.Clear();
|
mFVGBearishPivotObjects.Clear();
|
||||||
mTrendBullishPivotObjects.Clear();
|
mTrendBullishPivotObjects.Clear();
|
||||||
@@ -349,6 +525,76 @@ class XCXCAEAPOIDrawer : public XCBase
|
|||||||
//
|
//
|
||||||
// Collection Drawers ...
|
// 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)
|
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)
|
void DrawFVGBullishPivots(datetime to = NULL)
|
||||||
{
|
{
|
||||||
@@ -562,6 +878,112 @@ class XCXCAEAPOIDrawer : public XCBase
|
|||||||
//
|
//
|
||||||
// One Item Drawers ...
|
// 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(
|
void DrawPeakPivot(
|
||||||
XBoxZone &item,
|
XBoxZone &item,
|
||||||
@@ -668,6 +1090,112 @@ class XCXCAEAPOIDrawer : public XCBase
|
|||||||
ZeroMemory(iObj);
|
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(
|
void DrawFVGBullishPivot(
|
||||||
XBoxZone &item,
|
XBoxZone &item,
|
||||||
@@ -914,10 +1442,21 @@ class XCXCAEAPOIDrawer : public XCBase
|
|||||||
XCPOIDrawer *drawer;
|
XCPOIDrawer *drawer;
|
||||||
XCXCAEAPOIDetector *detector;
|
XCXCAEAPOIDetector *detector;
|
||||||
|
|
||||||
|
//
|
||||||
|
CArrayObj mObjects;
|
||||||
|
|
||||||
|
//
|
||||||
|
CArrayObj mSWHPivotObjects;
|
||||||
|
CArrayObj mSWLPivotObjects;
|
||||||
|
|
||||||
//
|
//
|
||||||
CArrayObj mPeakPivotObjects;
|
CArrayObj mPeakPivotObjects;
|
||||||
CArrayObj mValePivotObjects;
|
CArrayObj mValePivotObjects;
|
||||||
|
|
||||||
|
//
|
||||||
|
CArrayObj mOBBullishPivotObjects;
|
||||||
|
CArrayObj mOBBearishPivotObjects;
|
||||||
|
|
||||||
//
|
//
|
||||||
CArrayObj mFVGBullishPivotObjects;
|
CArrayObj mFVGBullishPivotObjects;
|
||||||
CArrayObj mFVGBearishPivotObjects;
|
CArrayObj mFVGBearishPivotObjects;
|
||||||
|
|||||||
@@ -1773,6 +1773,11 @@ bool CanTriggerCond3(
|
|||||||
barIndex //
|
barIndex //
|
||||||
);
|
);
|
||||||
|
|
||||||
|
//
|
||||||
|
// Validate Box ...
|
||||||
|
// For Box Validating we use 50% of Box Range ...
|
||||||
|
// if Price Touched Box 50% rate we Invalidate Box ...
|
||||||
|
|
||||||
//
|
//
|
||||||
// Detect Box FVG ...
|
// Detect Box FVG ...
|
||||||
|
|
||||||
|
|||||||
@@ -40,13 +40,11 @@ class XCXCAEASignaller : XCBase
|
|||||||
//
|
//
|
||||||
// Props ...
|
// Props ...
|
||||||
bool useGuards;
|
bool useGuards;
|
||||||
bool useTargets;
|
|
||||||
int poiLoopback;
|
int poiLoopback;
|
||||||
XCAEAInputs inputs;
|
XCAEAInputs inputs;
|
||||||
XBarTracker barTraker;
|
XBarTracker barTraker;
|
||||||
XCXCAEAHelper *helper;
|
XCXCAEAHelper *helper;
|
||||||
XCXCAEAPOIDrawer *drawer;
|
XCXCAEAPOIDrawer *drawer;
|
||||||
bool continuesRFTillTarget;
|
|
||||||
XBoxZone unAvailableBoxes[];
|
XBoxZone unAvailableBoxes[];
|
||||||
XCXCAEAHelper *analyseHelper;
|
XCXCAEAHelper *analyseHelper;
|
||||||
XCXCAEAPOIDetector *detector;
|
XCXCAEAPOIDetector *detector;
|
||||||
@@ -87,8 +85,6 @@ class XCXCAEASignaller : XCBase
|
|||||||
{
|
{
|
||||||
//
|
//
|
||||||
useGuards = false;
|
useGuards = false;
|
||||||
useTargets = true;
|
|
||||||
continuesRFTillTarget = false;
|
|
||||||
|
|
||||||
//
|
//
|
||||||
barTraker.Init(
|
barTraker.Init(
|
||||||
@@ -97,248 +93,12 @@ class XCXCAEASignaller : XCBase
|
|||||||
);
|
);
|
||||||
|
|
||||||
//
|
//
|
||||||
inputs.Default();
|
// Initial Indicators ...
|
||||||
|
InitHelper();
|
||||||
|
|
||||||
//
|
//
|
||||||
// Configure Indicators ...
|
// Initial POI Detector and Drawer ...
|
||||||
|
InitDetectorAndDrawer();
|
||||||
//
|
|
||||||
// XCC ...
|
|
||||||
inputs.ccInputs.showCandles = true;
|
|
||||||
|
|
||||||
//
|
|
||||||
// XCT ...
|
|
||||||
inputs.ctInputs.showCandleTime = true;
|
|
||||||
|
|
||||||
//
|
|
||||||
// XCA ...
|
|
||||||
|
|
||||||
//
|
|
||||||
inputs.caInputs.supResSmoothingLength = 7;
|
|
||||||
inputs.caInputs.supResSmoothingMode = X_MA_MODE_NONE;
|
|
||||||
|
|
||||||
//
|
|
||||||
inputs.x3maInputs.applyColor = true;
|
|
||||||
|
|
||||||
//
|
|
||||||
inputs.x3maInputs.fastLength = 5;
|
|
||||||
|
|
||||||
//
|
|
||||||
inputs.x3maInputs.showFast = false;
|
|
||||||
inputs.x3maInputs.showSlow = false;
|
|
||||||
inputs.x3maInputs.showMedium = false;
|
|
||||||
|
|
||||||
//
|
|
||||||
inputs.caInputs.showMAH = false;
|
|
||||||
inputs.caInputs.showMAL = false;
|
|
||||||
inputs.caInputs.showMAC = false;
|
|
||||||
inputs.caInputs.showSar = false;
|
|
||||||
inputs.caInputs.showSwings = true;
|
|
||||||
inputs.caInputs.showFiboLevel1 = false;
|
|
||||||
inputs.caInputs.showFiboLevel2 = false;
|
|
||||||
inputs.caInputs.showFiboLevel3 = false;
|
|
||||||
inputs.caInputs.showFiboLevel4 = false;
|
|
||||||
inputs.caInputs.showFiboLevel5 = false;
|
|
||||||
inputs.caInputs.showPeaksAndVales = true;
|
|
||||||
|
|
||||||
//
|
|
||||||
inputs.caInputs.showKI = false;
|
|
||||||
inputs.caInputs.showTKI = false;
|
|
||||||
inputs.caInputs.showVidya = false;
|
|
||||||
inputs.caInputs.showTrend = false;
|
|
||||||
inputs.caInputs.showPeakAndValeGolden = false;
|
|
||||||
inputs.caInputs.showSupportAndResistance = false;
|
|
||||||
|
|
||||||
//
|
|
||||||
// XOSCS ...
|
|
||||||
// inputs.oscsInputs.rsiLength = 5;
|
|
||||||
// inputs.oscsInputs.rsiOBLevel = 90;
|
|
||||||
// inputs.oscsInputs.rsiOSLevel = 10;
|
|
||||||
// inputs.oscsInputs.cciLength = 7;
|
|
||||||
// inputs.oscsInputs.cciOBLevel = 130;
|
|
||||||
// inputs.oscsInputs.cciOSLevel = -130;
|
|
||||||
// inputs.oscsInputs.mfiLength = 5;
|
|
||||||
// inputs.oscsInputs.rviLength = 5;
|
|
||||||
|
|
||||||
//
|
|
||||||
// Oscillators Views ...
|
|
||||||
inputs.showRSI = false;
|
|
||||||
inputs.showCCI = false;
|
|
||||||
inputs.showMFI = false;
|
|
||||||
inputs.showRVI = false;
|
|
||||||
inputs.showADX = false;
|
|
||||||
inputs.showMACD = false;
|
|
||||||
|
|
||||||
//
|
|
||||||
// XCAEA Helper ...
|
|
||||||
helper = new XCXCAEAHelper();
|
|
||||||
helper.Init(
|
|
||||||
symbol,
|
|
||||||
period,
|
|
||||||
inputs //
|
|
||||||
);
|
|
||||||
|
|
||||||
//
|
|
||||||
// XCAEA Analyse Helper ...
|
|
||||||
analyseHelper = new XCXCAEAHelper();
|
|
||||||
analyseHelper.Init(
|
|
||||||
symbol,
|
|
||||||
analysePeriod,
|
|
||||||
inputs //
|
|
||||||
);
|
|
||||||
|
|
||||||
//
|
|
||||||
// Initialize and Configure Detector ...
|
|
||||||
detector = new XCXCAEAPOIDetector(helper);
|
|
||||||
|
|
||||||
//
|
|
||||||
// Common Configurations ...
|
|
||||||
detector.maxAllowedPivots = 0;
|
|
||||||
detector.pivotVerifications = 5;
|
|
||||||
detector.ticksDividerInPoints = 15;
|
|
||||||
detector.pivotDetectionLoopbac = 1000;
|
|
||||||
|
|
||||||
//
|
|
||||||
// Configure Detector ...
|
|
||||||
|
|
||||||
//
|
|
||||||
// PV ...
|
|
||||||
|
|
||||||
//
|
|
||||||
detector.maxAllowedPVLifetime = 0;
|
|
||||||
detector.applySwingsOnPVPivots = true;
|
|
||||||
detector.selectRejectedPVPivots = true;
|
|
||||||
detector.selectEngulfedPVPivots = true;
|
|
||||||
detector.applySupportAndResistanceOnPVPivots = true;
|
|
||||||
|
|
||||||
//
|
|
||||||
// PEAK ...
|
|
||||||
detector.detectPeakPivots = true;
|
|
||||||
|
|
||||||
//
|
|
||||||
// VALE ...
|
|
||||||
detector.detectValePivots = true;
|
|
||||||
|
|
||||||
//
|
|
||||||
// FVG ...
|
|
||||||
|
|
||||||
//
|
|
||||||
detector.selectSameBarFVGs = false;
|
|
||||||
detector.maxAllowedFVGLifetime = 0;
|
|
||||||
detector.validateFVGUsingPV = false;
|
|
||||||
detector.applyPVToFVGBoundary = false;
|
|
||||||
detector.selectRejectedFVGPivots = false;
|
|
||||||
detector.selectEngulfedFVGPivots = false;
|
|
||||||
detector.validateFVGUsingManalyser = true;
|
|
||||||
detector.applyLastBarToFVGBoundary = false;
|
|
||||||
detector.selectOnlyFVGWhichHasIndirectionalLastBar = true;
|
|
||||||
|
|
||||||
//
|
|
||||||
// Bullish ...
|
|
||||||
detector.detectFVGBullishPivots = true;
|
|
||||||
|
|
||||||
//
|
|
||||||
// Bearish ...
|
|
||||||
detector.detectFVGBearishPivots = true;
|
|
||||||
|
|
||||||
//
|
|
||||||
// TREND ...
|
|
||||||
|
|
||||||
//
|
|
||||||
detector.maxAllowedTrendLifetime = 0;
|
|
||||||
|
|
||||||
//
|
|
||||||
// Bullish ...
|
|
||||||
detector.detectTrendBullishPivots = true;
|
|
||||||
|
|
||||||
//
|
|
||||||
// Bearish ...
|
|
||||||
detector.detectTrendBearishPivots = true;
|
|
||||||
|
|
||||||
//
|
|
||||||
// DRAWER ...
|
|
||||||
|
|
||||||
//
|
|
||||||
// Initialize and Configure Drawer ...
|
|
||||||
drawer = new XCXCAEAPOIDrawer(detector);
|
|
||||||
|
|
||||||
//
|
|
||||||
drawer.ignoreUpdateOSCTos = true;
|
|
||||||
|
|
||||||
//
|
|
||||||
// Configure Drawer ...
|
|
||||||
drawer.drawPeakPivots = true;
|
|
||||||
drawer.drawValePivots = true;
|
|
||||||
drawer.drawFVGBullishPivots = true;
|
|
||||||
drawer.drawFVGBearishPivots = true;
|
|
||||||
drawer.drawTrendBullishPivots = true;
|
|
||||||
drawer.drawTrendBearishPivots = true;
|
|
||||||
|
|
||||||
//
|
|
||||||
// Configure Styles ...
|
|
||||||
|
|
||||||
//
|
|
||||||
// PV ...
|
|
||||||
|
|
||||||
//
|
|
||||||
// PEAK ...
|
|
||||||
XCAPivotStyle peakStyle;
|
|
||||||
peakStyle.width = 2;
|
|
||||||
peakStyle.clr = clrMagenta;
|
|
||||||
peakStyle.style = STYLE_SOLID;
|
|
||||||
drawer.peakPivotStyle = peakStyle;
|
|
||||||
peakStyle.Clean();
|
|
||||||
|
|
||||||
//
|
|
||||||
// VALE ...
|
|
||||||
XCAPivotStyle valeStyle;
|
|
||||||
valeStyle.width = 2;
|
|
||||||
valeStyle.clr = clrAqua;
|
|
||||||
valeStyle.style = STYLE_SOLID;
|
|
||||||
drawer.valePivotStyle = valeStyle;
|
|
||||||
valeStyle.Clean();
|
|
||||||
|
|
||||||
//
|
|
||||||
// FVG ...
|
|
||||||
|
|
||||||
//
|
|
||||||
// Bullish ...
|
|
||||||
XCAPivotStyle fvgBullishStyle;
|
|
||||||
fvgBullishStyle.width = 2;
|
|
||||||
fvgBullishStyle.clr = clrLime;
|
|
||||||
fvgBullishStyle.style = STYLE_DASH;
|
|
||||||
drawer.fvgBullishPivotStyle = fvgBullishStyle;
|
|
||||||
fvgBullishStyle.Clean();
|
|
||||||
|
|
||||||
//
|
|
||||||
// Bearish ...
|
|
||||||
XCAPivotStyle fvgBearishStyle;
|
|
||||||
fvgBearishStyle.width = 2;
|
|
||||||
fvgBearishStyle.clr = clrRed;
|
|
||||||
fvgBearishStyle.style = STYLE_DASH;
|
|
||||||
drawer.fvgBearishPivotStyle = fvgBearishStyle;
|
|
||||||
fvgBearishStyle.Clean();
|
|
||||||
|
|
||||||
//
|
|
||||||
// TREND ...
|
|
||||||
|
|
||||||
//
|
|
||||||
// Bullish ...
|
|
||||||
XCAPivotStyle trendBullishStyle;
|
|
||||||
trendBullishStyle.width = 2;
|
|
||||||
trendBullishStyle.clr = clrLime;
|
|
||||||
trendBullishStyle.style = STYLE_DOT;
|
|
||||||
drawer.trendBullishPivotStyle = trendBullishStyle;
|
|
||||||
trendBullishStyle.Clean();
|
|
||||||
|
|
||||||
//
|
|
||||||
// Bearish ...
|
|
||||||
XCAPivotStyle trendBearishStyle;
|
|
||||||
trendBearishStyle.width = 2;
|
|
||||||
trendBearishStyle.clr = clrRed;
|
|
||||||
trendBearishStyle.style = STYLE_DOT;
|
|
||||||
drawer.trendBearishPivotStyle = trendBearishStyle;
|
|
||||||
trendBearishStyle.Clean();
|
|
||||||
|
|
||||||
//
|
//
|
||||||
}
|
}
|
||||||
@@ -465,39 +225,50 @@ class XCXCAEASignaller : XCBase
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// Detect Pivots ...
|
||||||
|
detector.Detect(zIndex);
|
||||||
|
|
||||||
|
//
|
||||||
|
// Validate Pivots ...
|
||||||
|
detector.Validate(
|
||||||
|
unAvailableBoxes,
|
||||||
|
zIndex //
|
||||||
|
);
|
||||||
|
|
||||||
|
//
|
||||||
|
// Draw Pivots ...
|
||||||
|
drawer.Draw(cTime);
|
||||||
|
|
||||||
//
|
//
|
||||||
// Setup Conditions ...
|
// Setup Conditions ...
|
||||||
XBoxZone decisionZone;
|
XBoxZone decisionZone;
|
||||||
bool hasDecisionZone = false;
|
|
||||||
XCAEAConditions conditions;
|
XCAEAConditions conditions;
|
||||||
|
bool hasDecisionZone = false;
|
||||||
ENUM_X_DIRECTION decisionZoneDir = X_DIRECTION_NONE;
|
ENUM_X_DIRECTION decisionZoneDir = X_DIRECTION_NONE;
|
||||||
|
|
||||||
//
|
//
|
||||||
// Checking Signal's Decision Zone ...
|
// Checking Signal's Decision Zone ...
|
||||||
// On Analyse Time Frame ...
|
// On Analyse Time Frame ...
|
||||||
if (!HasChild(mConditionsCollection))
|
hasDecisionZone = DetectDecisionZone(
|
||||||
|
analyseHelper,
|
||||||
|
drawer,
|
||||||
|
decisionZone,
|
||||||
|
decisionZoneDir,
|
||||||
|
conditions,
|
||||||
|
zIndex,
|
||||||
|
loopback //
|
||||||
|
);
|
||||||
|
|
||||||
|
//
|
||||||
|
// Make Signal Box UnAvailable ...
|
||||||
|
if (hasDecisionZone)
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
hasDecisionZone = DetectDecisionZone(
|
AddRef(
|
||||||
analyseHelper,
|
|
||||||
drawer,
|
|
||||||
decisionZone,
|
decisionZone,
|
||||||
decisionZoneDir,
|
unAvailableBoxes //
|
||||||
conditions,
|
|
||||||
zIndex,
|
|
||||||
loopback //
|
|
||||||
);
|
);
|
||||||
|
|
||||||
//
|
|
||||||
// Make Signal Box UnAvailable ...
|
|
||||||
if (hasDecisionZone)
|
|
||||||
{
|
|
||||||
//
|
|
||||||
AddRef(
|
|
||||||
decisionZone,
|
|
||||||
unAvailableBoxes //
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
@@ -558,7 +329,7 @@ class XCXCAEASignaller : XCBase
|
|||||||
bool DetectSignalTrigger(
|
bool DetectSignalTrigger(
|
||||||
XCAEAStrategyConditions &conditions,
|
XCAEAStrategyConditions &conditions,
|
||||||
int barIndex = 0,
|
int barIndex = 0,
|
||||||
int maxAllowedSetupAge = 1000 //
|
int maxAllowedSetupAge = 576 //
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
@@ -683,16 +454,49 @@ class XCXCAEASignaller : XCBase
|
|||||||
|
|
||||||
//
|
//
|
||||||
// Draw Decision Zone ...
|
// Draw Decision Zone ...
|
||||||
XCBoxObject *iObj;
|
XCBoxObject *iDecisionObj;
|
||||||
has = helper.poiDrawer.DrawBox(
|
has = helper.poiDrawer.DrawBox(
|
||||||
conditions.decisionZone,
|
conditions.decisionZone,
|
||||||
iObj //
|
iDecisionObj //
|
||||||
);
|
);
|
||||||
if (has)
|
if (has)
|
||||||
{
|
{
|
||||||
mObjects.Add(iObj);
|
mObjects.Add(iDecisionObj);
|
||||||
}
|
}
|
||||||
ZeroMemory(iObj);
|
ZeroMemory(iDecisionObj);
|
||||||
|
|
||||||
|
//
|
||||||
|
// Drw Box Range Middle ...
|
||||||
|
double decisionMiddlePrice = conditions.decisionZone.GetMid();
|
||||||
|
string iDecisionMiddleName = conditions.decisionZone.GetMiddleTag();
|
||||||
|
CChartObjectTrend *iDecisionMiddleObj;
|
||||||
|
iDecisionMiddleObj = new CChartObjectTrend();
|
||||||
|
has = iDecisionMiddleObj.Create(
|
||||||
|
0,
|
||||||
|
iDecisionMiddleName,
|
||||||
|
0,
|
||||||
|
conditions.decisionZone.from,
|
||||||
|
decisionMiddlePrice,
|
||||||
|
conditions.decisionZone.to,
|
||||||
|
decisionMiddlePrice //
|
||||||
|
);
|
||||||
|
if (has)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
iDecisionMiddleObj.Width(2);
|
||||||
|
iDecisionMiddleObj.Style(STYLE_DASH);
|
||||||
|
|
||||||
|
//
|
||||||
|
color iColor =
|
||||||
|
conditions.decisionZone.IsBullish()
|
||||||
|
? clrAqua
|
||||||
|
: clrMagenta;
|
||||||
|
iDecisionMiddleObj.Color(iColor);
|
||||||
|
|
||||||
|
//
|
||||||
|
mObjects.Add(iDecisionMiddleObj);
|
||||||
|
}
|
||||||
|
ZeroMemory(iDecisionMiddleObj);
|
||||||
|
|
||||||
//
|
//
|
||||||
for (int i = 0; i < iObjects.Total(); i++)
|
for (int i = 0; i < iObjects.Total(); i++)
|
||||||
@@ -753,26 +557,26 @@ class XCXCAEASignaller : XCBase
|
|||||||
|
|
||||||
//
|
//
|
||||||
// Handling RF ...
|
// Handling RF ...
|
||||||
double rfReward = risk * 1.85;
|
// double rfReward = risk * 1.85;
|
||||||
double rfPrice =
|
// double rfPrice =
|
||||||
isBullish
|
// isBullish
|
||||||
? entry + rfReward
|
// ? entry + rfReward
|
||||||
: entry - rfReward;
|
// : entry - rfReward;
|
||||||
Add(
|
// Add(
|
||||||
rfPrice,
|
// rfPrice,
|
||||||
conditions.targets //
|
// conditions.targets //
|
||||||
);
|
// );
|
||||||
|
|
||||||
//
|
//
|
||||||
rfReward = risk * 2.85;
|
// rfReward = risk * 2.85;
|
||||||
rfPrice =
|
// rfPrice =
|
||||||
isBullish
|
// isBullish
|
||||||
? entry + rfReward
|
// ? entry + rfReward
|
||||||
: entry - rfReward;
|
// : entry - rfReward;
|
||||||
Add(
|
// Add(
|
||||||
rfPrice,
|
// rfPrice,
|
||||||
conditions.targets //
|
// conditions.targets //
|
||||||
);
|
// );
|
||||||
|
|
||||||
//
|
//
|
||||||
// Handling Partial Close ...
|
// Handling Partial Close ...
|
||||||
@@ -953,6 +757,308 @@ class XCXCAEASignaller : XCBase
|
|||||||
CArrayObj mObjects;
|
CArrayObj mObjects;
|
||||||
CArrayObj mBarObjects;
|
CArrayObj mBarObjects;
|
||||||
|
|
||||||
|
//
|
||||||
|
void InitHelper()
|
||||||
|
{
|
||||||
|
//
|
||||||
|
inputs.Default();
|
||||||
|
|
||||||
|
//
|
||||||
|
// Configure Indicators ...
|
||||||
|
|
||||||
|
//
|
||||||
|
// XCC ...
|
||||||
|
inputs.ccInputs.showCandles = true;
|
||||||
|
|
||||||
|
//
|
||||||
|
// XCT ...
|
||||||
|
inputs.ctInputs.showCandleTime = true;
|
||||||
|
|
||||||
|
//
|
||||||
|
// XCA ...
|
||||||
|
|
||||||
|
//
|
||||||
|
inputs.caInputs.supResSmoothingLength = 7;
|
||||||
|
inputs.caInputs.supResSmoothingMode = X_MA_MODE_NONE;
|
||||||
|
|
||||||
|
//
|
||||||
|
inputs.x3maInputs.applyColor = true;
|
||||||
|
|
||||||
|
//
|
||||||
|
inputs.x3maInputs.fastLength = 5;
|
||||||
|
|
||||||
|
//
|
||||||
|
inputs.x3maInputs.showFast = false;
|
||||||
|
inputs.x3maInputs.showSlow = false;
|
||||||
|
inputs.x3maInputs.showMedium = false;
|
||||||
|
|
||||||
|
//
|
||||||
|
inputs.caInputs.showMAH = false;
|
||||||
|
inputs.caInputs.showMAL = false;
|
||||||
|
inputs.caInputs.showMAC = false;
|
||||||
|
inputs.caInputs.showSar = false;
|
||||||
|
inputs.caInputs.showSwings = true;
|
||||||
|
inputs.caInputs.showFiboLevel1 = false;
|
||||||
|
inputs.caInputs.showFiboLevel2 = false;
|
||||||
|
inputs.caInputs.showFiboLevel3 = false;
|
||||||
|
inputs.caInputs.showFiboLevel4 = false;
|
||||||
|
inputs.caInputs.showFiboLevel5 = false;
|
||||||
|
inputs.caInputs.showPeaksAndVales = true;
|
||||||
|
|
||||||
|
//
|
||||||
|
inputs.caInputs.showKI = false;
|
||||||
|
inputs.caInputs.showTKI = false;
|
||||||
|
inputs.caInputs.showVidya = false;
|
||||||
|
inputs.caInputs.showTrend = false;
|
||||||
|
inputs.caInputs.showPeakAndValeGolden = false;
|
||||||
|
inputs.caInputs.showSupportAndResistance = false;
|
||||||
|
|
||||||
|
//
|
||||||
|
// XOSCS ...
|
||||||
|
// inputs.oscsInputs.rsiLength = 5;
|
||||||
|
// inputs.oscsInputs.rsiOBLevel = 90;
|
||||||
|
// inputs.oscsInputs.rsiOSLevel = 10;
|
||||||
|
// inputs.oscsInputs.cciLength = 7;
|
||||||
|
// inputs.oscsInputs.cciOBLevel = 130;
|
||||||
|
// inputs.oscsInputs.cciOSLevel = -130;
|
||||||
|
// inputs.oscsInputs.mfiLength = 5;
|
||||||
|
// inputs.oscsInputs.rviLength = 5;
|
||||||
|
|
||||||
|
//
|
||||||
|
// Oscillators Views ...
|
||||||
|
inputs.showRSI = false;
|
||||||
|
inputs.showCCI = false;
|
||||||
|
inputs.showMFI = false;
|
||||||
|
inputs.showRVI = false;
|
||||||
|
inputs.showADX = false;
|
||||||
|
inputs.showMACD = false;
|
||||||
|
|
||||||
|
//
|
||||||
|
// XCAEA Helper ...
|
||||||
|
helper = new XCXCAEAHelper();
|
||||||
|
helper.Init(
|
||||||
|
symbol,
|
||||||
|
period,
|
||||||
|
inputs //
|
||||||
|
);
|
||||||
|
|
||||||
|
//
|
||||||
|
// XCAEA Analyse Helper ...
|
||||||
|
analyseHelper = new XCXCAEAHelper();
|
||||||
|
analyseHelper.Init(
|
||||||
|
symbol,
|
||||||
|
analysePeriod,
|
||||||
|
inputs //
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
void InitDetectorAndDrawer()
|
||||||
|
{
|
||||||
|
//
|
||||||
|
// Initialize and Configure Detector ...
|
||||||
|
detector = new XCXCAEAPOIDetector(helper);
|
||||||
|
|
||||||
|
//
|
||||||
|
// Common Configurations ...
|
||||||
|
detector.maxAllowedPivots = 0;
|
||||||
|
detector.pivotVerifications = 5;
|
||||||
|
detector.ticksDividerInPoints = 15;
|
||||||
|
detector.pivotDetectionLoopbac = 1000;
|
||||||
|
|
||||||
|
//
|
||||||
|
// Configure Detector ...
|
||||||
|
|
||||||
|
//
|
||||||
|
// SWING ...
|
||||||
|
|
||||||
|
//
|
||||||
|
detector.maxAllowedSwingLifetime = 0;
|
||||||
|
|
||||||
|
//
|
||||||
|
detector.detectSWLPivots = false;
|
||||||
|
detector.detectSWHPivots = false;
|
||||||
|
|
||||||
|
//
|
||||||
|
// PV ...
|
||||||
|
|
||||||
|
//
|
||||||
|
detector.maxAllowedPVLifetime = 0;
|
||||||
|
detector.applySwingsOnPVPivots = false;
|
||||||
|
detector.selectRejectedPVPivots = false;
|
||||||
|
detector.selectEngulfedPVPivots = false;
|
||||||
|
detector.applySupportAndResistanceOnPVPivots = false;
|
||||||
|
|
||||||
|
//
|
||||||
|
detector.detectPeakPivots = true;
|
||||||
|
detector.detectValePivots = true;
|
||||||
|
|
||||||
|
//
|
||||||
|
// OB ...
|
||||||
|
detector.maxAllowedOBLifetime = 0;
|
||||||
|
|
||||||
|
//
|
||||||
|
detector.detectOBBullishPivots = true;
|
||||||
|
detector.detectOBBearishPivots = true;
|
||||||
|
|
||||||
|
//
|
||||||
|
// FVG ...
|
||||||
|
|
||||||
|
//
|
||||||
|
detector.selectSameBarFVGs = false;
|
||||||
|
detector.maxAllowedFVGLifetime = 0;
|
||||||
|
detector.validateFVGUsingPV = false;
|
||||||
|
detector.applyPVToFVGBoundary = false;
|
||||||
|
detector.selectRejectedFVGPivots = false;
|
||||||
|
detector.selectEngulfedFVGPivots = false;
|
||||||
|
detector.validateFVGUsingManalyser = false;
|
||||||
|
detector.applyLastBarToFVGBoundary = false;
|
||||||
|
detector.selectOnlyFVGWhichHasIndirectionalLastBar = false;
|
||||||
|
|
||||||
|
//
|
||||||
|
detector.detectFVGBullishPivots = false;
|
||||||
|
detector.detectFVGBearishPivots = false;
|
||||||
|
|
||||||
|
//
|
||||||
|
// TREND ...
|
||||||
|
|
||||||
|
//
|
||||||
|
detector.maxAllowedTrendLifetime = 0;
|
||||||
|
detector.detectTrendBullishPivots = false;
|
||||||
|
detector.detectTrendBearishPivots = false;
|
||||||
|
|
||||||
|
//
|
||||||
|
// DRAWER ...
|
||||||
|
|
||||||
|
//
|
||||||
|
// Initialize and Configure Drawer ...
|
||||||
|
drawer = new XCXCAEAPOIDrawer(detector);
|
||||||
|
|
||||||
|
//
|
||||||
|
drawer.ignoreUpdateOSCTos = true;
|
||||||
|
|
||||||
|
//
|
||||||
|
// Configure Drawer ...
|
||||||
|
drawer.drawSWHPivots = false;
|
||||||
|
drawer.drawSWLPivots = false;
|
||||||
|
drawer.drawPeakPivots = true;
|
||||||
|
drawer.drawValePivots = true;
|
||||||
|
drawer.drawOBBullishPivots = false;
|
||||||
|
drawer.drawOBBearishPivots = false;
|
||||||
|
drawer.drawFVGBullishPivots = false;
|
||||||
|
drawer.drawFVGBearishPivots = false;
|
||||||
|
drawer.drawTrendBullishPivots = false;
|
||||||
|
drawer.drawTrendBearishPivots = false;
|
||||||
|
|
||||||
|
//
|
||||||
|
// Configure Styles ...
|
||||||
|
|
||||||
|
//
|
||||||
|
// SWING ...
|
||||||
|
|
||||||
|
//
|
||||||
|
// SWH ...
|
||||||
|
XCAPivotStyle swhStyle;
|
||||||
|
swhStyle.width = 2;
|
||||||
|
swhStyle.clr = clrMagenta;
|
||||||
|
swhStyle.style = STYLE_SOLID;
|
||||||
|
drawer.swhPivotStyle = swhStyle;
|
||||||
|
swhStyle.Clean();
|
||||||
|
|
||||||
|
//
|
||||||
|
// SWL ...
|
||||||
|
XCAPivotStyle swlStyle;
|
||||||
|
swlStyle.width = 2;
|
||||||
|
swlStyle.clr = clrAqua;
|
||||||
|
swlStyle.style = STYLE_SOLID;
|
||||||
|
drawer.swlPivotStyle = swlStyle;
|
||||||
|
swlStyle.Clean();
|
||||||
|
|
||||||
|
//
|
||||||
|
// PV ...
|
||||||
|
|
||||||
|
//
|
||||||
|
// PEAK ...
|
||||||
|
XCAPivotStyle peakStyle;
|
||||||
|
peakStyle.width = 2;
|
||||||
|
peakStyle.clr = clrMagenta;
|
||||||
|
peakStyle.style = STYLE_SOLID;
|
||||||
|
drawer.peakPivotStyle = peakStyle;
|
||||||
|
peakStyle.Clean();
|
||||||
|
|
||||||
|
//
|
||||||
|
// VALE ...
|
||||||
|
XCAPivotStyle valeStyle;
|
||||||
|
valeStyle.width = 2;
|
||||||
|
valeStyle.clr = clrAqua;
|
||||||
|
valeStyle.style = STYLE_SOLID;
|
||||||
|
drawer.valePivotStyle = valeStyle;
|
||||||
|
valeStyle.Clean();
|
||||||
|
|
||||||
|
//
|
||||||
|
// OB ...
|
||||||
|
|
||||||
|
//
|
||||||
|
// Bullish ...
|
||||||
|
XCAPivotStyle obBullishStyle;
|
||||||
|
obBullishStyle.width = 2;
|
||||||
|
obBullishStyle.clr = clrLime;
|
||||||
|
obBullishStyle.style = STYLE_DASH;
|
||||||
|
drawer.obBullishPivotStyle = obBullishStyle;
|
||||||
|
obBullishStyle.Clean();
|
||||||
|
|
||||||
|
//
|
||||||
|
// Bearish ...
|
||||||
|
XCAPivotStyle obBearishStyle;
|
||||||
|
obBearishStyle.width = 2;
|
||||||
|
obBearishStyle.clr = clrRed;
|
||||||
|
obBearishStyle.style = STYLE_DASH;
|
||||||
|
drawer.obBearishPivotStyle = obBearishStyle;
|
||||||
|
obBearishStyle.Clean();
|
||||||
|
|
||||||
|
//
|
||||||
|
// FVG ...
|
||||||
|
|
||||||
|
//
|
||||||
|
// Bullish ...
|
||||||
|
XCAPivotStyle fvgBullishStyle;
|
||||||
|
fvgBullishStyle.width = 2;
|
||||||
|
fvgBullishStyle.clr = clrLime;
|
||||||
|
fvgBullishStyle.style = STYLE_DASH;
|
||||||
|
drawer.fvgBullishPivotStyle = fvgBullishStyle;
|
||||||
|
fvgBullishStyle.Clean();
|
||||||
|
|
||||||
|
//
|
||||||
|
// Bearish ...
|
||||||
|
XCAPivotStyle fvgBearishStyle;
|
||||||
|
fvgBearishStyle.width = 2;
|
||||||
|
fvgBearishStyle.clr = clrRed;
|
||||||
|
fvgBearishStyle.style = STYLE_DASH;
|
||||||
|
drawer.fvgBearishPivotStyle = fvgBearishStyle;
|
||||||
|
fvgBearishStyle.Clean();
|
||||||
|
|
||||||
|
//
|
||||||
|
// TREND ...
|
||||||
|
|
||||||
|
//
|
||||||
|
// Bullish ...
|
||||||
|
XCAPivotStyle trendBullishStyle;
|
||||||
|
trendBullishStyle.width = 2;
|
||||||
|
trendBullishStyle.clr = clrLime;
|
||||||
|
trendBullishStyle.style = STYLE_DOT;
|
||||||
|
drawer.trendBullishPivotStyle = trendBullishStyle;
|
||||||
|
trendBullishStyle.Clean();
|
||||||
|
|
||||||
|
//
|
||||||
|
// Bearish ...
|
||||||
|
XCAPivotStyle trendBearishStyle;
|
||||||
|
trendBearishStyle.width = 2;
|
||||||
|
trendBearishStyle.clr = clrRed;
|
||||||
|
trendBearishStyle.style = STYLE_DOT;
|
||||||
|
drawer.trendBearishPivotStyle = trendBearishStyle;
|
||||||
|
trendBearishStyle.Clean();
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user