This commit is contained in:
2025-05-01 03:35:28 +03:30
parent a974da75e8
commit 905413aa8c
8 changed files with 1361 additions and 61 deletions
+191 -34
View File
@@ -776,6 +776,13 @@ bool DetectXCAEAConditions(
double pRSI = conditions.rsiBuffer[pIDX];
double p2RSI = conditions.rsiBuffer[p2IDX];
//
// CCI ...
double zCCI = conditions.cciBuffer[zIDX];
double cCCI = conditions.cciBuffer[cIDX];
double pCCI = conditions.cciBuffer[pIDX];
double p2CCI = conditions.cciBuffer[p2IDX];
//
// X3MA ...
@@ -871,6 +878,14 @@ bool DetectXCAEAConditions(
//
// Create Conditions ...
//
bool isPRSIOB =
pRSI > conditions.rsiOBLevel;
//
bool isPRSIOS =
pRSI < conditions.rsiOSLevel;
//
bool isRSIBullish =
cRSI > pRSI &&
@@ -881,6 +896,24 @@ bool DetectXCAEAConditions(
cRSI < pRSI &&
!conditions.isRSIOS;
//
bool isPCCIOB =
pCCI > conditions.cciOBLevel;
//
bool isPCCIOS =
pCCI < conditions.cciOSLevel;
//
bool isCCIBullish =
cCCI > pCCI &&
!conditions.isCCIOB;
//
bool isCCIBearish =
cCCI < pCCI &&
!conditions.isCCIOS;
//
bool isLowOverMax = cBar.low > maxCTrendValue;
bool isHighUnderMin = cBar.high < minCTrendValue;
@@ -945,12 +978,15 @@ bool DetectXCAEAConditions(
//
// Parsing Pivots ...
XBoxZone rciPivot;
double providedSL = 0;
XBoxZone rejectedPivot;
XBoxZone insidePivots[];
XBoxZone rciContainers[];
int insidePivotsCount = 0;
bool isRejectedOnMid = false;
bool hasInsidePivots = false;
bool hasRCIContainers = false;
bool hasPivots = HasChild(pivots);
if (hasPivots)
{
@@ -1014,6 +1050,123 @@ bool DetectXCAEAConditions(
true,
true //
);
//
// Select CCI/RSI Cross Object ...
count = ArraySize(pivots);
for (int i = 0; i < count; i++)
{
//
XBoxZone iPivot = pivots[i];
//
ENUM_XCA_PIVOTS iType = GetPivotType(iPivot);
//
// Checking Type is Passed ...
has =
//
iType == XCA_RSI_COOS ||
iType == XCA_CCI_COOS ||
iType == XCA_RSI_CUOB ||
iType == XCA_CCI_CUOB
//
;
//
// Checking cBar is Pivots' Last Bar ...
has =
has &&
cBar.time <= iPivot.to &&
cBar.time > iPivot.from;
if (has)
{
//
rciPivot = iPivot;
//
iPivot.Clean();
//
break;
}
//
iPivot.Clean();
}
//
// Detect RCI Pivot Containers Pivots ...
count = ArraySize(pivots);
has = rciPivot.IsValid();
if (has)
{
//
for (int i = 0; i < count; i++)
{
//
XBoxZone iPivot = pivots[i];
//
ENUM_XCA_PIVOTS iType = GetPivotType(iPivot);
//
// Checking Type is Passed ...
has =
//
IsValid(iType) &&
(iType == XCA_PEAKSWHRES ||
iType == XCA_VALESWLSUP)
//
;
//
// Check Dir is Passed ...
has =
has &&
rciPivot.dir == iPivot.dir;
//
// Check RCI Pivot is Inside Pivot ...
has =
has &&
//
(
//
(rciPivot.lower >= iPivot.lower &&
rciPivot.lower < iPivot.upper)
//
||
//
(rciPivot.upper <= iPivot.upper &&
rciPivot.upper > iPivot.lower)
//
||
//
(rciPivot.upper > iPivot.upper &&
rciPivot.lower < iPivot.lower)
//
)
//
;
//
if (has)
{
//
AddRef(
iPivot,
rciContainers //
);
}
//
iPivot.Clean();
}
//
hasRCIContainers = HasChild(rciContainers);
}
}
//
@@ -1025,7 +1178,7 @@ bool DetectXCAEAConditions(
//
bool isCond1Bullish =
//
// false && // TODO: Remove this ...
false && // TODO: Remove this ...
isRSIBullish &&
isVolumeOverAvg &&
isVolumeOverLast &&
@@ -1039,7 +1192,7 @@ bool DetectXCAEAConditions(
//
bool isCond1Bearish =
//
// false && // TODO: Remove this ...
false && // TODO: Remove this ...
isRSIBearish &&
isVolumeOverAvg &&
isVolumeOverLast &&
@@ -1074,44 +1227,40 @@ bool DetectXCAEAConditions(
//
bool isCond2Bullish =
//
false &&
// false &&
//
isPRSIOS &&
isPCCIOS &&
isRSIBullish &&
isCCIBullish &&
hasRCIContainers &&
rciPivot.IsValid() &&
rciPivot.IsBullish() &&
conditions.isUnderMal &&
conditions.isValeIsPivot &&
// conditions.swingLowBuffer[cIDX] > conditions.valeBuffer[cIDX] &&
(conditions.isRSICrossedOverOS ||
conditions.isCCICrossedOverOS) &&
conditions.swingLowBuffer[cIDX] < conditions.fiboLevel3Buffer[cIDX]
//
// conditions.isRSIOS
//
// isVolumeOverAvg &&
// isVolumeBullish &&
// isVolumeOverLast &&
// c3MASlowState > 0 &&
// c3MAMediumState > 0 &&
// cBar.GetUp() > pSar &&
// conditions.isFastOverSlow &&
// conditions.isVidyaBullish &&
// conditions.isFastOverMedium &&
// isTrendRangeFinishedFromValid &&
// conditions.isSwingHighOverLast &&
// conditions.isSarSwitchedToBullish
//
//
// isX3MaBearishState &&
// isCBarBullishRejected // &&
// cBar.GetDown() > pVale &&
// conditions.isValeUnderLast
//
;
//
bool isCond2Bearish =
//
false // &&
// isX3MaBullishState &&
// isCBarBearishRejected // &&
// cBar.GetUp() < pPeak &&
// conditions.isPeakOverLast
// false &&
//
isPRSIOB &&
isPCCIOB &&
isRSIBearish &&
isCCIBearish &&
hasRCIContainers &&
rciPivot.IsValid() &&
rciPivot.IsBearish() &&
conditions.isOverMal &&
conditions.isPeakIsPivot &&
(conditions.isRSICrossedUnderOB ||
conditions.isCCICrossedUnderOB) &&
conditions.swingHighBuffer[cIDX] > conditions.fiboLevel1Buffer[cIDX]
//
;
@@ -1121,9 +1270,10 @@ bool DetectXCAEAConditions(
if (isCond2)
{
//
Print("Cond2");
isCond2Bullish = false;
isCond2Bearish = false;
pivotBox = rciPivot;
//
// Selectiing Pivot Box based on RCI Containers ...
}
//
@@ -1193,7 +1343,12 @@ bool DetectXCAEAConditions(
//
// Preparing SLs ...
if (isCond1)
//
// For Cond 1 ...
// For Cond 2 ...
if (isCond1 ||
isCond2)
{
//
if (isCond1Bullish)
@@ -1349,10 +1504,12 @@ bool DetectXCAEAConditions(
p2Bar.Clean();
p3Bar.Clean();
p4Bar.Clean();
rciPivot.Clean();
Clean(cTrendValues);
Clean(pTrendValues);
Clean(insidePivots);
pConditions.Clean();
Clean(rciContainers);
rejectedPivot.Clean();
//