This commit is contained in:
2025-04-19 16:35:21 +03:30
parent c96a77b4bb
commit a9e8fe04a8
6 changed files with 804 additions and 21 deletions
+367 -4
View File
@@ -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:
+232
View File
@@ -52,6 +52,10 @@ class XCXCAEAPOIDrawer : public XCBase
bool drawTrendBearishPivots;
bool drawTKITRNDBullishPivots;
bool drawTKITRNDBearishPivots;
bool drawRSICrossedOverOSPivots;
bool drawRSICrossedUnderOBPivots;
bool drawCCICrossedOverOSPivots;
bool drawCCICrossedUnderOBPivots;
//
// Constructors ...
@@ -88,6 +92,10 @@ class XCXCAEAPOIDrawer : public XCBase
mCycleSameHHPivotObjects.Clear();
mTKITRNDBullishPivotObjects.Clear();
mTKITRNDBearishPivotObjects.Clear();
mRSICrossedOverOSPivotObjects.Clear();
mRSICrossedUnderOBPivotObjects.Clear();
mCCICrossedOverOSPivotObjects.Clear();
mCCICrossedUnderOBPivotObjects.Clear();
//
ZeroMemory(drawer);
@@ -120,6 +128,10 @@ class XCXCAEAPOIDrawer : public XCBase
drawTrendBearishPivots = false;
drawTKITRNDBullishPivots = false;
drawTKITRNDBearishPivots = false;
drawRSICrossedOverOSPivots = false;
drawRSICrossedUnderOBPivots = false;
drawCCICrossedOverOSPivots = false;
drawCCICrossedUnderOBPivots = false;
}
//
@@ -142,6 +154,10 @@ class XCXCAEAPOIDrawer : public XCBase
DrawTrendBearishPivots(to);
DrawTKITRNDBullishPivots(to);
DrawTKITRNDBearishPivots(to);
DrawRSICrossedOverOSPivots(to);
DrawRSICrossedUnderOBPivots(to);
DrawCCICrossedOverOSPivots(to);
DrawCCICrossedUnderOBPivots(to);
}
//
@@ -1234,6 +1250,218 @@ class XCXCAEAPOIDrawer : public XCBase
}
}
//
void DrawRSICrossedOverOSPivots(datetime to = NULL)
{
//
if (!drawRSICrossedOverOSPivots)
{
return;
}
//
to = NULL;
bool canUpdateTo = IsValid(to);
//
int count = 0;
bool has = detector.HasRSICrossedOverOSPivots();
if (has)
{
//
count = detector.CountRSICrossedOverOSPivots();
for (int i = 0; i < count; i++)
{
//
XBoxZone iBox;
has = detector.rsiCrossedOverOSPivots[i].AsBox(iBox);
if (!has)
{
continue;
}
//
if (canUpdateTo)
{
iBox.to = to;
}
//
XCBoxObject *iObj;
has = drawer.DrawBox(
iBox,
iObj //
);
if (has)
{
mRSICrossedOverOSPivotObjects.Add(iObj);
}
//
iBox.Clean();
}
}
}
//
void DrawRSICrossedUnderOBPivots(datetime to = NULL)
{
//
if (!drawRSICrossedUnderOBPivots)
{
return;
}
//
to = NULL;
bool canUpdateTo = IsValid(to);
//
int count = 0;
bool has = detector.HasRSICrossedUnderOBPivots();
if (has)
{
//
count = detector.CountRSICrossedUnderOBPivots();
for (int i = 0; i < count; i++)
{
//
XBoxZone iBox;
has = detector.rsiCrossedUnderOBPivots[i].AsBox(iBox);
if (!has)
{
continue;
}
//
if (canUpdateTo)
{
iBox.to = to;
}
//
XCBoxObject *iObj;
has = drawer.DrawBox(
iBox,
iObj //
);
if (has)
{
mRSICrossedUnderOBPivotObjects.Add(iObj);
}
//
iBox.Clean();
}
}
}
//
void DrawCCICrossedOverOSPivots(datetime to = NULL)
{
//
if (!drawCCICrossedOverOSPivots)
{
return;
}
//
to = NULL;
bool canUpdateTo = IsValid(to);
//
int count = 0;
bool has = detector.HasCCICrossedOverOSPivots();
if (has)
{
//
count = detector.CountCCICrossedOverOSPivots();
for (int i = 0; i < count; i++)
{
//
XBoxZone iBox;
has = detector.cciCrossedOverOSPivots[i].AsBox(iBox);
if (!has)
{
continue;
}
//
if (canUpdateTo)
{
iBox.to = to;
}
//
XCBoxObject *iObj;
has = drawer.DrawBox(
iBox,
iObj //
);
if (has)
{
mCCICrossedOverOSPivotObjects.Add(iObj);
}
//
iBox.Clean();
}
}
}
//
void DrawCCICrossedUnderOBPivots(datetime to = NULL)
{
//
if (!drawCCICrossedUnderOBPivots)
{
return;
}
//
to = NULL;
bool canUpdateTo = IsValid(to);
//
int count = 0;
bool has = detector.HasCCICrossedUnderOBPivots();
if (has)
{
//
count = detector.CountCCICrossedUnderOBPivots();
for (int i = 0; i < count; i++)
{
//
XBoxZone iBox;
has = detector.cciCrossedUnderOBPivots[i].AsBox(iBox);
if (!has)
{
continue;
}
//
if (canUpdateTo)
{
iBox.to = to;
}
//
XCBoxObject *iObj;
has = drawer.DrawBox(
iBox,
iObj //
);
if (has)
{
mCCICrossedUnderOBPivotObjects.Add(iObj);
}
//
iBox.Clean();
}
}
}
//
// Protected ...
protected:
@@ -1267,6 +1495,10 @@ class XCXCAEAPOIDrawer : public XCBase
CArrayObj mTrendBearishPivotObjects;
CArrayObj mTKITRNDBullishPivotObjects;
CArrayObj mTKITRNDBearishPivotObjects;
CArrayObj mRSICrossedOverOSPivotObjects;
CArrayObj mRSICrossedUnderOBPivotObjects;
CArrayObj mCCICrossedOverOSPivotObjects;
CArrayObj mCCICrossedUnderOBPivotObjects;
//
};