last works on XCAEA Pivots ...
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -38,6 +38,9 @@ class XCXCAEAPOIDrawer : public XCBase
|
||||
//
|
||||
// Props ...
|
||||
|
||||
//
|
||||
bool ignoreUpdateOSCTos;
|
||||
|
||||
//
|
||||
// Drawers ...
|
||||
bool drawRSIPeakPivots;
|
||||
@@ -48,6 +51,8 @@ class XCXCAEAPOIDrawer : public XCBase
|
||||
bool drawFVGBearishPivots;
|
||||
bool drawValeSupSWLPivots;
|
||||
bool drawPeakResSWHPivots;
|
||||
bool drawPVFVGBullishPivots;
|
||||
bool drawPVFVGBearishPivots;
|
||||
|
||||
//
|
||||
// Colors ...
|
||||
@@ -65,6 +70,8 @@ class XCXCAEAPOIDrawer : public XCBase
|
||||
color fvgBearishPivotsColor;
|
||||
color valeSupSWLPivotsColor;
|
||||
color peakResSWHPivotsColor;
|
||||
color pvFVGBullishPivotsColor;
|
||||
color pvFVGBearishPivotsColor;
|
||||
|
||||
//
|
||||
// Width ...
|
||||
@@ -82,6 +89,8 @@ class XCXCAEAPOIDrawer : public XCBase
|
||||
int fvgBearishPivotsWidth;
|
||||
int valeSupSWLPivotsWidth;
|
||||
int peakResSWHPivotsWidth;
|
||||
int pvFVGBullishPivotsWidth;
|
||||
int pvFVGBearishPivotsWidth;
|
||||
|
||||
//
|
||||
// Style ...
|
||||
@@ -99,6 +108,8 @@ class XCXCAEAPOIDrawer : public XCBase
|
||||
ENUM_LINE_STYLE fvgBearishPivotsStyle;
|
||||
ENUM_LINE_STYLE valeSupSWLPivotsStyle;
|
||||
ENUM_LINE_STYLE peakResSWHPivotsStyle;
|
||||
ENUM_LINE_STYLE pvFVGBullishPivotsStyle;
|
||||
ENUM_LINE_STYLE pvFVGBearishPivotsStyle;
|
||||
|
||||
//
|
||||
// Colorize Props ...
|
||||
@@ -144,6 +155,9 @@ class XCXCAEAPOIDrawer : public XCBase
|
||||
//
|
||||
virtual void Default()
|
||||
{
|
||||
//
|
||||
ignoreUpdateOSCTos = true;
|
||||
|
||||
//
|
||||
drawRSIPeakPivots = false;
|
||||
drawRSIValePivots = false;
|
||||
@@ -153,6 +167,8 @@ class XCXCAEAPOIDrawer : public XCBase
|
||||
drawFVGBearishPivots = false;
|
||||
drawValeSupSWLPivots = false;
|
||||
drawPeakResSWHPivots = false;
|
||||
drawPVFVGBullishPivots = false;
|
||||
drawPVFVGBearishPivots = false;
|
||||
|
||||
//
|
||||
defaultBullishColor = clrLime;
|
||||
@@ -163,12 +179,14 @@ class XCXCAEAPOIDrawer : public XCBase
|
||||
cciValePivotsColor = defaultBullishColor;
|
||||
fvgBullishPivotsColor = defaultBullishColor;
|
||||
valeSupSWLPivotsColor = defaultBullishColor;
|
||||
pvFVGBullishPivotsColor = defaultBullishColor;
|
||||
|
||||
//
|
||||
rsiPeakPivotsColor = defaultBearishColor;
|
||||
cciPeakPivotsColor = defaultBearishColor;
|
||||
fvgBearishPivotsColor = defaultBearishColor;
|
||||
peakResSWHPivotsColor = defaultBearishColor;
|
||||
pvFVGBearishPivotsColor = defaultBearishColor;
|
||||
|
||||
//
|
||||
defaultBullishWidth = 1;
|
||||
@@ -179,12 +197,14 @@ class XCXCAEAPOIDrawer : public XCBase
|
||||
cciValePivotsWidth = defaultBullishWidth;
|
||||
fvgBullishPivotsWidth = defaultBullishWidth;
|
||||
valeSupSWLPivotsWidth = defaultBullishWidth;
|
||||
pvFVGBullishPivotsWidth = defaultBullishWidth;
|
||||
|
||||
//
|
||||
rsiPeakPivotsWidth = defaultBearishWidth;
|
||||
cciPeakPivotsWidth = defaultBearishWidth;
|
||||
fvgBearishPivotsWidth = defaultBearishWidth;
|
||||
peakResSWHPivotsWidth = defaultBearishWidth;
|
||||
pvFVGBearishPivotsWidth = defaultBearishWidth;
|
||||
|
||||
//
|
||||
defaultBullishStyle = STYLE_SOLID;
|
||||
@@ -195,12 +215,14 @@ class XCXCAEAPOIDrawer : public XCBase
|
||||
cciValePivotsStyle = defaultBullishStyle;
|
||||
fvgBullishPivotsStyle = defaultBullishStyle;
|
||||
valeSupSWLPivotsStyle = defaultBullishStyle;
|
||||
pvFVGBullishPivotsStyle = defaultBullishStyle;
|
||||
|
||||
//
|
||||
rsiPeakPivotsStyle = defaultBearishStyle;
|
||||
cciPeakPivotsStyle = defaultBearishStyle;
|
||||
fvgBearishPivotsStyle = defaultBearishStyle;
|
||||
peakResSWHPivotsStyle = defaultBearishStyle;
|
||||
pvFVGBearishPivotsStyle = defaultBearishStyle;
|
||||
}
|
||||
|
||||
//
|
||||
@@ -215,6 +237,8 @@ class XCXCAEAPOIDrawer : public XCBase
|
||||
DrawFVGBearishPivots(to);
|
||||
DrawValeSupSWLPivots(to);
|
||||
DrawPeakResSWHPivots(to);
|
||||
DrawPVFVGBullishPivots(to);
|
||||
DrawPVFVGBearishPivots(to);
|
||||
}
|
||||
|
||||
//
|
||||
@@ -229,6 +253,8 @@ class XCXCAEAPOIDrawer : public XCBase
|
||||
mFVGBearishPivotObjects.Clear();
|
||||
mValeSupSWLPivotObjects.Clear();
|
||||
mPeakResSWHPivotObjects.Clear();
|
||||
mPVFVGBullishPivotObjects.Clear();
|
||||
mPVFVGBearishPivotObjects.Clear();
|
||||
}
|
||||
|
||||
//
|
||||
@@ -253,6 +279,10 @@ class XCXCAEAPOIDrawer : public XCBase
|
||||
}
|
||||
|
||||
//
|
||||
if (ignoreUpdateOSCTos)
|
||||
{
|
||||
to = NULL;
|
||||
}
|
||||
bool canUpdateTo = IsValid(to);
|
||||
|
||||
//
|
||||
@@ -311,6 +341,10 @@ class XCXCAEAPOIDrawer : public XCBase
|
||||
}
|
||||
|
||||
//
|
||||
if (ignoreUpdateOSCTos)
|
||||
{
|
||||
to = NULL;
|
||||
}
|
||||
bool canUpdateTo = IsValid(to);
|
||||
|
||||
//
|
||||
@@ -369,6 +403,10 @@ class XCXCAEAPOIDrawer : public XCBase
|
||||
}
|
||||
|
||||
//
|
||||
if (ignoreUpdateOSCTos)
|
||||
{
|
||||
to = NULL;
|
||||
}
|
||||
bool canUpdateTo = IsValid(to);
|
||||
|
||||
//
|
||||
@@ -427,6 +465,10 @@ class XCXCAEAPOIDrawer : public XCBase
|
||||
}
|
||||
|
||||
//
|
||||
if (ignoreUpdateOSCTos)
|
||||
{
|
||||
to = NULL;
|
||||
}
|
||||
bool canUpdateTo = IsValid(to);
|
||||
|
||||
//
|
||||
@@ -699,6 +741,140 @@ class XCXCAEAPOIDrawer : public XCBase
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// Protected ...
|
||||
protected:
|
||||
@@ -724,6 +900,8 @@ class XCXCAEAPOIDrawer : public XCBase
|
||||
CArrayObj mFVGBearishPivotObjects;
|
||||
CArrayObj mValeSupSWLPivotObjects;
|
||||
CArrayObj mPeakResSWHPivotObjects;
|
||||
CArrayObj mPVFVGBullishPivotObjects;
|
||||
CArrayObj mPVFVGBearishPivotObjects;
|
||||
|
||||
//
|
||||
};
|
||||
|
||||
@@ -421,7 +421,7 @@ int AddGuard(
|
||||
|
||||
//
|
||||
bool DetectXCAEAConditions(
|
||||
XBoxZone &boxes[],
|
||||
XBoxZone &pivots[],
|
||||
XCAEAConditions &conditions,
|
||||
XBoxZone &pivotBox,
|
||||
XBoxZone &box,
|
||||
@@ -492,121 +492,6 @@ bool DetectXCAEAConditions(
|
||||
//
|
||||
// Reading Parameters ...
|
||||
|
||||
//
|
||||
// KI ...
|
||||
|
||||
//
|
||||
double cKI = conditions.kiBuffer[cIDX];
|
||||
double pKI = conditions.kiBuffer[pIDX];
|
||||
double p2KI = conditions.kiBuffer[p2IDX];
|
||||
|
||||
//
|
||||
double cKIState = conditions.kiStateBuffer[cIDX];
|
||||
double pKIState = conditions.kiStateBuffer[pIDX];
|
||||
double p2KIState = conditions.kiStateBuffer[p2IDX];
|
||||
|
||||
//
|
||||
// TKI ...
|
||||
|
||||
//
|
||||
double cTKI = conditions.tkiBuffer[cIDX];
|
||||
double pTKI = conditions.tkiBuffer[pIDX];
|
||||
double p2TKI = conditions.tkiBuffer[p2IDX];
|
||||
|
||||
//
|
||||
double cTKIState = conditions.tkiStateBuffer[cIDX];
|
||||
double pTKIState = conditions.tkiStateBuffer[pIDX];
|
||||
double p2TKIState = conditions.tkiStateBuffer[p2IDX];
|
||||
|
||||
//
|
||||
// TREND ...
|
||||
|
||||
//
|
||||
double cTrend = conditions.trendBuffer[cIDX];
|
||||
double pTrend = conditions.trendBuffer[pIDX];
|
||||
double p2Trend = conditions.trendBuffer[p2IDX];
|
||||
|
||||
//
|
||||
double ctrendState = conditions.trendStateBuffer[cIDX];
|
||||
double ptrendState = conditions.trendStateBuffer[pIDX];
|
||||
double p2trendState = conditions.trendStateBuffer[p2IDX];
|
||||
|
||||
//
|
||||
// SWING Low ...
|
||||
double cSWL = conditions.swingLowBuffer[cIDX];
|
||||
double pSWL = conditions.swingLowBuffer[pIDX];
|
||||
double p2SWL = conditions.swingLowBuffer[p2IDX];
|
||||
|
||||
//
|
||||
// SWING High ...
|
||||
double cSWH = conditions.swingHighBuffer[cIDX];
|
||||
double pSWH = conditions.swingHighBuffer[pIDX];
|
||||
double p2SWH = conditions.swingHighBuffer[p2IDX];
|
||||
|
||||
//
|
||||
// PEAK ...
|
||||
double zPeak = conditions.peakBuffer[zIDX];
|
||||
double cPeak = conditions.peakBuffer[cIDX];
|
||||
double pPeak = conditions.peakBuffer[pIDX];
|
||||
double p2Peak = conditions.peakBuffer[p2IDX];
|
||||
double p3Peak = conditions.peakBuffer[p3IDX];
|
||||
|
||||
//
|
||||
// VALE ...
|
||||
double zVale = conditions.valeBuffer[zIDX];
|
||||
double cVale = conditions.valeBuffer[cIDX];
|
||||
double pVale = conditions.valeBuffer[pIDX];
|
||||
double p2Vale = conditions.valeBuffer[p2IDX];
|
||||
double p3Vale = conditions.valeBuffer[p3IDX];
|
||||
|
||||
//
|
||||
// VIDYA ...
|
||||
double zVidya = conditions.vidyaBuffer[zIDX];
|
||||
double cVidya = conditions.vidyaBuffer[cIDX];
|
||||
double pVidya = conditions.vidyaBuffer[pIDX];
|
||||
double p2Vidya = conditions.vidyaBuffer[p2IDX];
|
||||
double p3Vidya = conditions.vidyaBuffer[p3IDX];
|
||||
|
||||
//
|
||||
double zVidyaState = conditions.vidyaStateBuffer[zIDX];
|
||||
double cVidyaState = conditions.vidyaStateBuffer[cIDX];
|
||||
double pVidyaState = conditions.vidyaStateBuffer[pIDX];
|
||||
double p2VidyaState = conditions.vidyaStateBuffer[p2IDX];
|
||||
double p3VidyaState = conditions.vidyaStateBuffer[p3IDX];
|
||||
|
||||
//
|
||||
// RSI ...
|
||||
double zRSI = conditions.rsiBuffer[zIDX];
|
||||
double cRSI = conditions.rsiBuffer[cIDX];
|
||||
double pRSI = conditions.rsiBuffer[pIDX];
|
||||
double p2RSI = conditions.rsiBuffer[p2IDX];
|
||||
double p3RSI = conditions.rsiBuffer[p3IDX];
|
||||
|
||||
//
|
||||
// CCI ...
|
||||
double zCCI = conditions.cciBuffer[zIDX];
|
||||
double cCCI = conditions.cciBuffer[cIDX];
|
||||
double pCCI = conditions.cciBuffer[pIDX];
|
||||
double p2CCI = conditions.cciBuffer[p2IDX];
|
||||
double p3CCI = conditions.cciBuffer[p3IDX];
|
||||
|
||||
//
|
||||
// RVI ...
|
||||
|
||||
//
|
||||
double zRVI = conditions.rviBuffer[zIDX];
|
||||
double cRVI = conditions.rviBuffer[cIDX];
|
||||
double pRVI = conditions.rviBuffer[pIDX];
|
||||
double p2RVI = conditions.rviBuffer[p2IDX];
|
||||
double p3RVI = conditions.rviBuffer[p3IDX];
|
||||
|
||||
//
|
||||
double zRVISignal = conditions.rviSignalBuffer[zIDX];
|
||||
double cRVISignal = conditions.rviSignalBuffer[cIDX];
|
||||
double pRVISignal = conditions.rviSignalBuffer[pIDX];
|
||||
double p2RVISignal = conditions.rviSignalBuffer[p2IDX];
|
||||
double p3RVISignal = conditions.rviSignalBuffer[p3IDX];
|
||||
|
||||
//
|
||||
// Reading Bars ...
|
||||
|
||||
@@ -770,293 +655,17 @@ bool DetectXCAEAConditions(
|
||||
// Conditions ...
|
||||
|
||||
//
|
||||
bool isRSIBullish =
|
||||
zRSI >= cRSI &&
|
||||
cRSI > pRSI;
|
||||
bool isRSIBearish =
|
||||
zRSI <= cRSI &&
|
||||
cRSI < pRSI;
|
||||
|
||||
//
|
||||
bool isCCIBullish =
|
||||
zCCI >= cCCI &&
|
||||
cCCI > pCCI &&
|
||||
(zCCI > conditions.cciOSLevel ||
|
||||
cCCI > conditions.cciOSLevel);
|
||||
bool isCCIBearish =
|
||||
zCCI >= cCCI &&
|
||||
cCCI > pCCI &&
|
||||
(zCCI < conditions.cciOBLevel ||
|
||||
cCCI < conditions.cciOBLevel);
|
||||
|
||||
//
|
||||
// Detect Selected Box ...
|
||||
XBoxZone oscBoxes[];
|
||||
XBoxZone lastOSCBox;
|
||||
// Detect Selected Pivot ...
|
||||
XBoxZone oscPivots[];
|
||||
XBoxZone lastOSCPivot;
|
||||
double providedSL = 0;
|
||||
bool isBoxFVG = false;
|
||||
bool hasOSCBox = false;
|
||||
bool hasPivotBox = false;
|
||||
bool isBoxPeakVale = false;
|
||||
bool isBoxRejected = false;
|
||||
bool isBoxActivated = false;
|
||||
bool isBoxFullSifeRejected = false;
|
||||
bool hasBoxes = HasChild(boxes);
|
||||
if (hasBoxes)
|
||||
bool hasPivots = HasChild(pivots);
|
||||
if (hasPivots)
|
||||
{
|
||||
//
|
||||
// Detect Selected Boxes ...
|
||||
XBoxZone tmp[];
|
||||
Copy(
|
||||
boxes,
|
||||
tmp //
|
||||
);
|
||||
while (HasChild(tmp))
|
||||
{
|
||||
//
|
||||
idx = GetYoungest(tmp);
|
||||
has = IsValidIndex(idx);
|
||||
if (!has)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
//
|
||||
XBoxZone iBox;
|
||||
iBox = tmp[idx];
|
||||
ArrayRemove(
|
||||
tmp,
|
||||
idx,
|
||||
1 //
|
||||
);
|
||||
|
||||
//
|
||||
// Check Selected Box not RSI or CCI ...
|
||||
isBoxFVG = Contains(
|
||||
"XCA_FVG",
|
||||
iBox.type //
|
||||
);
|
||||
isBoxPeakVale =
|
||||
Contains(
|
||||
"XCA_PEAKSWHRES",
|
||||
iBox.type //
|
||||
) ||
|
||||
Contains(
|
||||
"XCA_VALESWLSUP",
|
||||
iBox.type //
|
||||
);
|
||||
has = isBoxFVG ||
|
||||
isBoxPeakVale;
|
||||
if (!has)
|
||||
{
|
||||
//
|
||||
bool isOSC = Contains(
|
||||
"XCA_CCI_VALE",
|
||||
iBox.type //
|
||||
) ||
|
||||
Contains(
|
||||
"XCA_CCI_PEAK",
|
||||
iBox.type //
|
||||
) ||
|
||||
Contains(
|
||||
"XCA_RSI_VALE",
|
||||
iBox.type //
|
||||
) ||
|
||||
Contains(
|
||||
"XCA_RSI_PEAK",
|
||||
iBox.type //
|
||||
);
|
||||
if (isOSC)
|
||||
{
|
||||
//
|
||||
AddRef(
|
||||
iBox,
|
||||
oscBoxes //
|
||||
);
|
||||
}
|
||||
|
||||
//
|
||||
iBox.Clean();
|
||||
|
||||
//
|
||||
continue;
|
||||
}
|
||||
|
||||
//
|
||||
bool isBullish = iBox.IsBullish();
|
||||
bool isBearish = iBox.IsBearish();
|
||||
|
||||
//
|
||||
double rejectedCheckPrice =
|
||||
isBullish
|
||||
? iBox.upper
|
||||
: iBox.lower;
|
||||
double rejectedFullCheckPrice =
|
||||
isBullish
|
||||
? iBox.lower
|
||||
: iBox.upper;
|
||||
|
||||
//
|
||||
// Check Box Selecting Senarios ...
|
||||
|
||||
//
|
||||
// Selecting Rejected Boxes ...
|
||||
isBoxRejected = cBar.IsRejected(
|
||||
rejectedCheckPrice,
|
||||
iBox.dir,
|
||||
false,
|
||||
false //
|
||||
);
|
||||
|
||||
//
|
||||
// Selecting Rejected Boxes ...
|
||||
isBoxFullSifeRejected = cBar.IsRejected(
|
||||
rejectedFullCheckPrice,
|
||||
iBox.dir,
|
||||
false,
|
||||
false //
|
||||
);
|
||||
|
||||
//
|
||||
// Selecting Activation Boxes ...
|
||||
|
||||
//
|
||||
bool isBullishActivated =
|
||||
isBullish &&
|
||||
cBar.IsBullish() &&
|
||||
cBar.GetUp() > rejectedCheckPrice &&
|
||||
cBar.GetDown() < rejectedCheckPrice;
|
||||
|
||||
//
|
||||
bool isBearishActivated =
|
||||
isBearish &&
|
||||
cBar.IsBearish() &&
|
||||
cBar.GetUp() > rejectedCheckPrice &&
|
||||
cBar.GetDown() < rejectedCheckPrice;
|
||||
|
||||
//
|
||||
isBoxActivated = isBullishActivated ||
|
||||
isBearishActivated;
|
||||
|
||||
//
|
||||
// Detect Box is Selected or not ...
|
||||
has =
|
||||
isBoxRejected ||
|
||||
isBoxActivated ||
|
||||
isBoxFullSifeRejected;
|
||||
if (has)
|
||||
{
|
||||
//
|
||||
pivotBox = iBox;
|
||||
|
||||
//
|
||||
iBox.Clean();
|
||||
break;
|
||||
}
|
||||
|
||||
//
|
||||
iBox.Clean();
|
||||
}
|
||||
|
||||
//
|
||||
Clean(tmp);
|
||||
}
|
||||
|
||||
//
|
||||
// Check OSC Boxes ...
|
||||
bool hasOSCBoxes = HasChild(oscBoxes);
|
||||
if (hasOSCBoxes)
|
||||
{
|
||||
//
|
||||
// Detect Newest OSC Box ...
|
||||
idx = GetYoungest(oscBoxes);
|
||||
has = IsValidIndex(idx);
|
||||
if (has)
|
||||
{
|
||||
lastOSCBox = oscBoxes[idx];
|
||||
}
|
||||
|
||||
//
|
||||
// Validate OSC Box is Valid or not ...
|
||||
has = lastOSCBox.IsValid();
|
||||
if (has)
|
||||
{
|
||||
//
|
||||
// Check Bar is Inside OSC Box or not ...
|
||||
has = cBar.time > lastOSCBox.from &&
|
||||
cBar.time <= lastOSCBox.to;
|
||||
if (!has)
|
||||
{
|
||||
lastOSCBox.Clean();
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
hasOSCBox = lastOSCBox.IsValid();
|
||||
if (hasOSCBox)
|
||||
{
|
||||
// //
|
||||
// XCBoxObject *iObj;
|
||||
// has = helper.poiDrawer.DrawBox(
|
||||
// lastOSCBox,
|
||||
// iObj //
|
||||
// );
|
||||
// if (has) {
|
||||
// iObj.BoxWidth(4);
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// Force Conditions to Have Selected Box ...
|
||||
hasPivotBox = hasBoxes &&
|
||||
pivotBox.IsValid();
|
||||
if (hasPivotBox)
|
||||
{
|
||||
// //
|
||||
// pivotBox.to = TimeCurrent();
|
||||
|
||||
// //
|
||||
// // Draw Pivot Box Here ...
|
||||
// if (isBoxPeakVale)
|
||||
// {
|
||||
// //
|
||||
// XCBoxObject *iObj;
|
||||
// has = helper.poiDrawer.DrawBox(
|
||||
// pivotBox,
|
||||
// iObj //
|
||||
// );
|
||||
// if (has)
|
||||
// {
|
||||
// //
|
||||
// iObj.BoxWidth(5);
|
||||
// iObj.BoxColor(clrDodgerBlue);
|
||||
// Print("Draw Pivot Box ...");
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
||||
//
|
||||
// If all Conditions required Boxes ...
|
||||
// if (!result)
|
||||
// {
|
||||
// //
|
||||
// zBar.Clean();
|
||||
// cBar.Clean();
|
||||
// pBar.Clean();
|
||||
// p2Bar.Clean();
|
||||
// p3Bar.Clean();
|
||||
// p4Bar.Clean();
|
||||
|
||||
// //
|
||||
// box.Clean();
|
||||
// pivotBox.Clean();
|
||||
// conditions.Clean();
|
||||
|
||||
// //
|
||||
// return result;
|
||||
// }
|
||||
|
||||
//
|
||||
// Signaller Summarization ...
|
||||
|
||||
@@ -1066,32 +675,14 @@ bool DetectXCAEAConditions(
|
||||
//
|
||||
bool isCond1Bullish =
|
||||
//
|
||||
false &&
|
||||
hasPivotBox &&
|
||||
isBoxPeakVale &&
|
||||
isScoreBullish &&
|
||||
pivotBox.IsBullish() &&
|
||||
(conditions.isValeUnderLast ||
|
||||
(conditions.isValeSameLast &&
|
||||
pConditions.isValeUnderLast)) &&
|
||||
conditions.isRSICrossedOverOS &&
|
||||
conditions.isCCICrossedOverOS
|
||||
false
|
||||
//
|
||||
;
|
||||
|
||||
//
|
||||
bool isCond1Bearish =
|
||||
//
|
||||
false &&
|
||||
hasPivotBox &&
|
||||
isBoxPeakVale &&
|
||||
isScoreBearish &&
|
||||
pivotBox.IsBearish() &&
|
||||
(conditions.isPeakOverLast ||
|
||||
(conditions.isPeakSameLast &&
|
||||
pConditions.isPeakOverLast)) &&
|
||||
conditions.isRSICrossedUnderOB &&
|
||||
conditions.isCCICrossedUnderOB
|
||||
false
|
||||
//
|
||||
;
|
||||
|
||||
@@ -1119,20 +710,14 @@ bool DetectXCAEAConditions(
|
||||
//
|
||||
bool isCond2Bullish =
|
||||
//
|
||||
hasOSCBox &&
|
||||
// cVidyaState < 0 &&
|
||||
lastOSCBox.IsBullish() // &&
|
||||
// lastOSCBox.upper < cVidya
|
||||
false
|
||||
//
|
||||
;
|
||||
|
||||
//
|
||||
bool isCond2Bearish =
|
||||
//
|
||||
hasOSCBox &&
|
||||
// cVidyaState > 0 &&
|
||||
lastOSCBox.IsBearish() // &&
|
||||
// lastOSCBox.lower > cVidya
|
||||
false
|
||||
//
|
||||
;
|
||||
|
||||
@@ -1143,24 +728,30 @@ bool DetectXCAEAConditions(
|
||||
{
|
||||
//
|
||||
providedSL =
|
||||
isCond1Bullish
|
||||
isCond2Bullish
|
||||
? MathMin(pBar.low, pivotBox.lower)
|
||||
: MathMax(pBar.high, pivotBox.upper);
|
||||
|
||||
//
|
||||
Print("Cond2");
|
||||
isCond2Bullish = false;
|
||||
isCond2Bearish = false;
|
||||
}
|
||||
|
||||
//
|
||||
// Cond3 Act Using CCi Peaks and Vales ...
|
||||
|
||||
//
|
||||
bool isCond3Bullish = false;
|
||||
bool isCond3Bullish =
|
||||
//
|
||||
false
|
||||
//
|
||||
;
|
||||
|
||||
//
|
||||
bool isCond3Bearish = false;
|
||||
bool isCond3Bearish =
|
||||
//
|
||||
false
|
||||
//
|
||||
;
|
||||
|
||||
//
|
||||
bool isCond3 = isCond3Bullish ||
|
||||
@@ -1168,6 +759,10 @@ bool DetectXCAEAConditions(
|
||||
if (isCond3)
|
||||
{
|
||||
//
|
||||
providedSL =
|
||||
isCond3Bullish
|
||||
? MathMin(pBar.low, pivotBox.lower)
|
||||
: MathMax(pBar.high, pivotBox.upper);
|
||||
|
||||
//
|
||||
Print("Cond3");
|
||||
@@ -1267,7 +862,6 @@ bool DetectXCAEAConditions(
|
||||
p2Bar.Clean();
|
||||
p3Bar.Clean();
|
||||
p4Bar.Clean();
|
||||
Clean(oscBoxes);
|
||||
pConditions.Clean();
|
||||
|
||||
//
|
||||
|
||||
@@ -167,12 +167,12 @@ class XCXCAEASignaller : XCBase
|
||||
|
||||
//
|
||||
// Setup Conditions ...
|
||||
XBoxZone boxes[];
|
||||
XBoxZone pivots[];
|
||||
XBoxZone pivotBox;
|
||||
XBoxZone signalBox;
|
||||
int pivotsCount = 0;
|
||||
bool hasPivots = false;
|
||||
double additionalSL = 0;
|
||||
XBoxZone bullishBoxes[];
|
||||
XBoxZone bearishBoxes[];
|
||||
bool hasSignalBox = false;
|
||||
XCAEAConditions conditions;
|
||||
ENUM_X_DIRECTION signalBoxDir = X_DIRECTION_NONE;
|
||||
@@ -182,11 +182,6 @@ class XCXCAEASignaller : XCBase
|
||||
detector.Update(
|
||||
zIndex //
|
||||
);
|
||||
|
||||
//
|
||||
if (detector.newValeSupSWLPivotDetected) {
|
||||
Print("Salam");
|
||||
}
|
||||
|
||||
//
|
||||
// Validate Pivots ...
|
||||
@@ -201,36 +196,12 @@ class XCXCAEASignaller : XCBase
|
||||
|
||||
//
|
||||
// Retrieve Valid Boxes ...
|
||||
|
||||
// //
|
||||
// // Bullish ...
|
||||
// int bullishBoxesCount =
|
||||
// detector
|
||||
// .FillBullishBoxes(bullishBoxes);
|
||||
|
||||
// //
|
||||
// // Bearish ...
|
||||
// int bearishBoxesCount =
|
||||
// detector
|
||||
// .FillBearishBoxes(bearishBoxes);
|
||||
|
||||
// //
|
||||
// Copy(
|
||||
// bullishBoxes,
|
||||
// boxes,
|
||||
// false //
|
||||
// );
|
||||
// Copy(
|
||||
// bearishBoxes,
|
||||
// boxes,
|
||||
// false //
|
||||
// );
|
||||
int boxesCount = ArraySize(boxes);
|
||||
bool hasBoxes = IsValidSize(boxesCount);
|
||||
pivotsCount = detector.FillPivots(pivots);
|
||||
hasPivots = IsValidSize(pivotsCount);
|
||||
|
||||
//
|
||||
// Filter UnAvailable Boxes ...
|
||||
if (hasBoxes)
|
||||
if (hasPivots)
|
||||
{
|
||||
//
|
||||
// Remove UnAvailable Boxes ...
|
||||
@@ -248,13 +219,13 @@ class XCXCAEASignaller : XCBase
|
||||
has = FindBoxIndex(
|
||||
idx,
|
||||
iBox,
|
||||
boxes //
|
||||
pivots //
|
||||
);
|
||||
if (has)
|
||||
{
|
||||
//
|
||||
ArrayRemove(
|
||||
boxes,
|
||||
pivots,
|
||||
idx,
|
||||
1 //
|
||||
);
|
||||
@@ -263,23 +234,18 @@ class XCXCAEASignaller : XCBase
|
||||
}
|
||||
|
||||
//
|
||||
hasBoxes = HasChild(boxes);
|
||||
boxesCount = ArraySize(boxes);
|
||||
hasPivots = HasChild(pivots);
|
||||
pivotsCount = ArraySize(pivots);
|
||||
}
|
||||
|
||||
//
|
||||
//
|
||||
//
|
||||
|
||||
//
|
||||
// if (hasBoxes)
|
||||
// {
|
||||
// }
|
||||
|
||||
//
|
||||
// Detect Sinal Box ...
|
||||
hasSignalBox = DetectXCAEAConditions(
|
||||
boxes,
|
||||
pivots,
|
||||
conditions,
|
||||
pivotBox,
|
||||
signalBox,
|
||||
@@ -301,6 +267,17 @@ class XCXCAEASignaller : XCBase
|
||||
);
|
||||
}
|
||||
|
||||
//
|
||||
// Make Signal Box UnAvailable ...
|
||||
if (signalBox.IsValid())
|
||||
{
|
||||
//
|
||||
AddRef(
|
||||
signalBox,
|
||||
unAvailableBoxes //
|
||||
);
|
||||
}
|
||||
|
||||
//
|
||||
isBullish = hasSignalBox &&
|
||||
IsBullish(signalBoxDir);
|
||||
@@ -458,9 +435,7 @@ class XCXCAEASignaller : XCBase
|
||||
// Cleanup Resource ...
|
||||
|
||||
//
|
||||
Clean(boxes);
|
||||
Clean(bullishBoxes);
|
||||
Clean(bearishBoxes);
|
||||
Clean(pivots);
|
||||
|
||||
//
|
||||
zBar.Clean();
|
||||
@@ -762,24 +737,69 @@ class XCXCAEASignaller : XCBase
|
||||
detector.detectFVGBearishPivots = true;
|
||||
detector.detectValeSupSWLPivots = true;
|
||||
detector.detectPeakResSWHPivots = true;
|
||||
detector.detectPVFVGBullishPivots = true;
|
||||
detector.detectPVFVGBearishPivots = true;
|
||||
|
||||
//
|
||||
// Initialize and Configure Drawer ...
|
||||
drawer = new XCXCAEAPOIDrawer(detector);
|
||||
|
||||
//
|
||||
drawer.ignoreUpdateOSCTos = true;
|
||||
|
||||
//
|
||||
// Configure Drawer ...
|
||||
drawer.drawRSIPeakPivots = true;
|
||||
drawer.drawRSIValePivots = true;
|
||||
drawer.drawCCIPeakPivots = true;
|
||||
drawer.drawCCIValePivots = true;
|
||||
drawer.drawFVGBullishPivots = true;
|
||||
drawer.drawFVGBearishPivots = true;
|
||||
drawer.drawFVGBullishPivots = false;
|
||||
drawer.drawFVGBearishPivots = false;
|
||||
drawer.drawValeSupSWLPivots = true;
|
||||
drawer.drawPeakResSWHPivots = true;
|
||||
drawer.drawPVFVGBullishPivots = true;
|
||||
drawer.drawPVFVGBearishPivots = true;
|
||||
|
||||
//
|
||||
// Configure Widths ...
|
||||
drawer.rsiPeakPivotsWidth = 4;
|
||||
drawer.rsiValePivotsWidth = 4;
|
||||
drawer.cciPeakPivotsWidth = 4;
|
||||
drawer.cciValePivotsWidth = 4;
|
||||
drawer.fvgBullishPivotsWidth = 2;
|
||||
drawer.fvgBearishPivotsWidth = 2;
|
||||
drawer.valeSupSWLPivotsWidth = 1;
|
||||
drawer.peakResSWHPivotsWidth = 1;
|
||||
drawer.pvFVGBullishPivotsWidth = 1;
|
||||
drawer.pvFVGBearishPivotsWidth = 1;
|
||||
|
||||
//
|
||||
// Configure Colors ...
|
||||
drawer.rsiPeakPivotsColor = clrMagenta;
|
||||
drawer.rsiValePivotsColor = clrAqua;
|
||||
drawer.cciPeakPivotsColor = clrMagenta;
|
||||
drawer.cciValePivotsColor = clrAqua;
|
||||
drawer.fvgBullishPivotsColor = clrLime;
|
||||
drawer.fvgBearishPivotsColor = clrRed;
|
||||
drawer.valeSupSWLPivotsColor = clrAqua;
|
||||
drawer.peakResSWHPivotsColor = clrMagenta;
|
||||
drawer.pvFVGBullishPivotsColor = clrLime;
|
||||
drawer.pvFVGBearishPivotsColor = clrRed;
|
||||
|
||||
//
|
||||
// Configures Styles ...
|
||||
drawer.rsiPeakPivotsStyle = STYLE_DASH;
|
||||
drawer.rsiValePivotsStyle = STYLE_DASH;
|
||||
drawer.cciPeakPivotsStyle = STYLE_DASH;
|
||||
drawer.cciValePivotsStyle = STYLE_DASH;
|
||||
drawer.fvgBullishPivotsStyle = STYLE_DASHDOTDOT;
|
||||
drawer.fvgBearishPivotsStyle = STYLE_DASHDOTDOT;
|
||||
drawer.valeSupSWLPivotsStyle = STYLE_SOLID;
|
||||
drawer.peakResSWHPivotsStyle = STYLE_SOLID;
|
||||
drawer.pvFVGBullishPivotsStyle = STYLE_DASHDOTDOT;
|
||||
drawer.pvFVGBearishPivotsStyle = STYLE_DASHDOTDOT;
|
||||
|
||||
//
|
||||
// UnActive Pivots ...
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user