last ...
This commit is contained in:
@@ -350,3 +350,208 @@
|
||||
bool isHCMaSwitchedToBearish =
|
||||
isHCMaBearish &&
|
||||
!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]
|
||||
//
|
||||
;
|
||||
|
||||
Reference in New Issue
Block a user