last ...
This commit is contained in:
@@ -4506,6 +4506,54 @@ class XCXCAEAPOIDetector : public XCBase
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
has = HasRSICrossedOverOSPivots();
|
||||||
|
if (has) {
|
||||||
|
//
|
||||||
|
count = CountRSICrossedOverOSPivots();
|
||||||
|
for (int i = 0; i < count; i++)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
XBoxZone iBox;
|
||||||
|
has = rsiCrossedOverOSPivots[i].AsBox(iBox);
|
||||||
|
if (has)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
AddRef(
|
||||||
|
iBox,
|
||||||
|
boxes //
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
iBox.Clean();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
has = HasCCICrossedOverOSPivots();
|
||||||
|
if (has) {
|
||||||
|
//
|
||||||
|
count = CountCCICrossedOverOSPivots();
|
||||||
|
for (int i = 0; i < count; i++)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
XBoxZone iBox;
|
||||||
|
has = cciCrossedOverOSPivots[i].AsBox(iBox);
|
||||||
|
if (has)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
AddRef(
|
||||||
|
iBox,
|
||||||
|
boxes //
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
iBox.Clean();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
result = ArraySize(boxes);
|
result = ArraySize(boxes);
|
||||||
|
|
||||||
@@ -4803,6 +4851,54 @@ class XCXCAEAPOIDetector : public XCBase
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
has = HasRSICrossedUnderOBPivots();
|
||||||
|
if (has) {
|
||||||
|
//
|
||||||
|
count = CountRSICrossedUnderOBPivots();
|
||||||
|
for (int i = 0; i < count; i++)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
XBoxZone iBox;
|
||||||
|
has = rsiCrossedUnderOBPivots[i].AsBox(iBox);
|
||||||
|
if (has)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
AddRef(
|
||||||
|
iBox,
|
||||||
|
boxes //
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
iBox.Clean();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
has = HasCCICrossedUnderOBPivots();
|
||||||
|
if (has) {
|
||||||
|
//
|
||||||
|
count = CountCCICrossedUnderOBPivots();
|
||||||
|
for (int i = 0; i < count; i++)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
XBoxZone iBox;
|
||||||
|
has = cciCrossedUnderOBPivots[i].AsBox(iBox);
|
||||||
|
if (has)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
AddRef(
|
||||||
|
iBox,
|
||||||
|
boxes //
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
iBox.Clean();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
result = ArraySize(boxes);
|
result = ArraySize(boxes);
|
||||||
|
|
||||||
|
|||||||
@@ -24,6 +24,7 @@
|
|||||||
#include "../../Libraries/x-saherelm.common.lib.mq5"
|
#include "../../Libraries/x-saherelm.common.lib.mq5"
|
||||||
#include "../../Libraries/x-saherelm.x-poi.lib.mq5"
|
#include "../../Libraries/x-saherelm.x-poi.lib.mq5"
|
||||||
#include "../../Libraries/x-saherelm.x-trade.lib.mq5"
|
#include "../../Libraries/x-saherelm.x-trade.lib.mq5"
|
||||||
|
#include "../Classes/xcaea.x-poi.detector.class.mq5"
|
||||||
#include "../Helpers/xcaea.helper.mq5"
|
#include "../Helpers/xcaea.helper.mq5"
|
||||||
|
|
||||||
//
|
//
|
||||||
@@ -431,6 +432,11 @@ bool DetectXCAEAConditions(
|
|||||||
//
|
//
|
||||||
bool result = false;
|
bool result = false;
|
||||||
|
|
||||||
|
//
|
||||||
|
int idx = -1;
|
||||||
|
int count = 0;
|
||||||
|
bool has = false;
|
||||||
|
|
||||||
//
|
//
|
||||||
box.Clean();
|
box.Clean();
|
||||||
conditions.Clean();
|
conditions.Clean();
|
||||||
@@ -464,15 +470,15 @@ bool DetectXCAEAConditions(
|
|||||||
int zIDX = barIndex;
|
int zIDX = barIndex;
|
||||||
int cIDX = zIDX + 1;
|
int cIDX = zIDX + 1;
|
||||||
int pIDX = cIDX + 1;
|
int pIDX = cIDX + 1;
|
||||||
int ppIDX = pIDX + 1;
|
int p2IDX = pIDX + 1;
|
||||||
int p3IDX = ppIDX + 1;
|
int p3IDX = p2IDX + 1;
|
||||||
int p4IDX = p3IDX + 1;
|
int p4IDX = p3IDX + 1;
|
||||||
|
|
||||||
//
|
//
|
||||||
XOHCL zBar;
|
XOHCL zBar;
|
||||||
XOHCL cBar;
|
XOHCL cBar;
|
||||||
XOHCL pBar;
|
XOHCL pBar;
|
||||||
XOHCL ppBar;
|
XOHCL p2Bar;
|
||||||
XOHCL p3Bar;
|
XOHCL p3Bar;
|
||||||
XOHCL p4Bar;
|
XOHCL p4Bar;
|
||||||
result = zBar.Init(
|
result = zBar.Init(
|
||||||
@@ -488,10 +494,10 @@ bool DetectXCAEAConditions(
|
|||||||
cBar.GetPreviousBar(pBar);
|
cBar.GetPreviousBar(pBar);
|
||||||
result =
|
result =
|
||||||
result &&
|
result &&
|
||||||
pBar.GetPreviousBar(ppBar);
|
pBar.GetPreviousBar(p2Bar);
|
||||||
result =
|
result =
|
||||||
result &&
|
result &&
|
||||||
ppBar.GetPreviousBar(p3Bar);
|
p2Bar.GetPreviousBar(p3Bar);
|
||||||
result =
|
result =
|
||||||
result &&
|
result &&
|
||||||
p3Bar.GetPreviousBar(p4Bar);
|
p3Bar.GetPreviousBar(p4Bar);
|
||||||
@@ -501,7 +507,7 @@ bool DetectXCAEAConditions(
|
|||||||
zBar.Clean();
|
zBar.Clean();
|
||||||
cBar.Clean();
|
cBar.Clean();
|
||||||
pBar.Clean();
|
pBar.Clean();
|
||||||
ppBar.Clean();
|
p2Bar.Clean();
|
||||||
p3Bar.Clean();
|
p3Bar.Clean();
|
||||||
p4Bar.Clean();
|
p4Bar.Clean();
|
||||||
|
|
||||||
@@ -513,6 +519,146 @@ bool DetectXCAEAConditions(
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
bool isBarBullishVPattern =
|
||||||
|
pBar.IsBullish() &&
|
||||||
|
cBar.low > pBar.low &&
|
||||||
|
p2Bar.low > pBar.low;
|
||||||
|
|
||||||
|
//
|
||||||
|
bool isBarBearishVPattern =
|
||||||
|
pBar.IsBearish() &&
|
||||||
|
cBar.high < pBar.high &&
|
||||||
|
p2Bar.high < pBar.high;
|
||||||
|
|
||||||
|
//
|
||||||
|
// Detect Selected Box ...
|
||||||
|
XBoxZone selectedBox;
|
||||||
|
bool hasBoxes = HasChild(boxes);
|
||||||
|
if (hasBoxes)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
// 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 ...
|
||||||
|
has = iBox.type == ToString(XCA_PEAKSWHRES) ||
|
||||||
|
iBox.type == ToString(XCA_VALESWLSUP);
|
||||||
|
if (!has)
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
bool isBullish = iBox.IsBullish();
|
||||||
|
bool isBearish = iBox.IsBearish();
|
||||||
|
|
||||||
|
//
|
||||||
|
double rejectedCheckPrice =
|
||||||
|
isBullish
|
||||||
|
? iBox.upper
|
||||||
|
: iBox.lower;
|
||||||
|
|
||||||
|
//
|
||||||
|
// Check Box Selecting Senarios ...
|
||||||
|
|
||||||
|
//
|
||||||
|
// Selecting Rejected Boxes ...
|
||||||
|
bool isRejected = cBar.IsRejected(
|
||||||
|
rejectedCheckPrice,
|
||||||
|
iBox.dir,
|
||||||
|
false,
|
||||||
|
false //
|
||||||
|
);
|
||||||
|
|
||||||
|
//
|
||||||
|
// Selecting Activation Boxes ...
|
||||||
|
|
||||||
|
//
|
||||||
|
bool isBullishActivated =
|
||||||
|
isBullish &&
|
||||||
|
isBarBullishVPattern &&
|
||||||
|
cBar.GetUp() > rejectedCheckPrice &&
|
||||||
|
cBar.GetDown() < rejectedCheckPrice;
|
||||||
|
|
||||||
|
//
|
||||||
|
bool isBearishActivated =
|
||||||
|
isBearish &&
|
||||||
|
isBarBearishVPattern &&
|
||||||
|
cBar.GetUp() > rejectedCheckPrice &&
|
||||||
|
cBar.GetDown() < rejectedCheckPrice;
|
||||||
|
|
||||||
|
//
|
||||||
|
bool isActivated = isBullishActivated ||
|
||||||
|
isBearishActivated;
|
||||||
|
|
||||||
|
//
|
||||||
|
has = // isRejected ||
|
||||||
|
isActivated;
|
||||||
|
if (has)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
selectedBox = iBox;
|
||||||
|
|
||||||
|
//
|
||||||
|
iBox.Clean();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
iBox.Clean();
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
Clean(tmp);
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// Force Conditions to Have Selected Box ...
|
||||||
|
result = hasBoxes &&
|
||||||
|
selectedBox.IsValid();
|
||||||
|
if (!result)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
zBar.Clean();
|
||||||
|
cBar.Clean();
|
||||||
|
pBar.Clean();
|
||||||
|
p2Bar.Clean();
|
||||||
|
p3Bar.Clean();
|
||||||
|
p4Bar.Clean();
|
||||||
|
|
||||||
|
//
|
||||||
|
box.Clean();
|
||||||
|
conditions.Clean();
|
||||||
|
selectedBox.Clean();
|
||||||
|
|
||||||
|
//
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Bars Conditions ...
|
// Bars Conditions ...
|
||||||
|
|
||||||
@@ -635,12 +781,12 @@ bool DetectXCAEAConditions(
|
|||||||
//
|
//
|
||||||
double cKI = conditions.kiBuffer[cIDX];
|
double cKI = conditions.kiBuffer[cIDX];
|
||||||
double pKI = conditions.kiBuffer[pIDX];
|
double pKI = conditions.kiBuffer[pIDX];
|
||||||
double p2KI = conditions.kiBuffer[ppIDX];
|
double p2KI = conditions.kiBuffer[p2IDX];
|
||||||
|
|
||||||
//
|
//
|
||||||
double cKIState = conditions.kiStateBuffer[cIDX];
|
double cKIState = conditions.kiStateBuffer[cIDX];
|
||||||
double pKIState = conditions.kiStateBuffer[pIDX];
|
double pKIState = conditions.kiStateBuffer[pIDX];
|
||||||
double p2KIState = conditions.kiStateBuffer[ppIDX];
|
double p2KIState = conditions.kiStateBuffer[p2IDX];
|
||||||
|
|
||||||
//
|
//
|
||||||
// TKI ...
|
// TKI ...
|
||||||
@@ -648,12 +794,12 @@ bool DetectXCAEAConditions(
|
|||||||
//
|
//
|
||||||
double cTKI = conditions.tkiBuffer[cIDX];
|
double cTKI = conditions.tkiBuffer[cIDX];
|
||||||
double pTKI = conditions.tkiBuffer[pIDX];
|
double pTKI = conditions.tkiBuffer[pIDX];
|
||||||
double p2TKI = conditions.tkiBuffer[ppIDX];
|
double p2TKI = conditions.tkiBuffer[p2IDX];
|
||||||
|
|
||||||
//
|
//
|
||||||
double cTKIState = conditions.tkiStateBuffer[cIDX];
|
double cTKIState = conditions.tkiStateBuffer[cIDX];
|
||||||
double pTKIState = conditions.tkiStateBuffer[pIDX];
|
double pTKIState = conditions.tkiStateBuffer[pIDX];
|
||||||
double p2TKIState = conditions.tkiStateBuffer[ppIDX];
|
double p2TKIState = conditions.tkiStateBuffer[p2IDX];
|
||||||
|
|
||||||
//
|
//
|
||||||
// TREND ...
|
// TREND ...
|
||||||
@@ -661,12 +807,12 @@ bool DetectXCAEAConditions(
|
|||||||
//
|
//
|
||||||
double cTrend = conditions.trendBuffer[cIDX];
|
double cTrend = conditions.trendBuffer[cIDX];
|
||||||
double pTrend = conditions.trendBuffer[pIDX];
|
double pTrend = conditions.trendBuffer[pIDX];
|
||||||
double p2Trend = conditions.trendBuffer[ppIDX];
|
double p2Trend = conditions.trendBuffer[p2IDX];
|
||||||
|
|
||||||
//
|
//
|
||||||
double ctrendState = conditions.trendStateBuffer[cIDX];
|
double ctrendState = conditions.trendStateBuffer[cIDX];
|
||||||
double ptrendState = conditions.trendStateBuffer[pIDX];
|
double ptrendState = conditions.trendStateBuffer[pIDX];
|
||||||
double p2trendState = conditions.trendStateBuffer[ppIDX];
|
double p2trendState = conditions.trendStateBuffer[p2IDX];
|
||||||
|
|
||||||
//
|
//
|
||||||
// SWING Low ...
|
// SWING Low ...
|
||||||
@@ -674,7 +820,7 @@ bool DetectXCAEAConditions(
|
|||||||
//
|
//
|
||||||
double cSWL = conditions.swingLowBuffer[cIDX];
|
double cSWL = conditions.swingLowBuffer[cIDX];
|
||||||
double pSWL = conditions.swingLowBuffer[pIDX];
|
double pSWL = conditions.swingLowBuffer[pIDX];
|
||||||
double p2SWL = conditions.swingLowBuffer[ppIDX];
|
double p2SWL = conditions.swingLowBuffer[p2IDX];
|
||||||
|
|
||||||
//
|
//
|
||||||
// SWING High ...
|
// SWING High ...
|
||||||
@@ -682,7 +828,7 @@ bool DetectXCAEAConditions(
|
|||||||
//
|
//
|
||||||
double cSWH = conditions.swingHighBuffer[cIDX];
|
double cSWH = conditions.swingHighBuffer[cIDX];
|
||||||
double pSWH = conditions.swingHighBuffer[pIDX];
|
double pSWH = conditions.swingHighBuffer[pIDX];
|
||||||
double p2SWH = conditions.swingHighBuffer[ppIDX];
|
double p2SWH = conditions.swingHighBuffer[p2IDX];
|
||||||
|
|
||||||
//
|
//
|
||||||
// PEAK ...
|
// PEAK ...
|
||||||
@@ -690,7 +836,7 @@ bool DetectXCAEAConditions(
|
|||||||
//
|
//
|
||||||
double cPeak = conditions.peakBuffer[cIDX];
|
double cPeak = conditions.peakBuffer[cIDX];
|
||||||
double pPeak = conditions.peakBuffer[pIDX];
|
double pPeak = conditions.peakBuffer[pIDX];
|
||||||
double p2Peak = conditions.peakBuffer[ppIDX];
|
double p2Peak = conditions.peakBuffer[p2IDX];
|
||||||
|
|
||||||
//
|
//
|
||||||
// VALE ...
|
// VALE ...
|
||||||
@@ -698,7 +844,7 @@ bool DetectXCAEAConditions(
|
|||||||
//
|
//
|
||||||
double cVale = conditions.valeBuffer[cIDX];
|
double cVale = conditions.valeBuffer[cIDX];
|
||||||
double pVale = conditions.valeBuffer[pIDX];
|
double pVale = conditions.valeBuffer[pIDX];
|
||||||
double p2Vale = conditions.valeBuffer[ppIDX];
|
double p2Vale = conditions.valeBuffer[p2IDX];
|
||||||
|
|
||||||
//
|
//
|
||||||
// COMPLEX ...
|
// COMPLEX ...
|
||||||
@@ -856,7 +1002,7 @@ bool DetectXCAEAConditions(
|
|||||||
zBar.Clean();
|
zBar.Clean();
|
||||||
cBar.Clean();
|
cBar.Clean();
|
||||||
pBar.Clean();
|
pBar.Clean();
|
||||||
ppBar.Clean();
|
p2Bar.Clean();
|
||||||
p3Bar.Clean();
|
p3Bar.Clean();
|
||||||
p4Bar.Clean();
|
p4Bar.Clean();
|
||||||
|
|
||||||
|
|||||||
@@ -191,12 +191,14 @@ class XCXCAEASignaller : XCBase
|
|||||||
//
|
//
|
||||||
// Bullish ...
|
// Bullish ...
|
||||||
XBoxZone bullishBoxes[];
|
XBoxZone bullishBoxes[];
|
||||||
int bullishBoxesCount = detector.FillBullishBoxes(bullishBoxes);
|
int bullishBoxesCount = detector
|
||||||
|
.FillBullishBoxes(bullishBoxes);
|
||||||
|
|
||||||
//
|
//
|
||||||
// Bearish ...
|
// Bearish ...
|
||||||
XBoxZone bearishBoxes[];
|
XBoxZone bearishBoxes[];
|
||||||
int bearishBoxesCount = detector.FillBearishBoxes(bearishBoxes);
|
int bearishBoxesCount = detector
|
||||||
|
.FillBearishBoxes(bearishBoxes);
|
||||||
|
|
||||||
//
|
//
|
||||||
XBoxZone boxes[];
|
XBoxZone boxes[];
|
||||||
@@ -631,7 +633,7 @@ class XCXCAEASignaller : XCBase
|
|||||||
|
|
||||||
//
|
//
|
||||||
// Oscillators Views ...
|
// Oscillators Views ...
|
||||||
inputs.showCCI = true;
|
inputs.showCCI = false;
|
||||||
inputs.showRSI = false;
|
inputs.showRSI = false;
|
||||||
inputs.showMFI = false;
|
inputs.showMFI = false;
|
||||||
inputs.showRVI = false;
|
inputs.showRVI = false;
|
||||||
@@ -657,20 +659,20 @@ class XCXCAEASignaller : XCBase
|
|||||||
detector.detectValePivot = false;
|
detector.detectValePivot = false;
|
||||||
detector.detectKIBullishPivot = false;
|
detector.detectKIBullishPivot = false;
|
||||||
detector.detectKIBearishPivot = false;
|
detector.detectKIBearishPivot = false;
|
||||||
detector.detectPeakSWHResPivot = false; // true;
|
detector.detectPeakSWHResPivot = true;
|
||||||
detector.detectValeSWLSupPivot = false; // true;
|
detector.detectValeSWLSupPivot = true;
|
||||||
detector.detectTKIBullishPivot = false;
|
detector.detectTKIBullishPivot = false;
|
||||||
detector.detectCycleSameLLPivot = false;
|
detector.detectCycleSameLLPivot = false;
|
||||||
detector.detectCycleSameHHPivot = false;
|
detector.detectCycleSameHHPivot = false;
|
||||||
detector.detectTKIBearishPivot = false;
|
detector.detectTKIBearishPivot = false;
|
||||||
detector.detectTrendBullishPivot = false; // true;
|
detector.detectTrendBullishPivot = true;
|
||||||
detector.detectTrendBearishPivot = false; // true;
|
detector.detectTrendBearishPivot = true;
|
||||||
detector.detectTKITRNDBullishPivot = false;
|
detector.detectTKITRNDBullishPivot = false;
|
||||||
detector.detectTKITRNDBearishPivot = false;
|
detector.detectTKITRNDBearishPivot = false;
|
||||||
detector.detectRSICrossedOverOSPivot = true;
|
detector.detectRSICrossedOverOSPivot = true;
|
||||||
detector.detectRSICrossedUnderOBPivot = true;
|
detector.detectRSICrossedUnderOBPivot = true;
|
||||||
detector.detectCCICrossedOverOSPivot = true;
|
detector.detectCCICrossedOverOSPivot = true;
|
||||||
detector.detectCCICrossedUnderOBPivot = true;
|
detector.detectCCICrossedUnderOBPivot = true;
|
||||||
|
|
||||||
//
|
//
|
||||||
// Initialize and Configure Drawer ...
|
// Initialize and Configure Drawer ...
|
||||||
@@ -695,9 +697,9 @@ class XCXCAEASignaller : XCBase
|
|||||||
drawer.drawTKITRNDBullishPivots = false;
|
drawer.drawTKITRNDBullishPivots = false;
|
||||||
drawer.drawTKITRNDBearishPivots = false;
|
drawer.drawTKITRNDBearishPivots = false;
|
||||||
drawer.drawRSICrossedOverOSPivots = true;
|
drawer.drawRSICrossedOverOSPivots = true;
|
||||||
drawer.drawRSICrossedUnderOBPivots = true;
|
drawer.drawRSICrossedUnderOBPivots = true;
|
||||||
drawer.drawCCICrossedOverOSPivots = true;
|
drawer.drawCCICrossedOverOSPivots = true;
|
||||||
drawer.drawCCICrossedUnderOBPivots = true;
|
drawer.drawCCICrossedUnderOBPivots = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user