last ...
This commit is contained in:
@@ -39,6 +39,10 @@ enum ENUM_XCA_PIVOTS
|
||||
XCA_SWH, // SWH
|
||||
XCA_VALE, // VALE
|
||||
XCA_PEAK, // PEAK
|
||||
XCA_RSI_COOS, // RSICOOS
|
||||
XCA_RSI_CUOB, // RSICUOB
|
||||
XCA_CCI_COOS, // CCICOOS
|
||||
XCA_CCI_CUOB, // CCICUOB
|
||||
XCA_KI_BULL, // KIBull
|
||||
XCA_KI_BEAR, // KIBear
|
||||
XCA_TKI_BULL, // TKIBull
|
||||
@@ -323,6 +327,8 @@ struct XCAPivot
|
||||
case XCA_SWL:
|
||||
case XCA_VALE:
|
||||
case XCA_KI_BULL:
|
||||
case XCA_RSI_COOS:
|
||||
case XCA_CCI_COOS:
|
||||
case XCA_TKI_BULL:
|
||||
case XCA_TREND_BULL:
|
||||
case XCA_VALESWLSUP:
|
||||
@@ -335,6 +341,8 @@ struct XCAPivot
|
||||
case XCA_SWH:
|
||||
case XCA_PEAK:
|
||||
case XCA_KI_BEAR:
|
||||
case XCA_RSI_CUOB:
|
||||
case XCA_CCI_CUOB:
|
||||
case XCA_TKI_BEAR:
|
||||
case XCA_TREND_BEAR:
|
||||
case XCA_PEAKSWHRES:
|
||||
@@ -383,6 +391,18 @@ struct XCAPivot
|
||||
//
|
||||
typeStr = "XCA_KI";
|
||||
}
|
||||
else if (type == XCA_RSI_COOS ||
|
||||
type == XCA_RSI_CUOB)
|
||||
{
|
||||
//
|
||||
typeStr = "XCA_RSI";
|
||||
}
|
||||
else if (type == XCA_CCI_COOS ||
|
||||
type == XCA_CCI_CUOB)
|
||||
{
|
||||
//
|
||||
typeStr = "XCA_CCI";
|
||||
}
|
||||
else if (type == XCA_TKI_BULL ||
|
||||
type == XCA_TKI_BEAR)
|
||||
{
|
||||
@@ -510,6 +530,10 @@ class XCXCAEAPOIDetector : public XCBase
|
||||
bool detectTrendBearishPivot;
|
||||
bool detectTKITRNDBullishPivot;
|
||||
bool detectTKITRNDBearishPivot;
|
||||
bool detectRSICrossedOverOSPivot;
|
||||
bool detectRSICrossedUnderOBPivot;
|
||||
bool detectCCICrossedOverOSPivot;
|
||||
bool detectCCICrossedUnderOBPivot;
|
||||
|
||||
//
|
||||
// Active Pivots ...
|
||||
@@ -561,6 +585,12 @@ class XCXCAEAPOIDetector : public XCBase
|
||||
XCAPivot tkitrndBullishPivots[];
|
||||
XCAPivot tkitrndBearishPivots[];
|
||||
|
||||
//
|
||||
XCAPivot rsiCrossedOverOSPivots[];
|
||||
XCAPivot rsiCrossedUnderOBPivots[];
|
||||
XCAPivot cciCrossedOverOSPivots[];
|
||||
XCAPivot cciCrossedUnderOBPivots[];
|
||||
|
||||
//
|
||||
// Constructors ...
|
||||
XCXCAEAPOIDetector(
|
||||
@@ -627,6 +657,10 @@ class XCXCAEAPOIDetector : public XCBase
|
||||
Clean(trendBearishPivots);
|
||||
Clean(tkitrndBullishPivots);
|
||||
Clean(tkitrndBearishPivots);
|
||||
Clean(rsiCrossedOverOSPivots);
|
||||
Clean(rsiCrossedUnderOBPivots);
|
||||
Clean(cciCrossedOverOSPivots);
|
||||
Clean(cciCrossedUnderOBPivots);
|
||||
|
||||
//
|
||||
ZeroMemory(helper);
|
||||
@@ -651,18 +685,20 @@ class XCXCAEAPOIDetector : public XCBase
|
||||
detectSWLPivot = true;
|
||||
detectPeakPivot = true;
|
||||
detectValePivot = true;
|
||||
detectCycleSameLLPivot = true;
|
||||
detectCycleSameHHPivot = true;
|
||||
detectKIBullishPivot = true;
|
||||
detectKIBearishPivot = true;
|
||||
detectTKIBullishPivot = true;
|
||||
detectTKIBearishPivot = true;
|
||||
detectPeakSWHResPivot = true;
|
||||
detectValeSWLSupPivot = true;
|
||||
detectCycleSameLLPivot = true;
|
||||
detectCycleSameHHPivot = true;
|
||||
detectTrendBullishPivot = true;
|
||||
detectTrendBearishPivot = true;
|
||||
detectTKITRNDBullishPivot = true;
|
||||
detectTKITRNDBearishPivot = true;
|
||||
detectCCICrossedOverOSPivot = true;
|
||||
detectCCICrossedUnderOBPivot = true;
|
||||
}
|
||||
|
||||
//
|
||||
@@ -689,6 +725,7 @@ class XCXCAEAPOIDetector : public XCBase
|
||||
int cIDX = zIDX + 1;
|
||||
int pIDX = cIDX + 1;
|
||||
int p2IDX = pIDX + 1;
|
||||
int p3IDX = p2IDX + 1;
|
||||
|
||||
//
|
||||
int index = barIndex;
|
||||
@@ -1231,6 +1268,52 @@ class XCXCAEAPOIDetector : public XCBase
|
||||
!isCKISame &&
|
||||
isPKISame;
|
||||
|
||||
//
|
||||
// RSI ...
|
||||
|
||||
//
|
||||
double zRSI = iConditions.rsiBuffer[zIDX];
|
||||
double cRSI = iConditions.rsiBuffer[cIDX];
|
||||
double pRSI = iConditions.rsiBuffer[pIDX];
|
||||
double p2RSI = iConditions.rsiBuffer[p2IDX];
|
||||
|
||||
//
|
||||
bool isRSIBullishVPattern =
|
||||
cRSI > pRSI &&
|
||||
p2RSI > pRSI &&
|
||||
cRSI > iConditions.rsiOSLevel &&
|
||||
pRSI < iConditions.rsiOSLevel;
|
||||
|
||||
//
|
||||
bool isRSIBearishVPattern =
|
||||
cRSI < pRSI &&
|
||||
p2RSI < pRSI &&
|
||||
cRSI < iConditions.rsiOBLevel &&
|
||||
pRSI > iConditions.rsiOBLevel;
|
||||
|
||||
//
|
||||
// CCI ...
|
||||
|
||||
//
|
||||
double zCCI = iConditions.cciBuffer[zIDX];
|
||||
double cCCI = iConditions.cciBuffer[cIDX];
|
||||
double pCCI = iConditions.cciBuffer[pIDX];
|
||||
double p2CCI = iConditions.cciBuffer[p2IDX];
|
||||
|
||||
//
|
||||
bool isCCIBullishVPattern =
|
||||
cCCI > pCCI &&
|
||||
p2CCI > pCCI &&
|
||||
cCCI > iConditions.cciOSLevel &&
|
||||
pCCI < iConditions.cciOSLevel;
|
||||
|
||||
//
|
||||
bool isCCIBearishVPattern =
|
||||
cCCI < pCCI &&
|
||||
p2CCI < pCCI &&
|
||||
cCCI < iConditions.cciOBLevel &&
|
||||
pCCI > iConditions.cciOBLevel;
|
||||
|
||||
//
|
||||
// Checking Pivots ...
|
||||
|
||||
@@ -3045,6 +3128,238 @@ class XCXCAEAPOIDetector : public XCBase
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// RSI Crossed Over OS ...
|
||||
if (detectRSICrossedOverOSPivot)
|
||||
{
|
||||
//
|
||||
if (isRSIBullishVPattern)
|
||||
{
|
||||
//
|
||||
XCAPivot iPivot;
|
||||
|
||||
//
|
||||
iPivot.to = cBar.time;
|
||||
iPivot.from = p2Bar.time;
|
||||
iPivot.value = pBar.low;
|
||||
iPivot.type = XCA_RSI_COOS;
|
||||
iPivot.symbol = cBar.symbol;
|
||||
iPivot.period = cBar.period;
|
||||
|
||||
//
|
||||
Add(
|
||||
cBar.low,
|
||||
iPivot.values //
|
||||
);
|
||||
Add(
|
||||
pBar.low,
|
||||
iPivot.values //
|
||||
);
|
||||
Add(
|
||||
p2Bar.low,
|
||||
iPivot.values //
|
||||
);
|
||||
Add(
|
||||
cBar.close,
|
||||
iPivot.values //
|
||||
);
|
||||
Add(
|
||||
pBar.close,
|
||||
iPivot.values //
|
||||
);
|
||||
Add(
|
||||
p2Bar.close,
|
||||
iPivot.values //
|
||||
);
|
||||
|
||||
//
|
||||
iPivot.reserve = GetMax(iPivot.values);
|
||||
|
||||
//
|
||||
AddPivot(
|
||||
iPivot,
|
||||
rsiCrossedOverOSPivots //
|
||||
);
|
||||
|
||||
//
|
||||
iPivot.Clean();
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// RSI Crossed Under OS ...
|
||||
if (detectRSICrossedUnderOBPivot)
|
||||
{
|
||||
//
|
||||
if (isRSIBearishVPattern)
|
||||
{
|
||||
//
|
||||
XCAPivot iPivot;
|
||||
|
||||
//
|
||||
iPivot.to = cBar.time;
|
||||
iPivot.from = p2Bar.time;
|
||||
iPivot.value = pBar.high;
|
||||
iPivot.type = XCA_RSI_CUOB;
|
||||
iPivot.symbol = cBar.symbol;
|
||||
iPivot.period = cBar.period;
|
||||
|
||||
//
|
||||
Add(
|
||||
cBar.high,
|
||||
iPivot.values //
|
||||
);
|
||||
Add(
|
||||
pBar.high,
|
||||
iPivot.values //
|
||||
);
|
||||
Add(
|
||||
p2Bar.high,
|
||||
iPivot.values //
|
||||
);
|
||||
Add(
|
||||
cBar.close,
|
||||
iPivot.values //
|
||||
);
|
||||
Add(
|
||||
pBar.close,
|
||||
iPivot.values //
|
||||
);
|
||||
Add(
|
||||
p2Bar.close,
|
||||
iPivot.values //
|
||||
);
|
||||
|
||||
//
|
||||
iPivot.reserve = GetMin(iPivot.values);
|
||||
|
||||
//
|
||||
AddPivot(
|
||||
iPivot,
|
||||
rsiCrossedUnderOBPivots //
|
||||
);
|
||||
|
||||
//
|
||||
iPivot.Clean();
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// CCI Crossed Over OS ...
|
||||
if (detectCCICrossedOverOSPivot)
|
||||
{
|
||||
//
|
||||
if (isCCIBullishVPattern)
|
||||
{
|
||||
//
|
||||
XCAPivot iPivot;
|
||||
|
||||
//
|
||||
iPivot.to = cBar.time;
|
||||
iPivot.from = p2Bar.time;
|
||||
iPivot.value = pBar.low;
|
||||
iPivot.type = XCA_CCI_COOS;
|
||||
iPivot.symbol = cBar.symbol;
|
||||
iPivot.period = cBar.period;
|
||||
|
||||
//
|
||||
Add(
|
||||
cBar.low,
|
||||
iPivot.values //
|
||||
);
|
||||
Add(
|
||||
pBar.low,
|
||||
iPivot.values //
|
||||
);
|
||||
Add(
|
||||
p2Bar.low,
|
||||
iPivot.values //
|
||||
);
|
||||
Add(
|
||||
cBar.close,
|
||||
iPivot.values //
|
||||
);
|
||||
Add(
|
||||
pBar.close,
|
||||
iPivot.values //
|
||||
);
|
||||
Add(
|
||||
p2Bar.close,
|
||||
iPivot.values //
|
||||
);
|
||||
|
||||
//
|
||||
iPivot.reserve = GetMax(iPivot.values);
|
||||
|
||||
//
|
||||
AddPivot(
|
||||
iPivot,
|
||||
cciCrossedOverOSPivots //
|
||||
);
|
||||
|
||||
//
|
||||
iPivot.Clean();
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// CCI Crossed Under OS ...
|
||||
if (detectCCICrossedUnderOBPivot)
|
||||
{
|
||||
//
|
||||
if (isCCIBearishVPattern)
|
||||
{
|
||||
//
|
||||
XCAPivot iPivot;
|
||||
|
||||
//
|
||||
iPivot.to = cBar.time;
|
||||
iPivot.from = p2Bar.time;
|
||||
iPivot.value = pBar.high;
|
||||
iPivot.type = XCA_CCI_CUOB;
|
||||
iPivot.symbol = cBar.symbol;
|
||||
iPivot.period = cBar.period;
|
||||
|
||||
//
|
||||
Add(
|
||||
cBar.high,
|
||||
iPivot.values //
|
||||
);
|
||||
Add(
|
||||
pBar.high,
|
||||
iPivot.values //
|
||||
);
|
||||
Add(
|
||||
p2Bar.high,
|
||||
iPivot.values //
|
||||
);
|
||||
Add(
|
||||
cBar.close,
|
||||
iPivot.values //
|
||||
);
|
||||
Add(
|
||||
pBar.close,
|
||||
iPivot.values //
|
||||
);
|
||||
Add(
|
||||
p2Bar.close,
|
||||
iPivot.values //
|
||||
);
|
||||
|
||||
//
|
||||
iPivot.reserve = GetMin(iPivot.values);
|
||||
|
||||
//
|
||||
AddPivot(
|
||||
iPivot,
|
||||
cciCrossedUnderOBPivots //
|
||||
);
|
||||
|
||||
//
|
||||
iPivot.Clean();
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
start++;
|
||||
|
||||
@@ -3307,7 +3622,7 @@ class XCXCAEAPOIDetector : public XCBase
|
||||
}
|
||||
Clean(tmp);
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
has = HasKIBullishPivots();
|
||||
if (has)
|
||||
@@ -3344,7 +3659,7 @@ class XCXCAEAPOIDetector : public XCBase
|
||||
}
|
||||
Clean(tmp);
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
has = HasValeSWLSupPivots();
|
||||
if (has)
|
||||
@@ -4795,6 +5110,54 @@ class XCXCAEAPOIDetector : public XCBase
|
||||
return ArraySize(hSameHHPivots);
|
||||
}
|
||||
|
||||
//
|
||||
bool HasRSICrossedOverOSPivots()
|
||||
{
|
||||
return HasChild(rsiCrossedOverOSPivots);
|
||||
}
|
||||
|
||||
//
|
||||
int CountRSICrossedOverOSPivots()
|
||||
{
|
||||
return ArraySize(rsiCrossedOverOSPivots);
|
||||
}
|
||||
|
||||
//
|
||||
bool HasRSICrossedUnderOBPivots()
|
||||
{
|
||||
return HasChild(rsiCrossedUnderOBPivots);
|
||||
}
|
||||
|
||||
//
|
||||
int CountRSICrossedUnderOBPivots()
|
||||
{
|
||||
return ArraySize(rsiCrossedUnderOBPivots);
|
||||
}
|
||||
|
||||
//
|
||||
bool HasCCICrossedOverOSPivots()
|
||||
{
|
||||
return HasChild(cciCrossedOverOSPivots);
|
||||
}
|
||||
|
||||
//
|
||||
int CountCCICrossedOverOSPivots()
|
||||
{
|
||||
return ArraySize(cciCrossedOverOSPivots);
|
||||
}
|
||||
|
||||
//
|
||||
bool HasCCICrossedUnderOBPivots()
|
||||
{
|
||||
return HasChild(cciCrossedUnderOBPivots);
|
||||
}
|
||||
|
||||
//
|
||||
int CountCCICrossedUnderOBPivots()
|
||||
{
|
||||
return ArraySize(cciCrossedUnderOBPivots);
|
||||
}
|
||||
|
||||
//
|
||||
// Protected ...
|
||||
protected:
|
||||
|
||||
Reference in New Issue
Block a user