Last Works on Validating Order Blocks ...
This commit is contained in:
@@ -34,6 +34,7 @@ struct X121Inputs
|
||||
{
|
||||
//
|
||||
// Props ...
|
||||
bool showRSI;
|
||||
X121XPVInputs xpvInputs;
|
||||
X121XATRInputs xatrInputs;
|
||||
X121XSTRInputs xstrInputs;
|
||||
@@ -193,7 +194,7 @@ struct X121Conditions
|
||||
bool isRSICrossedOverOverSold;
|
||||
|
||||
//
|
||||
bool isCloseOverATRUper;
|
||||
bool isCloseOverATRUpper;
|
||||
bool isCloseOverATRLower;
|
||||
bool isCloseUnderATRUpper;
|
||||
bool isCloseUnderATRLower;
|
||||
@@ -285,6 +286,29 @@ struct X121Conditions
|
||||
bool isVWapSwitchedToBearishState;
|
||||
bool isVWapSwitchedToNeuturalState;
|
||||
|
||||
//
|
||||
// Complex Conditions ...
|
||||
|
||||
//
|
||||
bool isSarEqualsToPeak;
|
||||
bool isSarEqualsToVale;
|
||||
|
||||
//
|
||||
bool isNewPeakOverATRUpper;
|
||||
bool isNewValeUnderATRLower;
|
||||
|
||||
//
|
||||
bool isDonHighUpperEqualsToPeak;
|
||||
bool isDonLowLowerEqualsToVale;
|
||||
|
||||
//
|
||||
bool isSTRUpperCrossedOverATRUpper;
|
||||
bool isSTRLowerCrossedUnderATRLower;
|
||||
|
||||
//
|
||||
bool isSTRUpperCrossedOverDonHighUpper;
|
||||
bool isSTRLowerCrossedUnderDonLowLower;
|
||||
|
||||
//
|
||||
// Constructor ...
|
||||
X121Conditions()
|
||||
@@ -396,6 +420,9 @@ struct X121Conditions
|
||||
//
|
||||
// Conditions ...
|
||||
|
||||
//
|
||||
// RSI ...
|
||||
|
||||
//
|
||||
isRSIOverBought = false;
|
||||
isRSICrossedOverOverBought = false;
|
||||
@@ -407,7 +434,10 @@ struct X121Conditions
|
||||
isRSICrossedOverOverSold = false;
|
||||
|
||||
//
|
||||
isCloseOverATRUper = false;
|
||||
// ATR ...
|
||||
|
||||
//
|
||||
isCloseOverATRUpper = false;
|
||||
isCloseOverATRLower = false;
|
||||
|
||||
//
|
||||
@@ -430,6 +460,9 @@ struct X121Conditions
|
||||
isBreakUpATRLower = false;
|
||||
isBreakDownATRLower = false;
|
||||
|
||||
//
|
||||
// DON ...
|
||||
|
||||
//
|
||||
isRejectDonOpenUpper = false;
|
||||
isRejectDonHighUpper = false;
|
||||
@@ -454,6 +487,9 @@ struct X121Conditions
|
||||
isBreakDonLowLower = false;
|
||||
isBreakDonCloseLower = false;
|
||||
|
||||
//
|
||||
// SAR ...
|
||||
|
||||
//
|
||||
isSarBullish = false;
|
||||
isSarBearish = false;
|
||||
@@ -462,6 +498,9 @@ struct X121Conditions
|
||||
isSarSwitchedToBullish = false;
|
||||
isSarSwitchedToBearish = false;
|
||||
|
||||
//
|
||||
// PV ...
|
||||
|
||||
//
|
||||
isNewPeak = false;
|
||||
isNewPeakOverLast = false;
|
||||
@@ -472,6 +511,9 @@ struct X121Conditions
|
||||
isNewValeOverLast = false;
|
||||
isNewValeUnderLast = false;
|
||||
|
||||
//
|
||||
// STR ...
|
||||
|
||||
//
|
||||
isStrBullish = false;
|
||||
isStrBearish = false;
|
||||
@@ -480,30 +522,72 @@ struct X121Conditions
|
||||
isStrSwitchedToBullish = false;
|
||||
isStrSwitchedToBearish = false;
|
||||
|
||||
//
|
||||
// VWAP ...
|
||||
|
||||
//
|
||||
isVWapFastBullish = false;
|
||||
isVWapFastBearish = false;
|
||||
isVWapFastNeutural = false;
|
||||
|
||||
//
|
||||
isVWapMidBullish = false;
|
||||
isVWapMidBearish = false;
|
||||
isVWapMidNeutural = false;
|
||||
|
||||
//
|
||||
isVWapSlowBullish = false;
|
||||
isVWapSlowBearish = false;
|
||||
isVWapSlowNeutural = false;
|
||||
|
||||
//
|
||||
isVWapFastOverMid = false;
|
||||
isVWapMidOverSlow = false;
|
||||
|
||||
//
|
||||
isVWapFastUnderMid = false;
|
||||
isVWapMidUnderSlow = false;
|
||||
|
||||
//
|
||||
isVWapBullishState = false;
|
||||
isVWapBearishState = false;
|
||||
isVWapNeuturalState = false;
|
||||
|
||||
//
|
||||
isVWapBullishOrdered = false;
|
||||
isVWapBearishOrdered = false;
|
||||
isVWapSwitchedToBullishOrdered = false;
|
||||
isVWapSwitchedToBearishOrdered = false;
|
||||
|
||||
//
|
||||
isVWapSwitchedToBullishState = false;
|
||||
isVWapSwitchedToBearishState = false;
|
||||
|
||||
//
|
||||
isVWapSwitchedToNeuturalState = false;
|
||||
isVWapSwitchedToBullishOrdered = false;
|
||||
isVWapSwitchedToBearishOrdered = false;
|
||||
|
||||
//
|
||||
// Complex Conditions ...
|
||||
|
||||
//
|
||||
isSarEqualsToPeak = false;
|
||||
isSarEqualsToVale = false;
|
||||
|
||||
//
|
||||
isNewPeakOverATRUpper = false;
|
||||
isNewValeUnderATRLower = false;
|
||||
|
||||
//
|
||||
isDonHighUpperEqualsToPeak = false;
|
||||
isDonLowLowerEqualsToVale = false;
|
||||
|
||||
//
|
||||
isSTRUpperCrossedOverATRUpper = false;
|
||||
isSTRLowerCrossedUnderATRLower = false;
|
||||
|
||||
//
|
||||
isSTRUpperCrossedOverDonHighUpper = false;
|
||||
isSTRLowerCrossedUnderDonLowLower = false;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -573,13 +657,41 @@ struct X121Conditions
|
||||
//
|
||||
string conditionsStr =
|
||||
//
|
||||
"SAR ..." + separator +
|
||||
"-----------------------" + separator +
|
||||
ToString("isSarBullish", isSarBullish, ignoreFalseConditions, separator) +
|
||||
ToString("isSarBearish", isSarBearish, ignoreFalseConditions, separator) +
|
||||
ToString("isSarSwitchedToBullish", isSarSwitchedToBullish, ignoreFalseConditions, separator) +
|
||||
ToString("isSarSwitchedToBearish", isSarSwitchedToBearish, ignoreFalseConditions, separator) +
|
||||
//
|
||||
"STR ..." + separator +
|
||||
"-----------------------" + separator +
|
||||
ToString("isStrBullish", isStrBullish, ignoreFalseConditions, separator) +
|
||||
ToString("isStrBearish", isStrBearish, ignoreFalseConditions, separator) +
|
||||
ToString("isStrSwitchedToBullish", isStrSwitchedToBullish, ignoreFalseConditions, separator) +
|
||||
ToString("isStrSwitchedToBearish", isStrSwitchedToBearish, ignoreFalseConditions, separator) +
|
||||
//
|
||||
"PV ..." + separator +
|
||||
"-----------------------" + separator +
|
||||
ToString("isNewPeak", isNewPeak, ignoreFalseConditions, separator) +
|
||||
ToString("isNewPeakOverLast", isNewPeakOverLast, ignoreFalseConditions, separator) +
|
||||
ToString("isNewPeakUnderLast", isNewPeakUnderLast, ignoreFalseConditions, separator) +
|
||||
ToString("isNewVale", isNewVale, ignoreFalseConditions, separator) +
|
||||
ToString("isNewValeOverLast", isNewValeOverLast, ignoreFalseConditions, separator) +
|
||||
ToString("isNewValeUnderLast", isNewValeUnderLast, ignoreFalseConditions, separator) +
|
||||
//
|
||||
"> RSI ..." + separator +
|
||||
"-----------------------" + separator +
|
||||
ToString("isRSIOverBought", isRSIOverBought, ignoreFalseConditions, separator) +
|
||||
ToString("isRSICrossedOverOverBought", isRSICrossedOverOverBought, ignoreFalseConditions, separator) +
|
||||
ToString("isRSICrossedUnderOverBought", isRSICrossedUnderOverBought, ignoreFalseConditions, separator) +
|
||||
ToString("isRSIOverSold", isRSIOverSold, ignoreFalseConditions, separator) +
|
||||
ToString("isRSICrossedUnderOverSold", isRSICrossedUnderOverSold, ignoreFalseConditions, separator) +
|
||||
ToString("isRSICrossedOverOverSold", isRSICrossedOverOverSold, ignoreFalseConditions, separator) +
|
||||
ToString("isCloseOverATRUper", isCloseOverATRUper, ignoreFalseConditions, separator) +
|
||||
//
|
||||
"ATR ..." + separator +
|
||||
"-----------------------" + separator +
|
||||
ToString("isCloseOverATRUpper", isCloseOverATRUpper, ignoreFalseConditions, separator) +
|
||||
ToString("isCloseOverATRLower", isCloseOverATRLower, ignoreFalseConditions, separator) +
|
||||
ToString("isCloseUnderATRUpper", isCloseUnderATRUpper, ignoreFalseConditions, separator) +
|
||||
ToString("isCloseUnderATRLower", isCloseUnderATRLower, ignoreFalseConditions, separator) +
|
||||
@@ -590,6 +702,9 @@ struct X121Conditions
|
||||
ToString("isBreakUpATRUpper", isBreakUpATRUpper, ignoreFalseConditions, separator) +
|
||||
ToString("isBreakDownATRUpper", isBreakDownATRUpper, ignoreFalseConditions, separator) +
|
||||
ToString("isBreakUpATRLower", isBreakUpATRLower, ignoreFalseConditions, separator) +
|
||||
//
|
||||
"DON ..." + separator +
|
||||
"-----------------------" + separator +
|
||||
ToString("isBreakDownATRLower", isBreakDownATRLower, ignoreFalseConditions, separator) +
|
||||
ToString("isRejectDonOpenUpper", isRejectDonOpenUpper, ignoreFalseConditions, separator) +
|
||||
ToString("isRejectDonHighUpper", isRejectDonHighUpper, ignoreFalseConditions, separator) +
|
||||
@@ -607,20 +722,9 @@ struct X121Conditions
|
||||
ToString("isBreakDonHighLower", isBreakDonHighLower, ignoreFalseConditions, separator) +
|
||||
ToString("isBreakDonLowLower", isBreakDonLowLower, ignoreFalseConditions, separator) +
|
||||
ToString("isBreakDonCloseLower", isBreakDonCloseLower, ignoreFalseConditions, separator) +
|
||||
ToString("isSarBullish", isSarBullish, ignoreFalseConditions, separator) +
|
||||
ToString("isSarBearish", isSarBearish, ignoreFalseConditions, separator) +
|
||||
ToString("isSarSwitchedToBullish", isSarSwitchedToBullish, ignoreFalseConditions, separator) +
|
||||
ToString("isSarSwitchedToBearish", isSarSwitchedToBearish, ignoreFalseConditions, separator) +
|
||||
ToString("isNewPeak", isNewPeak, ignoreFalseConditions, separator) +
|
||||
ToString("isNewPeakOverLast", isNewPeakOverLast, ignoreFalseConditions, separator) +
|
||||
ToString("isNewPeakUnderLast", isNewPeakUnderLast, ignoreFalseConditions, separator) +
|
||||
ToString("isNewVale", isNewVale, ignoreFalseConditions, separator) +
|
||||
ToString("isNewValeOverLast", isNewValeOverLast, ignoreFalseConditions, separator) +
|
||||
ToString("isNewValeUnderLast", isNewValeUnderLast, ignoreFalseConditions, separator) +
|
||||
ToString("isStrBullish", isStrBullish, ignoreFalseConditions, separator) +
|
||||
ToString("isStrBearish", isStrBearish, ignoreFalseConditions, separator) +
|
||||
ToString("isStrSwitchedToBullish", isStrSwitchedToBullish, ignoreFalseConditions, separator) +
|
||||
ToString("isStrSwitchedToBearish", isStrSwitchedToBearish, ignoreFalseConditions, separator) +
|
||||
//
|
||||
"VWAP ..." + separator +
|
||||
"-----------------------" + separator +
|
||||
ToString("isVWapFastBullish", isVWapFastBullish, ignoreFalseConditions, separator) +
|
||||
ToString("isVWapFastBearish", isVWapFastBearish, ignoreFalseConditions, separator) +
|
||||
ToString("isVWapFastNeutural", isVWapFastNeutural, ignoreFalseConditions, separator) +
|
||||
@@ -645,6 +749,20 @@ struct X121Conditions
|
||||
ToString("isVWapSwitchedToBearishState", isVWapSwitchedToBearishState, ignoreFalseConditions, separator) +
|
||||
ToString("isVWapSwitchedToNeuturalState", isVWapSwitchedToNeuturalState, ignoreFalseConditions, separator) +
|
||||
//
|
||||
"-----------------------" + separator +
|
||||
"Coplex ..." + separator +
|
||||
"-----------------------" + separator +
|
||||
ToString("isSarEqualsToPeak", isSarEqualsToPeak, ignoreFalseConditions, separator) +
|
||||
ToString("isSarEqualsToVale", isSarEqualsToVale, ignoreFalseConditions, separator) +
|
||||
ToString("isNewPeakOverATRUpper", isNewPeakOverATRUpper, ignoreFalseConditions, separator) +
|
||||
ToString("isNewValeUnderATRLower", isNewValeUnderATRLower, ignoreFalseConditions, separator) +
|
||||
ToString("isDonHighUpperEqualsToPeak", isDonHighUpperEqualsToPeak, ignoreFalseConditions, separator) +
|
||||
ToString("isDonLowLowerEqualsToVale", isDonLowLowerEqualsToVale, ignoreFalseConditions, separator) +
|
||||
ToString("isSTRUpperCrossedOverATRUpper", isSTRUpperCrossedOverATRUpper, ignoreFalseConditions, separator) +
|
||||
ToString("isSTRLowerCrossedUnderATRLower", isSTRLowerCrossedUnderATRLower, ignoreFalseConditions, separator) +
|
||||
ToString("isSTRUpperCrossedOverDonHighUpper", isSTRUpperCrossedOverDonHighUpper, ignoreFalseConditions, separator) +
|
||||
ToString("isSTRLowerCrossedUnderDonLowLower", isSTRLowerCrossedUnderDonLowLower, ignoreFalseConditions, separator) +
|
||||
//
|
||||
""
|
||||
//
|
||||
;
|
||||
@@ -844,6 +962,25 @@ class XCX121Helper : public XCBase
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
if (inputs.showRSI)
|
||||
{
|
||||
//
|
||||
mRSIHandler = iRSI(
|
||||
symbol,
|
||||
period,
|
||||
xatrInputs.rsiLength,
|
||||
xatrInputs.rsiAppliedTo //
|
||||
);
|
||||
|
||||
//
|
||||
result = mRSIHandler != INVALID_HANDLE;
|
||||
if (!result)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
@@ -1245,7 +1382,7 @@ class XCX121Helper : public XCBase
|
||||
conditions.isRSIOverBought = xatrConditions.isRSIOverBought;
|
||||
conditions.isBreakUpATRUpper = xatrConditions.isBreakUpATRUpper;
|
||||
conditions.isBreakUpATRLower = xatrConditions.isBreakUpATRLower;
|
||||
conditions.isCloseOverATRUper = xatrConditions.isCloseOverATRUper;
|
||||
conditions.isCloseOverATRUpper = xatrConditions.isCloseOverATRUpper;
|
||||
conditions.isRejectUpATRUpper = xatrConditions.isRejectUpATRUpper;
|
||||
conditions.isRejectUpATRLower = xatrConditions.isRejectUpATRLower;
|
||||
conditions.isCloseOverATRLower = xatrConditions.isCloseOverATRLower;
|
||||
@@ -1389,49 +1526,49 @@ class XCX121Helper : public XCBase
|
||||
//
|
||||
Copy(
|
||||
xvwapConditions.vwapFastBuffer,
|
||||
conditions.donOpenUpperBuffer //
|
||||
conditions.vwapFastBuffer //
|
||||
);
|
||||
|
||||
//
|
||||
Copy(
|
||||
xvwapConditions.vwapMidBuffer,
|
||||
conditions.donOpenLowerBuffer //
|
||||
conditions.vwapMidBuffer //
|
||||
);
|
||||
|
||||
//
|
||||
Copy(
|
||||
xvwapConditions.vwapSlowBuffer,
|
||||
conditions.donHighUpperBuffer //
|
||||
conditions.vwapSlowBuffer //
|
||||
);
|
||||
|
||||
//
|
||||
Copy(
|
||||
xvwapConditions.vwapVolumeBuffer,
|
||||
conditions.donHighLowerBuffer //
|
||||
conditions.vwapVolumeBuffer //
|
||||
);
|
||||
|
||||
//
|
||||
Copy(
|
||||
xvwapConditions.vwapPriceBuffer,
|
||||
conditions.donLowUpperBuffer //
|
||||
conditions.vwapPriceBuffer //
|
||||
);
|
||||
|
||||
//
|
||||
Copy(
|
||||
xvwapConditions.vwapFastStateBuffer,
|
||||
conditions.donLowLowerBuffer //
|
||||
conditions.vwapFastStateBuffer //
|
||||
);
|
||||
|
||||
//
|
||||
Copy(
|
||||
xvwapConditions.vwapMidStateBuffer,
|
||||
conditions.donCloseUpperBuffer //
|
||||
conditions.vwapMidStateBuffer //
|
||||
);
|
||||
|
||||
//
|
||||
Copy(
|
||||
xvwapConditions.vwapSlowStateBuffer,
|
||||
conditions.donCloseLowerBuffer //
|
||||
conditions.vwapSlowStateBuffer //
|
||||
);
|
||||
|
||||
//
|
||||
@@ -1462,6 +1599,77 @@ class XCX121Helper : public XCBase
|
||||
conditions.isVWapSwitchedToBullishOrdered = xvwapConditions.isVWapSwitchedToBullishOrdered;
|
||||
conditions.isVWapSwitchedToBearishOrdered = xvwapConditions.isVWapSwitchedToBearishOrdered;
|
||||
|
||||
//
|
||||
// Complex Conditions ...
|
||||
|
||||
//
|
||||
int cIDX = 1;
|
||||
int pIDX = cIDX + 1;
|
||||
|
||||
//
|
||||
bool isSarEqualsToPeak =
|
||||
conditions.sarBuffer[cIDX] == conditions.peaksBuffer[cIDX];
|
||||
bool isSarEqualsToVale =
|
||||
conditions.sarBuffer[cIDX] == conditions.valesBuffer[cIDX];
|
||||
|
||||
//
|
||||
bool isNewPeakOverATRUpper =
|
||||
conditions.isNewPeak &&
|
||||
conditions.peaksBuffer[cIDX] > conditions.atrUpperBuffer[cIDX];
|
||||
bool isNewValeUnderATRLower =
|
||||
conditions.isNewVale &&
|
||||
conditions.valesBuffer[cIDX] > conditions.atrLowerBuffer[cIDX];
|
||||
|
||||
//
|
||||
bool isDonHighUpperEqualsToPeak =
|
||||
conditions.donHighUpperBuffer[cIDX] == conditions.peaksBuffer[cIDX];
|
||||
bool isDonLowLowerEqualsToVale =
|
||||
conditions.donLowLowerBuffer[cIDX] == conditions.valesBuffer[cIDX];
|
||||
|
||||
//
|
||||
bool isSTRUpperOverATRUpper =
|
||||
conditions.strUpBuffer[cIDX] > conditions.atrUpperBuffer[cIDX];
|
||||
bool isSTRUpperOverATRUpperPrev =
|
||||
conditions.strUpBuffer[pIDX] > conditions.atrUpperBuffer[pIDX];
|
||||
bool isSTRUpperCrossedOverATRUpper = isSTRUpperOverATRUpper &&
|
||||
!isSTRUpperOverATRUpperPrev;
|
||||
|
||||
//
|
||||
bool isSTRLowerUnderATRLower =
|
||||
conditions.strDownBuffer[cIDX] < conditions.atrLowerBuffer[cIDX];
|
||||
bool isSTRLowerUnderATRLowerPrev =
|
||||
conditions.strDownBuffer[pIDX] < conditions.atrLowerBuffer[pIDX];
|
||||
bool isSTRLowerCrossedUnderATRLower = isSTRLowerUnderATRLower &&
|
||||
!isSTRLowerUnderATRLowerPrev;
|
||||
|
||||
//
|
||||
bool isSTRUpperOverDonHighUpper =
|
||||
conditions.strUpBuffer[cIDX] > conditions.donHighUpperBuffer[cIDX];
|
||||
bool isSTRUpperOverDonHighUpperPrev =
|
||||
conditions.strUpBuffer[pIDX] > conditions.donHighUpperBuffer[pIDX];
|
||||
bool isSTRUpperCrossedOverDonHighUpper = isSTRUpperOverDonHighUpper &&
|
||||
!isSTRUpperOverDonHighUpperPrev;
|
||||
|
||||
//
|
||||
bool isSTRLowerUnderDonLowLower =
|
||||
conditions.strDownBuffer[cIDX] < conditions.donLowLowerBuffer[cIDX];
|
||||
bool isSTRLowerUnderDonLowLowerPrev =
|
||||
conditions.strDownBuffer[pIDX] < conditions.donLowLowerBuffer[pIDX];
|
||||
bool isSTRLowerCrossedUnderDonLowLower = isSTRLowerUnderDonLowLower &&
|
||||
!isSTRLowerUnderDonLowLowerPrev;
|
||||
|
||||
//
|
||||
conditions.isSarEqualsToPeak = isSarEqualsToPeak;
|
||||
conditions.isSarEqualsToVale = isSarEqualsToVale;
|
||||
conditions.isNewPeakOverATRUpper = isNewPeakOverATRUpper;
|
||||
conditions.isNewValeUnderATRLower = isNewValeUnderATRLower;
|
||||
conditions.isDonHighUpperEqualsToPeak = isDonHighUpperEqualsToPeak;
|
||||
conditions.isDonLowLowerEqualsToVale = isDonLowLowerEqualsToVale;
|
||||
conditions.isSTRUpperCrossedOverATRUpper = isSTRUpperCrossedOverATRUpper;
|
||||
conditions.isSTRLowerCrossedUnderATRLower = isSTRLowerCrossedUnderATRLower;
|
||||
conditions.isSTRUpperCrossedOverDonHighUpper = isSTRUpperCrossedOverDonHighUpper;
|
||||
conditions.isSTRLowerCrossedUnderDonLowLower = isSTRLowerCrossedUnderDonLowLower;
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
@@ -1486,6 +1694,9 @@ class XCX121Helper : public XCBase
|
||||
X121XDONInputs xdonInputs;
|
||||
X121XSTRInputs xstrInputs;
|
||||
X121XVWAPInputs xvwapInputs;
|
||||
|
||||
//
|
||||
int mRSIHandler;
|
||||
};
|
||||
|
||||
//
|
||||
Reference in New Issue
Block a user