last works on validating POI's ...
This commit is contained in:
@@ -3016,7 +3016,7 @@ void DoProcess(
|
||||
//
|
||||
bool isTriggerBar =
|
||||
//
|
||||
triggerBarPushers > 1 &&
|
||||
triggerBarPushers >= 1 &&
|
||||
(isBullishTriggerBar ||
|
||||
isBearishTriggerBar)
|
||||
//
|
||||
@@ -3029,6 +3029,9 @@ void DoProcess(
|
||||
//
|
||||
// Reading Required Info ...
|
||||
|
||||
//
|
||||
// HK Signal Bar ...
|
||||
|
||||
//
|
||||
double iHKSOpen = hkSBarOpenBuffer[barIndex];
|
||||
double iHKSClose = hkSBarCloseBuffer[barIndex];
|
||||
@@ -3039,13 +3042,24 @@ void DoProcess(
|
||||
|
||||
//
|
||||
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 =
|
||||
hkSBarOpenBuffer[barIndex] < hkSBarCloseBuffer[barIndex] &&
|
||||
hkSBarOpenBuffer[barIndex] >= hkSBarCloseBuffer[barIndex];
|
||||
isHKSBullish &&
|
||||
!isPHKSBullish;
|
||||
|
||||
//
|
||||
bool isHKSSwitchedToBearish =
|
||||
hkSBarOpenBuffer[barIndex] > hkSBarCloseBuffer[barIndex] &&
|
||||
hkSBarOpenBuffer[barIndex] <= hkSBarCloseBuffer[barIndex];
|
||||
isHKSBearish &&
|
||||
!isPHKSBearish;
|
||||
|
||||
//
|
||||
// TREND ...
|
||||
|
||||
//
|
||||
double iTrend = trendBuffer[barIndex];
|
||||
@@ -3058,6 +3072,94 @@ void DoProcess(
|
||||
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;
|
||||
@@ -3076,8 +3178,12 @@ void DoProcess(
|
||||
//
|
||||
(
|
||||
//
|
||||
isHKSBullish &&
|
||||
isTrendBullish
|
||||
// isHKSBullish &&
|
||||
// isTrendBullish
|
||||
//
|
||||
// isRSICrossedOverOS
|
||||
//
|
||||
isHKSSwitchedToBullish
|
||||
//
|
||||
)
|
||||
//
|
||||
@@ -3091,14 +3197,19 @@ void DoProcess(
|
||||
//
|
||||
(
|
||||
//
|
||||
isHKSBearish &&
|
||||
isTrendBearish
|
||||
// isHKSBearish &&
|
||||
// isTrendBearish
|
||||
//
|
||||
// isRSICrossedUnderOB
|
||||
//
|
||||
isHKSSwitchedToBearish
|
||||
//
|
||||
)
|
||||
//
|
||||
;
|
||||
|
||||
//
|
||||
// Summarizing Result ...
|
||||
isTriggerBar =
|
||||
//
|
||||
isBullishTriggerBar ||
|
||||
@@ -3410,8 +3521,8 @@ void ValidatePOIs(
|
||||
{
|
||||
//
|
||||
int count = 0;
|
||||
XBoxZone tmp[];
|
||||
bool has = false;
|
||||
int barsLength = 3;
|
||||
datetime to = GetBarTime(
|
||||
_Symbol,
|
||||
_Period,
|
||||
@@ -3422,90 +3533,31 @@ void ValidatePOIs(
|
||||
// Liquidities ...
|
||||
|
||||
//
|
||||
// Bullish Liquidities ...
|
||||
count = ArraySize(mBullishLiquidities);
|
||||
has = IsValidSize(count);
|
||||
if (has)
|
||||
{
|
||||
//
|
||||
Clean(tmp);
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
//
|
||||
has = IsBoxValid(
|
||||
mBullishLiquidities[i],
|
||||
barIndex //
|
||||
);
|
||||
if (!has)
|
||||
{
|
||||
//
|
||||
AddRef(
|
||||
mBullishLiquidities[i],
|
||||
tmp //
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
has = HasChild(tmp);
|
||||
if (has)
|
||||
{
|
||||
//
|
||||
RemoveBoxes(
|
||||
tmp,
|
||||
mBullishLiquidities //
|
||||
);
|
||||
|
||||
//
|
||||
SortBoxes(mBullishLiquidities);
|
||||
}
|
||||
|
||||
//
|
||||
Clean(tmp);
|
||||
ValidateBoxes(
|
||||
mBullishLiquidities,
|
||||
barIndex,
|
||||
barsLength //
|
||||
);
|
||||
}
|
||||
|
||||
//
|
||||
// Bearish Liquidities ...
|
||||
count = ArraySize(mBearishLiquidities);
|
||||
has = IsValidSize(count);
|
||||
if (has)
|
||||
{
|
||||
//
|
||||
Clean(tmp);
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
//
|
||||
mBearishLiquidities[i].to = to;
|
||||
|
||||
//
|
||||
has = IsBoxValid(
|
||||
mBearishLiquidities[i],
|
||||
barIndex //
|
||||
);
|
||||
if (!has)
|
||||
{
|
||||
//
|
||||
AddRef(
|
||||
mBearishLiquidities[i],
|
||||
tmp //
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
has = HasChild(tmp);
|
||||
if (has)
|
||||
{
|
||||
//
|
||||
RemoveBoxes(
|
||||
tmp,
|
||||
mBearishLiquidities //
|
||||
);
|
||||
|
||||
//
|
||||
SortBoxes(mBearishLiquidities);
|
||||
}
|
||||
|
||||
//
|
||||
Clean(tmp);
|
||||
ValidateBoxes(
|
||||
mBearishLiquidities,
|
||||
barIndex,
|
||||
barsLength //
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user