last ...
This commit is contained in:
@@ -350,3 +350,208 @@
|
|||||||
bool isHCMaSwitchedToBearish =
|
bool isHCMaSwitchedToBearish =
|
||||||
isHCMaBearish &&
|
isHCMaBearish &&
|
||||||
!isPHCMaBearish;
|
!isPHCMaBearish;
|
||||||
|
|
||||||
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
//
|
||||||
|
// HK Signal Bar ...
|
||||||
|
|
||||||
|
//
|
||||||
|
double iHKSOpen = hkSBarOpenBuffer[barIndex];
|
||||||
|
double iHKSClose = hkSBarCloseBuffer[barIndex];
|
||||||
|
|
||||||
|
//
|
||||||
|
double iHKSMax = MathMax(iHKSOpen, iHKSClose);
|
||||||
|
double iHKSMin = MathMin(iHKSOpen, iHKSClose);
|
||||||
|
|
||||||
|
//
|
||||||
|
bool isHKSBullish = hkSBarOpenBuffer[barIndex] < hkSBarCloseBuffer[barIndex];
|
||||||
|
bool isPHKSBullish = hkSBarOpenBuffer[barIndex + 1] < hkSBarCloseBuffer[barIndex + 1];
|
||||||
|
|
||||||
|
//
|
||||||
|
bool isHKSBearish = hkSBarOpenBuffer[barIndex] > hkSBarCloseBuffer[barIndex];
|
||||||
|
bool isPHKSBearish = hkSBarOpenBuffer[barIndex + 1] > hkSBarCloseBuffer[barIndex + 1];
|
||||||
|
|
||||||
|
//
|
||||||
|
bool isHKSSwitchedToBullish =
|
||||||
|
isHKSBullish &&
|
||||||
|
!isPHKSBullish;
|
||||||
|
|
||||||
|
//
|
||||||
|
bool isHKSSwitchedToBearish =
|
||||||
|
isHKSBearish &&
|
||||||
|
!isPHKSBearish;
|
||||||
|
|
||||||
|
//
|
||||||
|
// TREND ...
|
||||||
|
|
||||||
|
//
|
||||||
|
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;
|
||||||
|
|
||||||
|
//
|
||||||
|
// RSI ...
|
||||||
|
|
||||||
|
//
|
||||||
|
bool isRSIOverOB = rsiBuffer[barIndex] > rsiOBLevel;
|
||||||
|
bool isPRSIOverOB = rsiBuffer[barIndex + 1] > rsiOBLevel;
|
||||||
|
|
||||||
|
//
|
||||||
|
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;
|
||||||
|
|
||||||
|
//
|
||||||
|
// KI ...
|
||||||
|
|
||||||
|
//
|
||||||
|
bool isKIBullish = kiStateBuffer[barIndex] > 0;
|
||||||
|
bool isPKIBullish = kiStateBuffer[barIndex + 1] > 0;
|
||||||
|
|
||||||
|
//
|
||||||
|
bool isKIBearish = kiStateBuffer[barIndex] < 0;
|
||||||
|
bool isPKIBearish = kiStateBuffer[barIndex = 1] < 0;
|
||||||
|
|
||||||
|
// //
|
||||||
|
// bool isKIOverHKS =
|
||||||
|
// kiBuffer[barIndex] > iHKSMax;
|
||||||
|
|
||||||
|
// //
|
||||||
|
// bool isKIUnderHKS =
|
||||||
|
// kiBuffer[barIndex] < iHKSMin;
|
||||||
|
|
||||||
|
//
|
||||||
|
bool isKISwitchedToBullish =
|
||||||
|
isKIBullish &&
|
||||||
|
!isPKIBullish;
|
||||||
|
|
||||||
|
//
|
||||||
|
bool isKISwitchedToBearish =
|
||||||
|
isKIBearish &&
|
||||||
|
!isPKIBearish;
|
||||||
|
|
||||||
|
//
|
||||||
|
// Detecting Signal ...
|
||||||
|
|
||||||
|
//
|
||||||
|
// Bullish ...
|
||||||
|
isBullish =
|
||||||
|
//
|
||||||
|
false
|
||||||
|
// Conditions Validation ...
|
||||||
|
// isKIOverHKS &&
|
||||||
|
// isHKSBullish &&
|
||||||
|
// isKISwitchedToBullish
|
||||||
|
// &&
|
||||||
|
//
|
||||||
|
// Bar Validation ...
|
||||||
|
// iBar.IsBullish() &&
|
||||||
|
// iBar.close > kiBuffer[barIndex]
|
||||||
|
//
|
||||||
|
;
|
||||||
|
|
||||||
|
//
|
||||||
|
// Bearish ...
|
||||||
|
isBearish =
|
||||||
|
//
|
||||||
|
false
|
||||||
|
// Conditions Validation ...
|
||||||
|
// isKIUnderHKS &&
|
||||||
|
// isHKSBearish &&
|
||||||
|
// isKISwitchedToBearish
|
||||||
|
// &&
|
||||||
|
//
|
||||||
|
// Bar Validation ...
|
||||||
|
// iBar.IsBearish() &&
|
||||||
|
// iBar.close < kiBuffer[barIndex]
|
||||||
|
//
|
||||||
|
;
|
||||||
|
|||||||
@@ -641,6 +641,11 @@ CArrayObj mObjects;
|
|||||||
XCPOIDrawer *mDrawer;
|
XCPOIDrawer *mDrawer;
|
||||||
XCBarAnalyser *mBarAnalyser;
|
XCBarAnalyser *mBarAnalyser;
|
||||||
|
|
||||||
|
//
|
||||||
|
int sameKICount = 0;
|
||||||
|
int sameKIBullishCount = 0;
|
||||||
|
int sameKIBearishCount = 0;
|
||||||
|
|
||||||
//
|
//
|
||||||
int mSamePeakCount = 0;
|
int mSamePeakCount = 0;
|
||||||
int mSameValeCount = 0;
|
int mSameValeCount = 0;
|
||||||
@@ -651,7 +656,7 @@ double mSameValeGolden = 0;
|
|||||||
|
|
||||||
//
|
//
|
||||||
bool mDrawLiquidities = false;
|
bool mDrawLiquidities = false;
|
||||||
bool mDrawRangeBreakes = true;
|
bool mDrawRangeBreakes = false;
|
||||||
|
|
||||||
//
|
//
|
||||||
bool mDetectLiquidities = true;
|
bool mDetectLiquidities = true;
|
||||||
@@ -3677,7 +3682,7 @@ void DoProcess(
|
|||||||
bool isCond1Trigger =
|
bool isCond1Trigger =
|
||||||
mBarAnalyser
|
mBarAnalyser
|
||||||
.IsValidForTrigger(
|
.IsValidForTrigger(
|
||||||
iBar,
|
iPBar,
|
||||||
triggerDir,
|
triggerDir,
|
||||||
true, // Cond 1 ...
|
true, // Cond 1 ...
|
||||||
false, // Cond 2 ...
|
false, // Cond 2 ...
|
||||||
@@ -3704,7 +3709,7 @@ void DoProcess(
|
|||||||
bool isCond2Trigger =
|
bool isCond2Trigger =
|
||||||
mBarAnalyser
|
mBarAnalyser
|
||||||
.IsValidForTrigger(
|
.IsValidForTrigger(
|
||||||
iBar,
|
iPBar,
|
||||||
triggerDir,
|
triggerDir,
|
||||||
false, // Cond 1 ...
|
false, // Cond 1 ...
|
||||||
true, // Cond 2 ...
|
true, // Cond 2 ...
|
||||||
@@ -3731,7 +3736,7 @@ void DoProcess(
|
|||||||
bool isCond3Trigger =
|
bool isCond3Trigger =
|
||||||
mBarAnalyser
|
mBarAnalyser
|
||||||
.IsValidForTrigger(
|
.IsValidForTrigger(
|
||||||
iBar,
|
iPBar,
|
||||||
triggerDir,
|
triggerDir,
|
||||||
false, // Cond 1 ...
|
false, // Cond 1 ...
|
||||||
false, // Cond 2 ...
|
false, // Cond 2 ...
|
||||||
@@ -3758,7 +3763,7 @@ void DoProcess(
|
|||||||
bool isCond4Trigger =
|
bool isCond4Trigger =
|
||||||
mBarAnalyser
|
mBarAnalyser
|
||||||
.IsValidForTrigger(
|
.IsValidForTrigger(
|
||||||
iBar,
|
iPBar,
|
||||||
triggerDir,
|
triggerDir,
|
||||||
false, // Cond 1 ...
|
false, // Cond 1 ...
|
||||||
false, // Cond 2 ...
|
false, // Cond 2 ...
|
||||||
@@ -3785,7 +3790,7 @@ void DoProcess(
|
|||||||
bool isCond5Trigger =
|
bool isCond5Trigger =
|
||||||
mBarAnalyser
|
mBarAnalyser
|
||||||
.IsValidForTrigger(
|
.IsValidForTrigger(
|
||||||
iBar,
|
iPBar,
|
||||||
triggerDir,
|
triggerDir,
|
||||||
false, // Cond 1 ...
|
false, // Cond 1 ...
|
||||||
false, // Cond 2 ...
|
false, // Cond 2 ...
|
||||||
@@ -3812,7 +3817,7 @@ void DoProcess(
|
|||||||
bool isCond6Trigger =
|
bool isCond6Trigger =
|
||||||
mBarAnalyser
|
mBarAnalyser
|
||||||
.IsValidForTrigger(
|
.IsValidForTrigger(
|
||||||
iBar,
|
iPBar,
|
||||||
triggerDir,
|
triggerDir,
|
||||||
false, // Cond 1 ...
|
false, // Cond 1 ...
|
||||||
false, // Cond 2 ...
|
false, // Cond 2 ...
|
||||||
@@ -3839,7 +3844,7 @@ void DoProcess(
|
|||||||
bool isCond7Trigger =
|
bool isCond7Trigger =
|
||||||
mBarAnalyser
|
mBarAnalyser
|
||||||
.IsValidForTrigger(
|
.IsValidForTrigger(
|
||||||
iBar,
|
iPBar,
|
||||||
triggerDir,
|
triggerDir,
|
||||||
false, // Cond 1 ...
|
false, // Cond 1 ...
|
||||||
false, // Cond 2 ...
|
false, // Cond 2 ...
|
||||||
@@ -3904,23 +3909,40 @@ void DoProcess(
|
|||||||
// Reading Required Condiions ...
|
// Reading Required Condiions ...
|
||||||
|
|
||||||
//
|
//
|
||||||
// HK Signal Bar ...
|
int pIndex = barIndex + 1;
|
||||||
|
int ppIndex = barIndex + 2;
|
||||||
|
|
||||||
//
|
//
|
||||||
double iHKSOpen = hkSBarOpenBuffer[barIndex];
|
// SAR ...
|
||||||
double iHKSClose = hkSBarCloseBuffer[barIndex];
|
|
||||||
|
|
||||||
//
|
//
|
||||||
double iHKSMax = MathMax(iHKSOpen, iHKSClose);
|
bool isSarBullish = sarStateBuffer[pIndex] > 0;
|
||||||
double iHKSMin = MathMin(iHKSOpen, iHKSClose);
|
bool isPSarBullish = sarStateBuffer[ppIndex] > 0;
|
||||||
|
|
||||||
//
|
//
|
||||||
bool isHKSBullish = hkSBarOpenBuffer[barIndex] < hkSBarCloseBuffer[barIndex];
|
bool isSarBearish = sarStateBuffer[pIndex] < 0;
|
||||||
bool isPHKSBullish = hkSBarOpenBuffer[barIndex + 1] < hkSBarCloseBuffer[barIndex + 1];
|
bool isPSarBearish = sarStateBuffer[ppIndex] < 0;
|
||||||
|
|
||||||
//
|
//
|
||||||
bool isHKSBearish = hkSBarOpenBuffer[barIndex] > hkSBarCloseBuffer[barIndex];
|
bool isSarSwitchedToBullish =
|
||||||
bool isPHKSBearish = hkSBarOpenBuffer[barIndex + 1] > hkSBarCloseBuffer[barIndex + 1];
|
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 =
|
bool isHKSSwitchedToBullish =
|
||||||
@@ -3933,123 +3955,36 @@ void DoProcess(
|
|||||||
!isPHKSBearish;
|
!isPHKSBearish;
|
||||||
|
|
||||||
//
|
//
|
||||||
// TREND ...
|
// SB ...
|
||||||
|
|
||||||
//
|
//
|
||||||
double iTrend = trendBuffer[barIndex];
|
bool isSBullish = sBarCloseBuffer[pIndex] > sBarOpenBuffer[pIndex];
|
||||||
bool isTrendBullish = trendStateBuffer[barIndex] > 0;
|
bool isPSBullish = sBarCloseBuffer[ppIndex] > sBarOpenBuffer[ppIndex];
|
||||||
bool isTrendBearish = trendStateBuffer[barIndex] < 0;
|
|
||||||
bool isTrendSwitchedToBullish =
|
|
||||||
trendStateBuffer[barIndex] > 0 &&
|
|
||||||
trendStateBuffer[barIndex + 1] <= 0;
|
|
||||||
bool isTrendSwitchedToBearish =
|
|
||||||
trendStateBuffer[barIndex] < 0 &&
|
|
||||||
trendStateBuffer[barIndex + 1] >= 0;
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// RSI ...
|
bool isSBearish = sBarCloseBuffer[pIndex] < sBarOpenBuffer[pIndex];
|
||||||
|
bool isPSBearish = sBarCloseBuffer[ppIndex] < sBarOpenBuffer[ppIndex];
|
||||||
|
|
||||||
//
|
//
|
||||||
bool isRSIOverOB = rsiBuffer[barIndex] > rsiOBLevel;
|
bool isSSwitchedToBullish =
|
||||||
bool isPRSIOverOB = rsiBuffer[barIndex + 1] > rsiOBLevel;
|
isSBullish &&
|
||||||
|
!isPSBullish;
|
||||||
|
|
||||||
//
|
//
|
||||||
bool isRSIUnderOB = rsiBuffer[barIndex] < rsiOBLevel;
|
bool isSSwitchedToBearish =
|
||||||
bool isPRSIUnderOB = rsiBuffer[barIndex + 1] < rsiOBLevel;
|
isSBearish &&
|
||||||
|
!isPSBearish;
|
||||||
//
|
|
||||||
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;
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// KI ...
|
// KI ...
|
||||||
|
|
||||||
//
|
//
|
||||||
bool isKIBullish = kiStateBuffer[barIndex] > 0;
|
bool isKIBullish = kiStateBuffer[pIndex] > 0;
|
||||||
bool isPKIBullish = kiStateBuffer[barIndex + 1] > 0;
|
bool isPKIBullish = kiStateBuffer[ppIndex] > 0;
|
||||||
|
|
||||||
//
|
//
|
||||||
bool isKIBearish = kiStateBuffer[barIndex] < 0;
|
bool isKIBearish = kiStateBuffer[pIndex] < 0;
|
||||||
bool isPKIBearish = kiStateBuffer[barIndex = 1] < 0;
|
bool isPKIBearish = kiStateBuffer[ppIndex] < 0;
|
||||||
|
|
||||||
//
|
//
|
||||||
bool isKISwitchedToBullish =
|
bool isKISwitchedToBullish =
|
||||||
@@ -4061,6 +3996,63 @@ void DoProcess(
|
|||||||
isKIBearish &&
|
isKIBearish &&
|
||||||
!isPKIBearish;
|
!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 ...
|
// Validating Trigger Bar based on Conditions ...
|
||||||
if (isTriggerBar)
|
if (isTriggerBar)
|
||||||
@@ -4079,9 +4071,14 @@ void DoProcess(
|
|||||||
// Bullish ...
|
// Bullish ...
|
||||||
isBullish =
|
isBullish =
|
||||||
//
|
//
|
||||||
isHKSBullish &&
|
// Conditions Validation ...
|
||||||
isKISwitchedToBullish &&
|
isKIBullishBreaked
|
||||||
iBar.close > kiBuffer[barIndex]
|
// isSSwitchedToBullish
|
||||||
|
// isKISwitchedToBullish
|
||||||
|
// isSarSwitchedToBullish
|
||||||
|
// isHKSSwitchedToBullish
|
||||||
|
//
|
||||||
|
// Bar Validation ...
|
||||||
//
|
//
|
||||||
;
|
;
|
||||||
|
|
||||||
@@ -4089,9 +4086,14 @@ void DoProcess(
|
|||||||
// Bearish ...
|
// Bearish ...
|
||||||
isBearish =
|
isBearish =
|
||||||
//
|
//
|
||||||
isHKSBearish &&
|
// Conditions Validation ...
|
||||||
isKISwitchedToBearish &&
|
isKIBearishBreaked
|
||||||
iBar.close < kiBuffer[barIndex]
|
// isSSwitchedToBearish
|
||||||
|
// isKISwitchedToBearish
|
||||||
|
// isSarSwitchedToBearish
|
||||||
|
// isHKSSwitchedToBearish
|
||||||
|
//
|
||||||
|
// Bar Validation ...
|
||||||
//
|
//
|
||||||
;
|
;
|
||||||
|
|
||||||
|
|||||||
@@ -1052,7 +1052,9 @@ struct XOHCL
|
|||||||
//
|
//
|
||||||
bool IsBreaked(
|
bool IsBreaked(
|
||||||
double price,
|
double price,
|
||||||
ENUM_X_DIRECTION forDir //
|
ENUM_X_DIRECTION forDir,
|
||||||
|
ENUM_X_FIBO_LEVELS fibLevel = X_FIBO_LEVEL_500,
|
||||||
|
ENUM_X_BOUNDARY_PRICE boundaryType = X_BOUNDARY_PRICE_UP_DOWN //
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
@@ -1061,12 +1063,16 @@ struct XOHCL
|
|||||||
//
|
//
|
||||||
result = IsValid() &&
|
result = IsValid() &&
|
||||||
price > 0 &&
|
price > 0 &&
|
||||||
HasDirection(forDir);
|
HasDirection(forDir) &&
|
||||||
|
IsValid(boundaryType);
|
||||||
if (!result)
|
if (!result)
|
||||||
{
|
{
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
bool isUpDownPriceType = boundaryType == X_BOUNDARY_PRICE_UP_DOWN;
|
||||||
|
|
||||||
//
|
//
|
||||||
bool isBullish =
|
bool isBullish =
|
||||||
IsBullish() &&
|
IsBullish() &&
|
||||||
@@ -1084,6 +1090,37 @@ struct XOHCL
|
|||||||
//
|
//
|
||||||
result = isBullish ||
|
result = isBullish ||
|
||||||
isBearish;
|
isBearish;
|
||||||
|
if (result)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
// Calculate Range ...
|
||||||
|
double range =
|
||||||
|
isUpDownPriceType
|
||||||
|
? GetBody()
|
||||||
|
: GetRange();
|
||||||
|
|
||||||
|
//
|
||||||
|
// Apply Edge Range ...
|
||||||
|
double iReqRange =
|
||||||
|
(range / 100) * GetFiboLevelValue(fibLevel);
|
||||||
|
|
||||||
|
//
|
||||||
|
// Calculate Boundary Price ...
|
||||||
|
double iBoundary =
|
||||||
|
isUpDownPriceType
|
||||||
|
? iBullish
|
||||||
|
? GetUp()
|
||||||
|
: GetDown()
|
||||||
|
: isBullish
|
||||||
|
? high
|
||||||
|
: low;
|
||||||
|
|
||||||
|
//
|
||||||
|
// Detect Breaked Value ...
|
||||||
|
result =
|
||||||
|
isBullish
|
||||||
|
?
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
return result;
|
return result;
|
||||||
|
|||||||
Reference in New Issue
Block a user