Last Works on Validating Order Blocks ...

This commit is contained in:
2025-01-06 21:53:05 +03:30
parent 9d4b2ee578
commit 65b7a2ca7f
13 changed files with 3490 additions and 751 deletions
+218
View File
@@ -0,0 +1,218 @@
//
double cPZoneUpper = 0;
double cPZoneLower = 0;
datetime cPZoneFrom = NULL;
datetime cPZoneTo = NULL;
result = consolidationPriceZone.GetBoxData(
X_DIRECTION_ALL,
cPZoneUpper,
cPZoneLower,
cPZoneFrom,
cPZoneTo //
);
if (!result)
{
return result;
}
//
double aPZoneUpper = 0;
double aPZoneLower = 0;
datetime aPZoneFrom = NULL;
datetime aPZoneTo = NULL;
result = analysePriceZone.GetBoxData(
X_DIRECTION_ALL,
aPZoneUpper,
aPZoneLower,
aPZoneFrom,
aPZoneTo //
);
if (!result)
{
return result;
}
//
// RSI ...
double rsi = decisionConditions.x121Conditions.rsiBuffer[1];
//
bool isRSIOverBought = decisionConditions.x121Conditions.isRSIOverBought;
bool isRSICrossedOverOverBought = decisionConditions.x121Conditions.isRSICrossedOverOverBought;
bool isRSICrossedUnderOverBought = decisionConditions.x121Conditions.isRSICrossedUnderOverBought;
//
bool isRSIOverSold = decisionConditions.x121Conditions.isRSIOverSold;
bool isRSICrossedOverOverSold = decisionConditions.x121Conditions.isRSICrossedOverOverSold;
bool isRSICrossedUnderOverSold = decisionConditions.x121Conditions.isRSICrossedUnderOverSold;
//
// PV ...
double peak = decisionConditions.x121Conditions.peaksBuffer[1];
double vale = decisionConditions.x121Conditions.valesBuffer[1];
//
bool isNewPeak = decisionConditions.x121Conditions.isNewPeak;
bool isNewPeakOverLast = decisionConditions.x121Conditions.isNewPeakOverLast;
bool isNewPeakUnderLast = decisionConditions.x121Conditions.isNewPeakUnderLast;
//
bool isNewVale = decisionConditions.x121Conditions.isNewVale;
bool isNewValeOverLast = decisionConditions.x121Conditions.isNewValeOverLast;
bool isNewValeUnderLast = decisionConditions.x121Conditions.isNewValeUnderLast;
//
// STR ...
double str = decisionConditions.x121Conditions.strBuffer[1];
//
bool isStrBullish = decisionConditions.x121Conditions.isStrBullish;
bool isStrBearish = decisionConditions.x121Conditions.isStrBearish;
//
bool isStrSwitchedToBullish = decisionConditions.x121Conditions.isStrSwitchedToBullish;
bool isStrSwitchedToBearish = decisionConditions.x121Conditions.isStrSwitchedToBearish;
//
// ATR ...
double atr = decisionConditions.x121Conditions.atrBuffer[1];
double atrUpper = decisionConditions.x121Conditions.atrUpperBuffer[1];
double atrLower = decisionConditions.x121Conditions.atrLowerBuffer[1];
//
bool isCloseOverATRUpper = decisionConditions.x121Conditions.isCloseOverATRUpper;
bool isCloseOverATRLower = decisionConditions.x121Conditions.isCloseOverATRLower;
//
bool isCloseUnderATRUpper = decisionConditions.x121Conditions.isCloseUnderATRUpper;
bool isCloseUnderATRLower = decisionConditions.x121Conditions.isCloseUnderATRLower;
//
bool isRejectUpATRUpper = decisionConditions.x121Conditions.isRejectUpATRUpper;
bool isRejectDownATRUpper = decisionConditions.x121Conditions.isRejectDownATRUpper;
//
bool isRejectUpATRLower = decisionConditions.x121Conditions.isRejectUpATRLower;
bool isRejectDownATRLower = decisionConditions.x121Conditions.isRejectDownATRLower;
//
bool isBreakUpATRUpper = decisionConditions.x121Conditions.isBreakUpATRUpper;
bool isBreakDownATRUpper = decisionConditions.x121Conditions.isBreakDownATRUpper;
//
bool isBreakUpATRLower = decisionConditions.x121Conditions.isBreakUpATRLower;
bool isBreakDownATRLower = decisionConditions.x121Conditions.isBreakDownATRLower;
//
// SAR ...
double sar = decisionConditions.x121Conditions.sarBuffer[1];
//
bool isSarBullish = decisionConditions.x121Conditions.isSarBullish;
bool isSarBearish = decisionConditions.x121Conditions.isSarBearish;
//
bool isSarSwitchedToBullish = decisionConditions.x121Conditions.isSarSwitchedToBullish;
bool isSarSwitchedToBearish = decisionConditions.x121Conditions.isSarSwitchedToBearish;
//
// DON ...
//
double donOpenUpper = decisionConditions.x121Conditions.donOpenUpperBuffer[1];
double donOpenLower = decisionConditions.x121Conditions.donOpenLowerBuffer[1];
double donHighUpper = decisionConditions.x121Conditions.donHighUpperBuffer[1];
double donHighLower = decisionConditions.x121Conditions.donHighLowerBuffer[1];
double donLowUpper = decisionConditions.x121Conditions.donLowUpperBuffer[1];
double donLowLower = decisionConditions.x121Conditions.donLowLowerBuffer[1];
double donCloseUpper = decisionConditions.x121Conditions.donCloseUpperBuffer[1];
double donCloseLower = decisionConditions.x121Conditions.donCloseLowerBuffer[1];
//
bool isRejectDonOpenUpper = decisionConditions.x121Conditions.isRejectDonOpenUpper;
bool isRejectDonHighUpper = decisionConditions.x121Conditions.isRejectDonHighUpper;
bool isRejectDonLowUpper = decisionConditions.x121Conditions.isRejectDonLowUpper;
bool isRejectDonCloseUpper = decisionConditions.x121Conditions.isRejectDonCloseUpper;
//
bool isRejectDonOpenLower = decisionConditions.x121Conditions.isRejectDonOpenLower;
bool isRejectDonHighLower = decisionConditions.x121Conditions.isRejectDonHighLower;
bool isRejectDonLowLower = decisionConditions.x121Conditions.isRejectDonLowLower;
bool isRejectDonCloseLower = decisionConditions.x121Conditions.isRejectDonCloseLower;
//
bool isBreakDonOpenUpper = decisionConditions.x121Conditions.isBreakDonOpenUpper;
bool isBreakDonHighUpper = decisionConditions.x121Conditions.isBreakDonHighUpper;
bool isBreakDonLowUpper = decisionConditions.x121Conditions.isBreakDonLowUpper;
bool isBreakDonCloseUpper = decisionConditions.x121Conditions.isBreakDonCloseUpper;
//
bool isBreakDonOpenLower = decisionConditions.x121Conditions.isBreakDonOpenLower;
bool isBreakDonHighLower = decisionConditions.x121Conditions.isBreakDonHighLower;
bool isBreakDonLowLower = decisionConditions.x121Conditions.isBreakDonLowLower;
bool isBreakDonCloseLower = decisionConditions.x121Conditions.isBreakDonCloseLower;
//
// VWAP ...
//
// COMPLEX ...
// Complex Conditions ...
//
bool isNewPeakOverATRUpper =
isNewPeak &&
peak > atrUpper;
//
bool isNewValeUnderATRLower =
isNewVale &&
vale < atrLower;
//
bool isDonHighUpperEqualsToPeak =
donHighUpper == peak;
//
bool isDonLowLowerEqualsToVale =
donLowLower == vale;
//
bool isBullishSign = (
//
triggerConditions.x121Conditions.isBreakUpATRLower ||
triggerConditions.x121Conditions.isRejectUpATRLower ||
triggerConditions.x121Conditions.isBreakDonHighLower ||
triggerConditions.x121Conditions.isRejectDonHighLower ||
triggerConditions.x121Conditions.isBreakDonCloseLower ||
triggerConditions.x121Conditions.isRejectDonCloseLower
//
);
bool isBearishSign = (
//
triggerConditions.x121Conditions.isBreakDownATRUpper ||
triggerConditions.x121Conditions.isRejectDownATRUpper ||
triggerConditions.x121Conditions.isBreakDonLowUpper ||
triggerConditions.x121Conditions.isRejectDonLowUpper ||
triggerConditions.x121Conditions.isBreakDonCloseUpper ||
triggerConditions.x121Conditions.isRejectDonCloseUpper
//
);
//
// Check RSI in Over Bought or Over Sold ...
//
bool isRSICrossedOverOverSold = consolidationConditions.x121Conditions.isRSICrossedOverOverSold;
bool isRSICrossedUnderOverBought = consolidationConditions.x121Conditions.isRSICrossedUnderOverBought;
//
result = isRSICrossedOverOverSold ||
isRSICrossedUnderOverBought;
if (!result)
{
return result;
}