215 lines
5.9 KiB
Plaintext
215 lines
5.9 KiB
Plaintext
|
|
//
|
|
// Checking Bar Based on Positions State ...
|
|
ENUM_X_DIRECTION iBarPosDir;
|
|
bool isBarValidForDir = cHelper
|
|
.mBarAnalyser
|
|
.IsValidForPosition(
|
|
cBar,
|
|
iBarPosDir //
|
|
);
|
|
bool isBarValidForBullish =
|
|
isBarValidForDir &&
|
|
IsBullish(iBarPosDir);
|
|
bool isBarValidForBearish =
|
|
isBarValidForDir &&
|
|
IsBearish(iBarPosDir);
|
|
|
|
//
|
|
// Check Bar Place Based on Golden Zones ...
|
|
|
|
//
|
|
bool isBarInPeaksGoldenZone =
|
|
cBar.high <= cXConditions.peaksBuffer[cIDX] &&
|
|
cBar.low >= cXConditions.peaksGoldenBuffer[cIDX];
|
|
|
|
//
|
|
bool isBarInValesGoldenZone =
|
|
cBar.high >= cXConditions.valesBuffer[cIDX] &&
|
|
cBar.low <= cXConditions.valesGoldenBuffer[cIDX];
|
|
|
|
//
|
|
XCPOIDrawer *drawer = provider.visionCycleHelper.mPOIDrawer;
|
|
|
|
//
|
|
// X3MA ...
|
|
|
|
//
|
|
bool isX3MaFastMidOverPeaksGoldeZone =
|
|
isX3MaFastOverPeaksGoldenZone &&
|
|
isX3MaMidOverPeaksGoldenZone;
|
|
|
|
//
|
|
bool isX3MaFastMidUnderValesGoldeZone =
|
|
isX3MaFastUnderValesGoldenZone &&
|
|
isX3MaMidUnderValesGoldenZone;
|
|
|
|
//
|
|
// XVWAP ...
|
|
|
|
//
|
|
bool isVWapFastMidOverPeaksGoldeZone =
|
|
isVWapFastOverPeaksGoldenZone &&
|
|
isVWapMidOverPeaksGoldenZone;
|
|
|
|
//
|
|
bool isVWapFastMidUnderValesGoldeZone =
|
|
isVWapFastUnderValesGoldenZone &&
|
|
isVWapMidUnderValesGoldenZone;
|
|
|
|
//
|
|
//
|
|
|
|
//
|
|
bool isX3MaVWapFastUnderValuesGoldenZone =
|
|
isX3MaFastUnderValesGoldenZone &&
|
|
isVWapFastUnderValesGoldenZone;
|
|
|
|
//
|
|
bool isX3MaVWapFastOverPeaksGoldenZone =
|
|
isX3MaFastOverPeaksGoldenZone &&
|
|
isVWapFastOverPeaksGoldenZone;
|
|
|
|
//
|
|
//
|
|
|
|
//
|
|
double x3MaFastMidMax = MathMax(
|
|
cXConditions.x3maFastBuffer[cIDX],
|
|
cXConditions.x3maMidBuffer[cIDX] //
|
|
);
|
|
|
|
//
|
|
double x3MaFastMidMin = MathMin(
|
|
cXConditions.x3maFastBuffer[cIDX],
|
|
cXConditions.x3maMidBuffer[cIDX] //
|
|
);
|
|
|
|
//
|
|
double vwapFastMidMax = MathMax(
|
|
cXConditions.vwapFastBuffer[cIDX],
|
|
cXConditions.vwapMidBuffer[cIDX] //
|
|
);
|
|
|
|
//
|
|
double vwapFastMidMin = MathMin(
|
|
cXConditions.vwapFastBuffer[cIDX],
|
|
cXConditions.vwapMidBuffer[cIDX] //
|
|
);
|
|
|
|
//
|
|
//
|
|
|
|
//
|
|
double x3maVWapFastMidMax = MathMax(x3MaFastMidMax, vwapFastMidMax);
|
|
double x3maVWapFastMidMin = MathMin(x3MaFastMidMin, vwapFastMidMin);
|
|
|
|
//
|
|
double x3maVWapMax = MathMax(cXConditions.x3maMax, cXConditions.vwapMax);
|
|
double x3maVWapMin = MathMin(cXConditions.x3maMin, cXConditions.vwapMin);
|
|
|
|
//
|
|
double x3maVWapDiff = x3maVWapMax - x3maVWapMin;
|
|
|
|
//
|
|
double atr = cXConditions.atrBuffer[cIDX];
|
|
|
|
//
|
|
bool isConsolidate = x3maVWapDiff <= (3 * atr);
|
|
|
|
//
|
|
bool isX3MaVWapSwitchedToBullish =
|
|
//
|
|
// VWap ...
|
|
(
|
|
//
|
|
(cXConditions.isVWapBullishOrdered &&
|
|
cXConditions.isVWapSwitchedToBullishState) ||
|
|
(cXConditions.isVWapBullishState &&
|
|
cXConditions.isVWapSwitchedToBullishOrdered)
|
|
//
|
|
)
|
|
//
|
|
||
|
|
//
|
|
// X3Ma ...
|
|
(
|
|
//
|
|
(cXConditions.isX3MaBullishOrdered &&
|
|
cXConditions.isX3MaSwitchedToBullishState) ||
|
|
(cXConditions.isX3MaBullishState &&
|
|
cXConditions.isX3MaSwitchedToBullishOrdered)
|
|
//
|
|
)
|
|
//
|
|
;
|
|
|
|
//
|
|
bool isX3MaVWapSwitchedToBearish =
|
|
//
|
|
// VWap ...
|
|
(
|
|
//
|
|
(cXConditions.isVWapBearishOrdered &&
|
|
cXConditions.isVWapSwitchedToBearishState) ||
|
|
(cXConditions.isVWapBearishState &&
|
|
cXConditions.isVWapSwitchedToBearishOrdered)
|
|
//
|
|
)
|
|
//
|
|
||
|
|
//
|
|
// X3Ma ...
|
|
(
|
|
//
|
|
(cXConditions.isX3MaBearishOrdered &&
|
|
cXConditions.isX3MaSwitchedToBearishState) ||
|
|
(cXConditions.isX3MaBearishState &&
|
|
cXConditions.isX3MaSwitchedToBearishOrdered)
|
|
//
|
|
)
|
|
//
|
|
;
|
|
|
|
//
|
|
// Bullish Conditions ...
|
|
isBullish =
|
|
//
|
|
// Base Condition ...
|
|
(
|
|
//
|
|
false
|
|
//
|
|
// isConsolidate &&
|
|
// isBarValidForBullish &&
|
|
// cXConditions.isSarBullish &&
|
|
// isX3MaVWapSwitchedToBullish &&
|
|
// cXConditions.isNewPeakOverLast // &&
|
|
// isVWapFastMidUnderValesGoldeZone // &&
|
|
// cXConditions.isAtrLowerSlopeBullish
|
|
//
|
|
)
|
|
//
|
|
;
|
|
|
|
//
|
|
// Bearish Conditions ...
|
|
isBearish =
|
|
//
|
|
// Base Condition ...
|
|
(
|
|
//
|
|
false
|
|
//
|
|
// isConsolidate &&
|
|
// isBarValidForBearish &&
|
|
// cXConditions.isSarBearish &&
|
|
// isX3MaVWapSwitchedToBearish &&
|
|
// cXConditions.isNewValeUnderLast // &&
|
|
// isVWapFastMidOverPeaksGoldeZone // &&
|
|
// cXConditions.isAtrUpperSlopeBearish
|
|
//
|
|
)
|
|
//
|
|
;
|