This commit is contained in:
2025-06-20 00:54:33 +03:30
parent aedf10cace
commit bcf652d40e
3 changed files with 371 additions and 127 deletions
+127 -125
View File
@@ -641,6 +641,11 @@ CArrayObj mObjects;
XCPOIDrawer *mDrawer;
XCBarAnalyser *mBarAnalyser;
//
int sameKICount = 0;
int sameKIBullishCount = 0;
int sameKIBearishCount = 0;
//
int mSamePeakCount = 0;
int mSameValeCount = 0;
@@ -651,7 +656,7 @@ double mSameValeGolden = 0;
//
bool mDrawLiquidities = false;
bool mDrawRangeBreakes = true;
bool mDrawRangeBreakes = false;
//
bool mDetectLiquidities = true;
@@ -3677,7 +3682,7 @@ void DoProcess(
bool isCond1Trigger =
mBarAnalyser
.IsValidForTrigger(
iBar,
iPBar,
triggerDir,
true, // Cond 1 ...
false, // Cond 2 ...
@@ -3704,7 +3709,7 @@ void DoProcess(
bool isCond2Trigger =
mBarAnalyser
.IsValidForTrigger(
iBar,
iPBar,
triggerDir,
false, // Cond 1 ...
true, // Cond 2 ...
@@ -3731,7 +3736,7 @@ void DoProcess(
bool isCond3Trigger =
mBarAnalyser
.IsValidForTrigger(
iBar,
iPBar,
triggerDir,
false, // Cond 1 ...
false, // Cond 2 ...
@@ -3758,7 +3763,7 @@ void DoProcess(
bool isCond4Trigger =
mBarAnalyser
.IsValidForTrigger(
iBar,
iPBar,
triggerDir,
false, // Cond 1 ...
false, // Cond 2 ...
@@ -3785,7 +3790,7 @@ void DoProcess(
bool isCond5Trigger =
mBarAnalyser
.IsValidForTrigger(
iBar,
iPBar,
triggerDir,
false, // Cond 1 ...
false, // Cond 2 ...
@@ -3812,7 +3817,7 @@ void DoProcess(
bool isCond6Trigger =
mBarAnalyser
.IsValidForTrigger(
iBar,
iPBar,
triggerDir,
false, // Cond 1 ...
false, // Cond 2 ...
@@ -3839,7 +3844,7 @@ void DoProcess(
bool isCond7Trigger =
mBarAnalyser
.IsValidForTrigger(
iBar,
iPBar,
triggerDir,
false, // Cond 1 ...
false, // Cond 2 ...
@@ -3904,23 +3909,40 @@ void DoProcess(
// Reading Required Condiions ...
//
// HK Signal Bar ...
int pIndex = barIndex + 1;
int ppIndex = barIndex + 2;
//
double iHKSOpen = hkSBarOpenBuffer[barIndex];
double iHKSClose = hkSBarCloseBuffer[barIndex];
// SAR ...
//
double iHKSMax = MathMax(iHKSOpen, iHKSClose);
double iHKSMin = MathMin(iHKSOpen, iHKSClose);
bool isSarBullish = sarStateBuffer[pIndex] > 0;
bool isPSarBullish = sarStateBuffer[ppIndex] > 0;
//
bool isHKSBullish = hkSBarOpenBuffer[barIndex] < hkSBarCloseBuffer[barIndex];
bool isPHKSBullish = hkSBarOpenBuffer[barIndex + 1] < hkSBarCloseBuffer[barIndex + 1];
bool isSarBearish = sarStateBuffer[pIndex] < 0;
bool isPSarBearish = sarStateBuffer[ppIndex] < 0;
//
bool isHKSBearish = hkSBarOpenBuffer[barIndex] > hkSBarCloseBuffer[barIndex];
bool isPHKSBearish = hkSBarOpenBuffer[barIndex + 1] > hkSBarCloseBuffer[barIndex + 1];
bool isSarSwitchedToBullish =
isSarBullish &&
!isPSarBullish;
//
bool isSarSwitchedToBearish =
isSarBearish &&
!isPSarBearish;
//
// HKS ...
//
bool isHKSBullish = hkSBarCloseBuffer[pIndex] > hkSBarOpenBuffer[pIndex];
bool isPHKSBullish = hkSBarCloseBuffer[ppIndex] > hkSBarOpenBuffer[ppIndex];
//
bool isHKSBearish = hkSBarCloseBuffer[pIndex] < hkSBarOpenBuffer[pIndex];
bool isPHKSBearish = hkSBarCloseBuffer[ppIndex] < hkSBarOpenBuffer[ppIndex];
//
bool isHKSSwitchedToBullish =
@@ -3933,123 +3955,36 @@ void DoProcess(
!isPHKSBearish;
//
// TREND ...
// SB ...
//
double iTrend = trendBuffer[barIndex];
bool isTrendBullish = trendStateBuffer[barIndex] > 0;
bool isTrendBearish = trendStateBuffer[barIndex] < 0;
bool isTrendSwitchedToBullish =
trendStateBuffer[barIndex] > 0 &&
trendStateBuffer[barIndex + 1] <= 0;
bool isTrendSwitchedToBearish =
trendStateBuffer[barIndex] < 0 &&
trendStateBuffer[barIndex + 1] >= 0;
bool isSBullish = sBarCloseBuffer[pIndex] > sBarOpenBuffer[pIndex];
bool isPSBullish = sBarCloseBuffer[ppIndex] > sBarOpenBuffer[ppIndex];
//
// RSI ...
bool isSBearish = sBarCloseBuffer[pIndex] < sBarOpenBuffer[pIndex];
bool isPSBearish = sBarCloseBuffer[ppIndex] < sBarOpenBuffer[ppIndex];
//
bool isRSIOverOB = rsiBuffer[barIndex] > rsiOBLevel;
bool isPRSIOverOB = rsiBuffer[barIndex + 1] > rsiOBLevel;
bool isSSwitchedToBullish =
isSBullish &&
!isPSBullish;
//
bool isRSIUnderOB = rsiBuffer[barIndex] < rsiOBLevel;
bool isPRSIUnderOB = rsiBuffer[barIndex + 1] < rsiOBLevel;
//
bool isRSICrossedOverOB =
isRSIOverOB &&
!isPRSIOverOB;
//
bool isRSICrossedUnderOB =
isRSIUnderOB &&
!isPRSIUnderOB;
//
bool isRSIOverOS = rsiBuffer[barIndex] > rsiOSLevel;
bool isPRSIOverOS = rsiBuffer[barIndex + 1] > rsiOSLevel;
//
bool isRSIUnderOS = rsiBuffer[barIndex] < rsiOSLevel;
bool isPRSIUnderOS = rsiBuffer[barIndex + 1] < rsiOSLevel;
//
bool isRSICrossedOverOS =
isRSIOverOS &&
!isPRSIOverOS;
//
bool isRSICrossedUnderOS =
isRSIUnderOS &&
!isPRSIUnderOS;
//
// ADX ...
//
bool isADXOverThreshold = adxBuffer[barIndex] > adxThreshold;
bool isPADXOverThreshold = adxBuffer[barIndex + 1] > adxThreshold;
//
bool isADXUnderThreshold = adxBuffer[barIndex] < adxThreshold;
bool isPADXUnderThreshold = adxBuffer[barIndex + 1] < adxThreshold;
//
bool isADXCrossedOverThreshold =
isADXOverThreshold &&
!isPADXOverThreshold;
//
bool isADXCrossedUnderThreshold =
isADXUnderThreshold &&
!isPADXUnderThreshold;
//
bool isADXBullish = adxpBuffer[barIndex] > adxnBuffer[barIndex];
bool isPADXBullish = adxpBuffer[barIndex + 1] > adxnBuffer[barIndex + 1];
//
bool isADXBearish = adxpBuffer[barIndex] < adxnBuffer[barIndex];
bool isPADXBearish = adxpBuffer[barIndex + 1] < adxnBuffer[barIndex + 1];
//
bool isADXSwitchedToBullish =
isADXBullish &&
!isPADXBullish;
//
bool isADXSwitchedToBearish =
isADXBearish &&
!isPADXBearish;
//
bool isADXFullySwitchedToBullish =
isADXSwitchedToBullish &&
isADXCrossedOverThreshold;
//
bool isADXFullySwitchedToBearish =
isADXSwitchedToBearish &&
isADXCrossedUnderThreshold;
//
bool isTriggerBarOverHKS =
iBar.low > iHKSMax;
bool isTriggerBarUnderHKS =
iBar.high < iHKSMin;
bool isSSwitchedToBearish =
isSBearish &&
!isPSBearish;
//
// KI ...
//
bool isKIBullish = kiStateBuffer[barIndex] > 0;
bool isPKIBullish = kiStateBuffer[barIndex + 1] > 0;
bool isKIBullish = kiStateBuffer[pIndex] > 0;
bool isPKIBullish = kiStateBuffer[ppIndex] > 0;
//
bool isKIBearish = kiStateBuffer[barIndex] < 0;
bool isPKIBearish = kiStateBuffer[barIndex = 1] < 0;
bool isKIBearish = kiStateBuffer[pIndex] < 0;
bool isPKIBearish = kiStateBuffer[ppIndex] < 0;
//
bool isKISwitchedToBullish =
@@ -4061,6 +3996,63 @@ void DoProcess(
isKIBearish &&
!isPKIBearish;
//
bool isKIBullishBreaked =
iPBar.IsBreaked(
kiBuffer[pIndex],
X_DIRECTION_BULLISH,
X_FIBO_LEVEL_500,
X_BOUNDARY_PRICE_UP_DOWN //
);
//
bool isKIBearishBreaked =
iPBar.IsBreaked(
kiBuffer[pIndex],
X_DIRECTION_BEARISH,
X_FIBO_LEVEL_500,
X_BOUNDARY_PRICE_UP_DOWN //
);
//
bool isKISame = kiBuffer[pIndex] == kiBuffer[ppIndex];
bool isKIBullishSame =
isKISame &&
isKIBullish;
bool isKIBearishSame =
isKISame &&
isKIBearish;
//
if (isKISame)
{
sameKICount++;
}
else
{
sameKICount = 0;
}
//
if (isKIBullishSame)
{
sameKIBullishCount++;
}
else
{
sameKIBullishCount = 0;
}
//
if (isKIBearishSame)
{
sameKIBearishCount++;
}
else
{
sameKIBearishCount = 0;
}
//
// Validating Trigger Bar based on Conditions ...
if (isTriggerBar)
@@ -4079,9 +4071,14 @@ void DoProcess(
// Bullish ...
isBullish =
//
isHKSBullish &&
isKISwitchedToBullish &&
iBar.close > kiBuffer[barIndex]
// Conditions Validation ...
isKIBullishBreaked
// isSSwitchedToBullish
// isKISwitchedToBullish
// isSarSwitchedToBullish
// isHKSSwitchedToBullish
//
// Bar Validation ...
//
;
@@ -4089,9 +4086,14 @@ void DoProcess(
// Bearish ...
isBearish =
//
isHKSBearish &&
isKISwitchedToBearish &&
iBar.close < kiBuffer[barIndex]
// Conditions Validation ...
isKIBearishBreaked
// isSSwitchedToBearish
// isKISwitchedToBearish
// isSarSwitchedToBearish
// isHKSSwitchedToBearish
//
// Bar Validation ...
//
;