This commit is contained in:
2025-01-15 11:53:34 +03:30
parent 56cd60e31d
commit 341992374c
6 changed files with 737 additions and 145 deletions
+195 -16
View File
@@ -237,10 +237,10 @@ struct X121Conditions
bool isRsiCrossedOverOverSold;
//
bool isCloseOverAtrUpper;
bool isCloseOverAtrLower;
bool isCloseUnderAtrUpper;
bool isCloseUnderAtrLower;
bool isClosedOverAtrUpper;
bool isClosedOverAtrLower;
bool isClosedUnderAtrUpper;
bool isClosedUnderAtrLower;
//
bool isRejectUpAtrUpper;
@@ -349,9 +349,25 @@ struct X121Conditions
//
// Complex Conditions ...
double cheMin;
double cheMax;
double vwapMin;
double vwapMax;
//
bool isBreakedUpPrevCheMin;
bool isBreakedUpPrevCheMax;
bool isBreakedDownPrevCheMin;
bool isBreakedDownPrevCheMax;
bool isBreakedUpPrevCheLE1;
bool isBreakedUpPrevCheLE2;
bool isBreakedUpPrevCheSE1;
bool isBreakedUpPrevCheSE2;
bool isBreakedDownPrevCheLE1;
bool isBreakedDownPrevCheLE2;
bool isBreakedDownPrevCheSE1;
bool isBreakedDownPrevCheSE2;
//
bool isSarIncreased;
bool isSarDecreased;
@@ -473,11 +489,13 @@ struct X121Conditions
bool isStrLowerCrossedUnderDonLowLower;
//
bool isAtrUpperOverPeak;
bool isAtrUpperEqualsToPeak;
bool isAtrUpperCrossedUpPeak;
bool isAtrUpperCrossedDownPeak;
//
bool isAtrLowerUnderVale;
bool isAtrLowerEqualsToVale;
bool isAtrLowerCrossedUpVale;
bool isAtrLowerCrossedDownVale;
@@ -607,6 +625,8 @@ struct X121Conditions
ArraySetAsSeries(donCloseLowerBuffer, true);
//
cheMin = 0;
cheMax = 0;
vwapMin = 0;
vwapMax = 0;
@@ -659,12 +679,12 @@ struct X121Conditions
// ATR ...
//
isCloseOverAtrUpper = false;
isCloseOverAtrLower = false;
isClosedOverAtrUpper = false;
isClosedOverAtrLower = false;
//
isCloseUnderAtrUpper = false;
isCloseUnderAtrLower = false;
isClosedUnderAtrUpper = false;
isClosedUnderAtrLower = false;
//
isRejectUpAtrUpper = false;
@@ -858,6 +878,20 @@ struct X121Conditions
isBreakedUpPrevAtrLower = false;
isBreakedDownPrevAtrLower = false;
//
isBreakedUpPrevCheMin = false;
isBreakedUpPrevCheMax = false;
isBreakedDownPrevCheMin = false;
isBreakedDownPrevCheMax = false;
isBreakedUpPrevCheLE1 = false;
isBreakedUpPrevCheLE2 = false;
isBreakedUpPrevCheSE1 = false;
isBreakedUpPrevCheSE2 = false;
isBreakedDownPrevCheLE1 = false;
isBreakedDownPrevCheLE2 = false;
isBreakedDownPrevCheSE1 = false;
isBreakedDownPrevCheSE2 = false;
//
isSarIncreased = false;
isSarDecreased = false;
@@ -899,11 +933,13 @@ struct X121Conditions
isStrLowerUnderVale = false;
//
isAtrUpperOverPeak = false;
isAtrUpperEqualsToPeak = false;
isAtrUpperCrossedUpPeak = false;
isAtrUpperCrossedDownPeak = false;
//
isAtrLowerUnderVale = false;
isAtrLowerEqualsToVale = false;
isAtrLowerCrossedUpVale = false;
isAtrLowerCrossedDownVale = false;
@@ -1055,10 +1091,10 @@ struct X121Conditions
"-----------------------" + separator +
"ATR ..." + separator +
"-----------------------" + separator +
ToString("isCloseOverAtrUpper", isCloseOverAtrUpper, ignoreFalseConditions, separator) +
ToString("isCloseOverAtrLower", isCloseOverAtrLower, ignoreFalseConditions, separator) +
ToString("isCloseUnderAtrUpper", isCloseUnderAtrUpper, ignoreFalseConditions, separator) +
ToString("isCloseUnderAtrLower", isCloseUnderAtrLower, ignoreFalseConditions, separator) +
ToString("isClosedOverAtrUpper", isClosedOverAtrUpper, ignoreFalseConditions, separator) +
ToString("isClosedOverAtrLower", isClosedOverAtrLower, ignoreFalseConditions, separator) +
ToString("isClosedUnderAtrUpper", isClosedUnderAtrUpper, ignoreFalseConditions, separator) +
ToString("isClosedUnderAtrLower", isClosedUnderAtrLower, ignoreFalseConditions, separator) +
ToString("isRejectUpAtrUpper", isRejectUpAtrUpper, ignoreFalseConditions, separator) +
ToString("isRejectDownAtrUpper", isRejectDownAtrUpper, ignoreFalseConditions, separator) +
ToString("isRejectUpAtrLower", isRejectUpAtrLower, ignoreFalseConditions, separator) +
@@ -1165,6 +1201,8 @@ struct X121Conditions
ToString("isVWapMaxBreakedUp", isVWapMaxBreakedUp, ignoreFalseConditions, separator) +
ToString("isStrUpperOverPeak", isStrUpperOverPeak, ignoreFalseConditions, separator) +
ToString("isStrLowerOverVale", isStrLowerOverVale, ignoreFalseConditions, separator) +
ToString("isAtrUpperOverPeak", isAtrUpperOverPeak, ignoreFalseConditions, separator) +
ToString("isAtrLowerUnderVale", isAtrLowerUnderVale, ignoreFalseConditions, separator) +
ToString("isClosedOverVWapMin", isClosedOverVWapMin, ignoreFalseConditions, separator) +
ToString("isClosedOverVWapMax", isClosedOverVWapMax, ignoreFalseConditions, separator) +
ToString("isStrUpperUnderPeak", isStrUpperUnderPeak, ignoreFalseConditions, separator) +
@@ -1178,14 +1216,26 @@ struct X121Conditions
ToString("isBreakedDownPrevStr", isBreakedDownPrevStr, ignoreFalseConditions, separator) +
ToString("isSarCrossedOverVale", isSarCrossedOverVale, ignoreFalseConditions, separator) +
ToString("isStrCrossedOverVale", isStrCrossedOverVale, ignoreFalseConditions, separator) +
ToString("isBreakedUpPrevCheLE1", isBreakedUpPrevCheLE1, ignoreFalseConditions, separator) +
ToString("isBreakedUpPrevCheLE2", isBreakedUpPrevCheLE2, ignoreFalseConditions, separator) +
ToString("isBreakedUpPrevCheSE1", isBreakedUpPrevCheSE1, ignoreFalseConditions, separator) +
ToString("isBreakedUpPrevCheSE2", isBreakedUpPrevCheSE2, ignoreFalseConditions, separator) +
ToString("isSarCrossedUnderPeak", isSarCrossedUnderPeak, ignoreFalseConditions, separator) +
ToString("isStrCrossedUnderPeak", isStrCrossedUnderPeak, ignoreFalseConditions, separator) +
ToString("isNewPeakOverAtrUpper", isNewPeakOverAtrUpper, ignoreFalseConditions, separator) +
ToString("isBreakedUpPrevCheMin", isBreakedUpPrevCheMin, ignoreFalseConditions, separator) +
ToString("isBreakedUpPrevCheMax", isBreakedUpPrevCheMax, ignoreFalseConditions, separator) +
ToString("isNewValeUnderAtrLower", isNewValeUnderAtrLower, ignoreFalseConditions, separator) +
ToString("isStrUpperOverAtrUpper", isStrUpperOverAtrUpper, ignoreFalseConditions, separator) +
ToString("isStrLowerOverAtrLower", isStrLowerOverAtrLower, ignoreFalseConditions, separator) +
ToString("isAtrUpperEqualsToPeak", isAtrUpperEqualsToPeak, ignoreFalseConditions, separator) +
ToString("isAtrLowerEqualsToVale", isAtrLowerEqualsToVale, ignoreFalseConditions, separator) +
ToString("isBreakedDownPrevCheMin", isBreakedDownPrevCheMin, ignoreFalseConditions, separator) +
ToString("isBreakedDownPrevCheMax", isBreakedDownPrevCheMax, ignoreFalseConditions, separator) +
ToString("isBreakedDownPrevCheLE1", isBreakedDownPrevCheLE1, ignoreFalseConditions, separator) +
ToString("isBreakedDownPrevCheLE2", isBreakedDownPrevCheLE2, ignoreFalseConditions, separator) +
ToString("isBreakedDownPrevCheSE1", isBreakedDownPrevCheSE1, ignoreFalseConditions, separator) +
ToString("isBreakedDownPrevCheSE2", isBreakedDownPrevCheSE2, ignoreFalseConditions, separator) +
ToString("isAtrUpperCrossedUpPeak", isAtrUpperCrossedUpPeak, ignoreFalseConditions, separator) +
ToString("isAtrLowerCrossedUpVale", isAtrLowerCrossedUpVale, ignoreFalseConditions, separator) +
ToString("isStrUpperUnderAtrUpper", isStrUpperUnderAtrUpper, ignoreFalseConditions, separator) +
@@ -1893,14 +1943,14 @@ class XCX121Helper : public XCBase
conditions.isRsiOverBought = xatrConditions.isRsiOverBought;
conditions.isBreakUpAtrUpper = xatrConditions.isBreakUpAtrUpper;
conditions.isBreakUpAtrLower = xatrConditions.isBreakUpAtrLower;
conditions.isCloseOverAtrUpper = xatrConditions.isCloseOverAtrUpper;
conditions.isClosedOverAtrUpper = xatrConditions.isClosedOverAtrUpper;
conditions.isRejectUpAtrUpper = xatrConditions.isRejectUpAtrUpper;
conditions.isRejectUpAtrLower = xatrConditions.isRejectUpAtrLower;
conditions.isCloseOverAtrLower = xatrConditions.isCloseOverAtrLower;
conditions.isClosedOverAtrLower = xatrConditions.isClosedOverAtrLower;
conditions.isBreakDownAtrUpper = xatrConditions.isBreakDownAtrUpper;
conditions.isBreakDownAtrLower = xatrConditions.isBreakDownAtrLower;
conditions.isCloseUnderAtrUpper = xatrConditions.isCloseUnderAtrUpper;
conditions.isCloseUnderAtrLower = xatrConditions.isCloseUnderAtrLower;
conditions.isClosedUnderAtrUpper = xatrConditions.isClosedUnderAtrUpper;
conditions.isClosedUnderAtrLower = xatrConditions.isClosedUnderAtrLower;
conditions.isRejectDownAtrUpper = xatrConditions.isRejectDownAtrUpper;
conditions.isRejectDownAtrLower = xatrConditions.isRejectDownAtrLower;
conditions.isRsiCrossedOverOverSold = xatrConditions.isRsiCrossedOverOverSold;
@@ -2325,9 +2375,52 @@ class XCX121Helper : public XCBase
//
double prevSar = conditions.sarBuffer[pIDX];
double prevStr = conditions.strBuffer[pIDX];
double prevCheLE1 = conditions.le1Buffer[pIDX];
double prevCheLE2 = conditions.le2Buffer[pIDX];
double prevCheSE1 = conditions.se1Buffer[pIDX];
double prevCheSE2 = conditions.se2Buffer[pIDX];
double prevAtrUpper = conditions.atrUpperBuffer[pIDX];
double prevAtrLower = conditions.atrLowerBuffer[pIDX];
//
double ches[];
if (prevCheLE1 != EMPTY_VALUE)
{
//
Add(
prevCheLE1,
ches //
);
}
if (prevCheLE2 != EMPTY_VALUE)
{
//
Add(
prevCheLE2,
ches //
);
}
if (prevCheSE1 != EMPTY_VALUE)
{
//
Add(
prevCheSE1,
ches //
);
}
if (prevCheSE2 != EMPTY_VALUE)
{
//
Add(
prevCheSE2,
ches //
);
}
//
double cheMin = GetMin(ches);
double cheMax = GetMax(ches);
//
bool isBreakedUpPrevSar = IsBarBreak(
prevSar,
@@ -2376,6 +2469,74 @@ class XCX121Helper : public XCBase
cBar //
);
//
bool isBreakedUpPrevCheLE1 = IsBarBreak(
prevCheLE1,
X_DIRECTION_BULLISH,
cBar //
);
bool isBreakedUpPrevCheLE2 = IsBarBreak(
prevCheLE2,
X_DIRECTION_BULLISH,
cBar //
);
bool isBreakedUpPrevCheSE1 = IsBarBreak(
prevCheSE1,
X_DIRECTION_BULLISH,
cBar //
);
bool isBreakedUpPrevCheSE2 = IsBarBreak(
prevCheSE2,
X_DIRECTION_BULLISH,
cBar //
);
//
bool isBreakedDownPrevCheLE1 = IsBarBreak(
prevCheLE1,
X_DIRECTION_BEARISH,
cBar //
);
bool isBreakedDownPrevCheLE2 = IsBarBreak(
prevCheLE2,
X_DIRECTION_BEARISH,
cBar //
);
bool isBreakedDownPrevCheSE1 = IsBarBreak(
prevCheSE1,
X_DIRECTION_BEARISH,
cBar //
);
bool isBreakedDownPrevCheSE2 = IsBarBreak(
prevCheSE2,
X_DIRECTION_BEARISH,
cBar //
);
//
bool isBreakedUpPrevCheMin = IsBarBreak(
cheMin,
X_DIRECTION_BULLISH,
cBar //
);
bool isBreakedDownPrevCheMin = IsBarBreak(
cheMin,
X_DIRECTION_BEARISH,
cBar //
);
//
bool isBreakedUpPrevCheMax = IsBarBreak(
cheMax,
X_DIRECTION_BULLISH,
cBar //
);
bool isBreakedDownPrevCheMax = IsBarBreak(
cheMax,
X_DIRECTION_BEARISH,
cBar //
);
//
bool isSarCrossedUnderPeak =
conditions.sarBuffer[cIDX] < conditions.peaksBuffer[cIDX] &&
@@ -2519,6 +2680,7 @@ class XCX121Helper : public XCBase
!isStrLowerUnderDonLowLowerPrev;
//
bool isAtrUpperOverPeak = conditions.atrUpperBuffer[cIDX] > conditions.peaksBuffer[cIDX];
bool isAtrUpperEqualsToPeak = conditions.atrUpperBuffer[cIDX] == conditions.peaksBuffer[cIDX];
//
@@ -2528,6 +2690,7 @@ class XCX121Helper : public XCBase
!(conditions.atrUpperBuffer[cIDX] < conditions.peaksBuffer[cIDX]);
//
bool isAtrLowerUnderVale = conditions.atrUpperBuffer[cIDX] < conditions.valesBuffer[cIDX];
bool isAtrLowerEqualsToVale = conditions.atrUpperBuffer[cIDX] == conditions.valesBuffer[cIDX];
//
@@ -2537,6 +2700,8 @@ class XCX121Helper : public XCBase
!(conditions.atrUpperBuffer[cIDX] < conditions.valesBuffer[cIDX]);
//
conditions.cheMin = cheMin;
conditions.cheMax = cheMax;
conditions.vwapMin = vwapMin;
conditions.vwapMax = vwapMax;
@@ -2554,6 +2719,8 @@ class XCX121Helper : public XCBase
conditions.isVWapMaxBreakedUp = isVWapMaxBreakedUp;
conditions.isBreakedUpPrevSar = isBreakedUpPrevSar;
conditions.isBreakedUpPrevStr = isBreakedUpPrevStr;
conditions.isAtrUpperOverPeak = isAtrUpperOverPeak;
conditions.isAtrLowerUnderVale = isAtrLowerUnderVale;
conditions.isStrLowerUnderVale = isStrLowerUnderVale;
conditions.isStrUpperUnderPeak = isStrUpperUnderPeak;
conditions.isValeUnderAtrLower = isValeUnderAtrLower;
@@ -2570,11 +2737,23 @@ class XCX121Helper : public XCBase
conditions.isSarCrossedUnderPeak = isSarCrossedUnderPeak;
conditions.isStrCrossedUnderPeak = isStrCrossedUnderPeak;
conditions.isNewPeakOverAtrUpper = isNewPeakOverAtrUpper;
conditions.isBreakedUpPrevCheLE1 = isBreakedUpPrevCheLE1;
conditions.isBreakedUpPrevCheLE2 = isBreakedUpPrevCheLE2;
conditions.isBreakedUpPrevCheSE1 = isBreakedUpPrevCheSE1;
conditions.isBreakedUpPrevCheSE2 = isBreakedUpPrevCheSE2;
conditions.isBreakedUpPrevCheMin = isBreakedUpPrevCheMin;
conditions.isBreakedUpPrevCheMax = isBreakedUpPrevCheMax;
conditions.isAtrUpperEqualsToPeak = isAtrUpperEqualsToPeak;
conditions.isAtrLowerEqualsToVale = isAtrLowerEqualsToVale;
conditions.isNewValeUnderAtrLower = isNewValeUnderAtrLower;
conditions.isStrUpperOverAtrUpper = isStrUpperOverAtrUpper;
conditions.isStrLowerOverAtrLower = isStrLowerOverAtrLower;
conditions.isBreakedDownPrevCheMin = isBreakedDownPrevCheMin;
conditions.isBreakedDownPrevCheMax = isBreakedDownPrevCheMax;
conditions.isBreakedDownPrevCheLE1 = isBreakedDownPrevCheLE1;
conditions.isBreakedDownPrevCheLE2 = isBreakedDownPrevCheLE2;
conditions.isBreakedDownPrevCheSE1 = isBreakedDownPrevCheSE1;
conditions.isBreakedDownPrevCheSE2 = isBreakedDownPrevCheSE2;
conditions.isStrUpperUnderAtrUpper = isStrUpperUnderAtrUpper;
conditions.isStrLowerUnderAtrLower = isStrLowerUnderAtrLower;
conditions.isBreakedUpPrevAtrUpper = isBreakedUpPrevAtrUpper;
+20 -20
View File
@@ -210,12 +210,12 @@ struct X121XATRConditions
// ATR ...
//
bool isCloseOverAtrUpper;
bool isCloseOverAtrLower;
bool isClosedOverAtrUpper;
bool isClosedOverAtrLower;
//
bool isCloseUnderAtrUpper;
bool isCloseUnderAtrLower;
bool isClosedUnderAtrUpper;
bool isClosedUnderAtrLower;
//
bool isRejectUpAtrUpper;
@@ -296,12 +296,12 @@ struct X121XATRConditions
// ATR ...
//
isCloseOverAtrUpper = false;
isCloseOverAtrLower = false;
isClosedOverAtrUpper = false;
isClosedOverAtrLower = false;
//
isCloseUnderAtrUpper = false;
isCloseUnderAtrLower = false;
isClosedUnderAtrUpper = false;
isClosedUnderAtrLower = false;
//
isRejectUpAtrUpper = false;
@@ -402,10 +402,10 @@ struct X121XATRConditions
ToString("isRsiCrossedOverOverSold", isRsiCrossedOverOverSold, ignoreFalseConditions, separator) +
//
// ATR ...
ToString("isCloseOverAtrUpper", isCloseOverAtrUpper, ignoreFalseConditions, separator) +
ToString("isCloseOverAtrLower", isCloseOverAtrLower, ignoreFalseConditions, separator) +
ToString("isCloseUnderAtrUpper", isCloseUnderAtrUpper, ignoreFalseConditions, separator) +
ToString("isCloseUnderAtrLower", isCloseUnderAtrLower, ignoreFalseConditions, separator) +
ToString("isClosedOverAtrUpper", isClosedOverAtrUpper, ignoreFalseConditions, separator) +
ToString("isClosedOverAtrLower", isClosedOverAtrLower, ignoreFalseConditions, separator) +
ToString("isClosedUnderAtrUpper", isClosedUnderAtrUpper, ignoreFalseConditions, separator) +
ToString("isClosedUnderAtrLower", isClosedUnderAtrLower, ignoreFalseConditions, separator) +
ToString("isRejectUpAtrUpper", isRejectUpAtrUpper, ignoreFalseConditions, separator) +
ToString("isRejectDownAtrUpper", isRejectDownAtrUpper, ignoreFalseConditions, separator) +
ToString("isRejectUpAtrLower", isRejectUpAtrLower, ignoreFalseConditions, separator) +
@@ -1022,12 +1022,12 @@ class XCX121XATRHelper : public XCBaseHelper
// ATR ...
//
bool isCloseOverAtrUpper = cBar.close > conditions.atrUpperBuffer[cIDX];
bool isCloseOverAtrLower = cBar.close > conditions.atrLowerBuffer[cIDX];
bool isClosedOverAtrUpper = cBar.close > conditions.atrUpperBuffer[cIDX];
bool isClosedOverAtrLower = cBar.close > conditions.atrLowerBuffer[cIDX];
//
bool isCloseUnderAtrUpper = cBar.close < conditions.atrUpperBuffer[cIDX];
bool isCloseUnderAtrLower = cBar.close < conditions.atrLowerBuffer[cIDX];
bool isClosedUnderAtrUpper = cBar.close < conditions.atrUpperBuffer[cIDX];
bool isClosedUnderAtrLower = cBar.close < conditions.atrLowerBuffer[cIDX];
//
bool isRejectUpAtrUpper = IsBarReject(
@@ -1088,12 +1088,12 @@ class XCX121XATRHelper : public XCBaseHelper
conditions.isBreakUpAtrLower = isBreakUpAtrLower;
conditions.isRejectDownAtrUpper = isRejectDownAtrUpper;
conditions.isRejectDownAtrLower = isRejectDownAtrLower;
conditions.isCloseOverAtrUpper = isCloseOverAtrUpper;
conditions.isCloseOverAtrLower = isCloseOverAtrLower;
conditions.isClosedOverAtrUpper = isClosedOverAtrUpper;
conditions.isClosedOverAtrLower = isClosedOverAtrLower;
conditions.isBreakDownAtrUpper = isBreakDownAtrUpper;
conditions.isBreakDownAtrLower = isBreakDownAtrLower;
conditions.isCloseUnderAtrUpper = isCloseUnderAtrUpper;
conditions.isCloseUnderAtrLower = isCloseUnderAtrLower;
conditions.isClosedUnderAtrUpper = isClosedUnderAtrUpper;
conditions.isClosedUnderAtrLower = isClosedUnderAtrLower;
conditions.isRsiCrossedOverOverSold = isRsiCrossedOverOverSold;
conditions.isRsiCrossedUnderOverSold = isRsiCrossedUnderOverSold;
conditions.isRsiCrossedOverOverBought = isRsiCrossedOverOverBought;