last ...
This commit is contained in:
@@ -3328,6 +3328,13 @@ class XCPOIDrawer : public XCBase
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Draw Specified State Zone ...
|
||||||
|
*
|
||||||
|
* @param source: XStateZones instance Reference ...
|
||||||
|
*
|
||||||
|
* @return ( int )
|
||||||
|
*/
|
||||||
int DrawStateZones(
|
int DrawStateZones(
|
||||||
XStateZones &source,
|
XStateZones &source,
|
||||||
XCBaseObject *&drawnObjects[] //
|
XCBaseObject *&drawnObjects[] //
|
||||||
|
|||||||
@@ -0,0 +1,285 @@
|
|||||||
|
|
||||||
|
//
|
||||||
|
// Reading Previous Conditions ...
|
||||||
|
ENUM_XPOI_EVENTS consolidationPoiEventsPrev[];
|
||||||
|
ENUM_X_CYCLE_EVENTS consolidationCycleEventsPrev[];
|
||||||
|
X121SMCCycleConditions consolidationConditionsPrev;
|
||||||
|
result = consolidationCycleHelper.GetConditions(
|
||||||
|
consolidationCycleEventsPrev,
|
||||||
|
consolidationPoiEventsPrev,
|
||||||
|
consolidationConditionsPrev,
|
||||||
|
cIndex,
|
||||||
|
loopback //
|
||||||
|
);
|
||||||
|
if (!result)
|
||||||
|
{
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
X121SMCCycleConditions conditionState = consolidationConditions;
|
||||||
|
X121SMCCycleConditions conditionStatePrev = consolidationConditionsPrev;
|
||||||
|
|
||||||
|
//
|
||||||
|
XOHCL cCBar;
|
||||||
|
result = cCBar.Init(
|
||||||
|
conditionState.symbol,
|
||||||
|
conditionState.period,
|
||||||
|
cIndex //
|
||||||
|
);
|
||||||
|
if (!result)
|
||||||
|
{
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
XOHCL cPBar;
|
||||||
|
result = cCBar.GetPreviousBar(cPBar);
|
||||||
|
if (!result)
|
||||||
|
{
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// Engulf ...
|
||||||
|
ENUM_X_DIRECTION cCBarEngulfDir;
|
||||||
|
bool isCCBarEngulfed = consolidationCycleHelper
|
||||||
|
.mBarAnalyser
|
||||||
|
.IsEngulfBar(
|
||||||
|
cCBar,
|
||||||
|
cCBarEngulfDir,
|
||||||
|
0 // Extended ...
|
||||||
|
);
|
||||||
|
bool isCCBarBullishEngulfed =
|
||||||
|
isCCBarEngulfed &&
|
||||||
|
IsBullish(cCBarEngulfDir);
|
||||||
|
bool isCCBarBearishEngulfed =
|
||||||
|
isCCBarEngulfed &&
|
||||||
|
IsBearish(cCBarEngulfDir);
|
||||||
|
|
||||||
|
//
|
||||||
|
// Momentum ...
|
||||||
|
ENUM_X_DIRECTION cCBarMomentumDir;
|
||||||
|
bool isCCBarMomentum = consolidationCycleHelper
|
||||||
|
.mBarAnalyser
|
||||||
|
.IsMomentumBar(
|
||||||
|
cCBar,
|
||||||
|
cCBarMomentumDir,
|
||||||
|
1 // Extended ...
|
||||||
|
);
|
||||||
|
bool isCCBarBullishMomentum =
|
||||||
|
isCCBarMomentum &&
|
||||||
|
IsBullish(cCBarMomentumDir);
|
||||||
|
bool isCCBarBearishMomentum =
|
||||||
|
isCCBarMomentum &&
|
||||||
|
IsBearish(cCBarMomentumDir);
|
||||||
|
|
||||||
|
//
|
||||||
|
// Reject ...
|
||||||
|
ENUM_X_DIRECTION cCBarRejectDir;
|
||||||
|
bool isCCBarRejected = consolidationCycleHelper
|
||||||
|
.mBarAnalyser
|
||||||
|
.IsRejectionBar(
|
||||||
|
cCBar,
|
||||||
|
cCBarRejectDir,
|
||||||
|
1 // Extended ...
|
||||||
|
);
|
||||||
|
bool isCCBarBullishRejected =
|
||||||
|
isCCBarRejected &&
|
||||||
|
IsBullish(cCBarRejectDir);
|
||||||
|
bool isCCBarBearishRejected =
|
||||||
|
isCCBarRejected &&
|
||||||
|
IsBearish(cCBarRejectDir);
|
||||||
|
|
||||||
|
//
|
||||||
|
// Bar Checking Summary ...
|
||||||
|
|
||||||
|
//
|
||||||
|
// Bullish ...
|
||||||
|
bool isCCBarPassedBullish =
|
||||||
|
//
|
||||||
|
isCCBarBullishEngulfed ||
|
||||||
|
isCCBarBullishMomentum ||
|
||||||
|
isCCBarBullishRejected
|
||||||
|
//
|
||||||
|
;
|
||||||
|
|
||||||
|
//
|
||||||
|
// Bearish ...
|
||||||
|
bool isCCBarPassedBearish =
|
||||||
|
//
|
||||||
|
isCCBarBearishEngulfed ||
|
||||||
|
isCCBarBearishMomentum ||
|
||||||
|
isCCBarBearishRejected
|
||||||
|
//
|
||||||
|
;
|
||||||
|
|
||||||
|
//
|
||||||
|
double cPeakPrev = conditionStatePrev.x121Conditions.peaksBuffer[0];
|
||||||
|
double cValePrev = conditionStatePrev.x121Conditions.valesBuffer[0];
|
||||||
|
|
||||||
|
//
|
||||||
|
double cPeak = conditionState.x121Conditions.peaksBuffer[1];
|
||||||
|
double cVale = conditionState.x121Conditions.valesBuffer[1];
|
||||||
|
|
||||||
|
//
|
||||||
|
bool isCPeakSame = cPeak == cPeakPrev;
|
||||||
|
bool isCValeSame = cVale == cValePrev;
|
||||||
|
|
||||||
|
//
|
||||||
|
bool isCNewPeakPrev = conditionStatePrev.x121Conditions.isNewPeak;
|
||||||
|
bool isCNewPeakOverLastPrev = conditionStatePrev.x121Conditions.isNewPeakOverLast;
|
||||||
|
bool isCNewPeakUnderLastPrev = conditionStatePrev.x121Conditions.isNewPeakUnderLast;
|
||||||
|
|
||||||
|
//
|
||||||
|
bool isCNewValePrev = conditionStatePrev.x121Conditions.isNewVale;
|
||||||
|
bool isCNewValeOverLastPrev = conditionStatePrev.x121Conditions.isNewValeOverLast;
|
||||||
|
bool isCNewValeUnderLastPrev = conditionStatePrev.x121Conditions.isNewValeUnderLast;
|
||||||
|
|
||||||
|
//
|
||||||
|
bool isCRSIOverSold = conditionState.x121Conditions.isRSIOverSold;
|
||||||
|
bool isCRSICrossedOverOverSold = conditionState.x121Conditions.isRSICrossedOverOverSold;
|
||||||
|
bool isCRSICrossedUnderOverSold = conditionState.x121Conditions.isRSICrossedUnderOverSold;
|
||||||
|
|
||||||
|
//
|
||||||
|
bool isCRSIOverBought = conditionState.x121Conditions.isRSIOverBought;
|
||||||
|
bool isCRSICrossedOverOverBought = conditionState.x121Conditions.isRSICrossedOverOverBought;
|
||||||
|
bool isCRSICrossedUnderOverBought = conditionState.x121Conditions.isRSICrossedUnderOverBought;
|
||||||
|
|
||||||
|
//
|
||||||
|
bool isCRSIOverSoldPrev = conditionStatePrev.x121Conditions.isRSIOverSold;
|
||||||
|
bool isCRSICrossedOverOverSoldPrev = conditionStatePrev.x121Conditions.isRSICrossedOverOverSold;
|
||||||
|
bool isCRSICrossedUnderOverSoldPrev = conditionStatePrev.x121Conditions.isRSICrossedUnderOverSold;
|
||||||
|
|
||||||
|
//
|
||||||
|
bool isCRSIOverBoughtPrev = conditionStatePrev.x121Conditions.isRSIOverBought;
|
||||||
|
bool isCRSICrossedOverOverBoughtPrev = conditionStatePrev.x121Conditions.isRSICrossedOverOverBought;
|
||||||
|
bool isCRSICrossedUnderOverBoughtPrev = conditionStatePrev.x121Conditions.isRSICrossedUnderOverBought;
|
||||||
|
|
||||||
|
//
|
||||||
|
isBullish =
|
||||||
|
//
|
||||||
|
isCNewValePrev &&
|
||||||
|
isCCBarPassedBullish
|
||||||
|
//
|
||||||
|
;
|
||||||
|
|
||||||
|
//
|
||||||
|
isBearish =
|
||||||
|
//
|
||||||
|
isCNewPeakPrev &&
|
||||||
|
isCCBarPassedBearish
|
||||||
|
//
|
||||||
|
;
|
||||||
|
|
||||||
|
//
|
||||||
|
result = isBullish ||
|
||||||
|
isBearish;
|
||||||
|
if (!result)
|
||||||
|
{
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
conditions.pivot =
|
||||||
|
isBullish
|
||||||
|
? conditionState.x121Conditions.valesBuffer[1]
|
||||||
|
: conditionState.x121Conditions.peaksBuffer[1];
|
||||||
|
|
||||||
|
//
|
||||||
|
double peak = analyseConditions.x121Conditions.peaksBuffer[1];
|
||||||
|
double vale = analyseConditions.x121Conditions.valesBuffer[1];
|
||||||
|
|
||||||
|
//
|
||||||
|
double strUpper = analyseConditions.x121Conditions.strUpBuffer[1];
|
||||||
|
double strLower = analyseConditions.x121Conditions.strDownBuffer[1];
|
||||||
|
|
||||||
|
//
|
||||||
|
bool isStrSwitchedToBullish = analyseConditions.x121Conditions.isStrSwitchedToBullish;
|
||||||
|
bool isStrSwitchedToBearish = analyseConditions.x121Conditions.isStrSwitchedToBearish;
|
||||||
|
|
||||||
|
//
|
||||||
|
isBullish = isStrSwitchedToBullish;
|
||||||
|
isBearish = isStrSwitchedToBearish;
|
||||||
|
|
||||||
|
//
|
||||||
|
result = isBullish ||
|
||||||
|
isBearish;
|
||||||
|
if (!result)
|
||||||
|
{
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
conditions.pivot =
|
||||||
|
isBullish
|
||||||
|
? peak
|
||||||
|
: vale;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//
|
||||||
|
// Looking For Sar Change ...
|
||||||
|
|
||||||
|
//
|
||||||
|
double sar = analyseConditions.x121Conditions.sarBuffer[1];
|
||||||
|
|
||||||
|
//
|
||||||
|
double peak = analyseConditions.x121Conditions.peaksBuffer[1];
|
||||||
|
double vale = analyseConditions.x121Conditions.valesBuffer[1];
|
||||||
|
|
||||||
|
//
|
||||||
|
bool isSarEqualsToPeak = analyseConditions.x121Conditions.isSarEqualsToPeak;
|
||||||
|
bool isSarEqualsToVale = analyseConditions.x121Conditions.isSarEqualsToVale;
|
||||||
|
|
||||||
|
//
|
||||||
|
bool isSarSwitchedToBullish = analyseConditions.x121Conditions.isSarSwitchedToBullish;
|
||||||
|
bool isSarSwitchedToBearish = analyseConditions.x121Conditions.isSarSwitchedToBearish;
|
||||||
|
|
||||||
|
//
|
||||||
|
isBullish =
|
||||||
|
isBullish &&
|
||||||
|
isSarEqualsToPeak &&
|
||||||
|
isSarSwitchedToBullish;
|
||||||
|
|
||||||
|
//
|
||||||
|
isBearish =
|
||||||
|
isBearish &&
|
||||||
|
isSarEqualsToVale &&
|
||||||
|
isSarSwitchedToBearish;
|
||||||
|
|
||||||
|
//
|
||||||
|
result = isBullish ||
|
||||||
|
isBearish;
|
||||||
|
if (!result)
|
||||||
|
{
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
Print("Sar Switched ...");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//
|
||||||
|
// Detect a Zone Arround Price Zone ...
|
||||||
|
int supplyZonesCount = consolidationState.CountSupplyZones();
|
||||||
|
if (IsValidSize(supplyZonesCount)) {
|
||||||
|
//
|
||||||
|
for (int i = 0; i < supplyZonesCount; i++) {
|
||||||
|
//
|
||||||
|
XCSupplyZone *iZone = consolidationState.supplyZones[i];
|
||||||
|
|
||||||
|
//
|
||||||
|
bool isOver = iZone.Lower() > pzUpper;
|
||||||
|
bool isUnder = iZone.Upper() < pzLower;
|
||||||
|
|
||||||
|
//
|
||||||
|
bool isValid =
|
||||||
|
isOver ||
|
||||||
|
isUnder;
|
||||||
|
if (isValid) {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
+388
-117
@@ -186,34 +186,34 @@ struct X121Conditions
|
|||||||
//
|
//
|
||||||
// Conditions ...
|
// Conditions ...
|
||||||
|
|
||||||
bool isRSIOverBought;
|
bool isRsiOverBought;
|
||||||
bool isRSICrossedOverOverBought;
|
bool isRsiCrossedOverOverBought;
|
||||||
bool isRSICrossedUnderOverBought;
|
bool isRsiCrossedUnderOverBought;
|
||||||
bool isRSIOverSold;
|
bool isRsiOverSold;
|
||||||
bool isRSICrossedUnderOverSold;
|
bool isRsiCrossedUnderOverSold;
|
||||||
bool isRSICrossedOverOverSold;
|
bool isRsiCrossedOverOverSold;
|
||||||
|
|
||||||
//
|
//
|
||||||
bool isCloseOverATRUpper;
|
bool isCloseOverAtrUpper;
|
||||||
bool isCloseOverATRLower;
|
bool isCloseOverAtrLower;
|
||||||
bool isCloseUnderATRUpper;
|
bool isCloseUnderAtrUpper;
|
||||||
bool isCloseUnderATRLower;
|
bool isCloseUnderAtrLower;
|
||||||
|
|
||||||
//
|
//
|
||||||
bool isRejectUpATRUpper;
|
bool isRejectUpAtrUpper;
|
||||||
bool isRejectDownATRUpper;
|
bool isRejectDownAtrUpper;
|
||||||
|
|
||||||
//
|
//
|
||||||
bool isRejectUpATRLower;
|
bool isRejectUpAtrLower;
|
||||||
bool isRejectDownATRLower;
|
bool isRejectDownAtrLower;
|
||||||
|
|
||||||
//
|
//
|
||||||
bool isBreakUpATRUpper;
|
bool isBreakUpAtrUpper;
|
||||||
bool isBreakDownATRUpper;
|
bool isBreakDownAtrUpper;
|
||||||
|
|
||||||
//
|
//
|
||||||
bool isBreakUpATRLower;
|
bool isBreakUpAtrLower;
|
||||||
bool isBreakDownATRLower;
|
bool isBreakDownAtrLower;
|
||||||
|
|
||||||
//
|
//
|
||||||
bool isRejectDonOpenUpper;
|
bool isRejectDonOpenUpper;
|
||||||
@@ -294,20 +294,76 @@ struct X121Conditions
|
|||||||
bool isSarEqualsToVale;
|
bool isSarEqualsToVale;
|
||||||
|
|
||||||
//
|
//
|
||||||
bool isNewPeakOverATRUpper;
|
bool isSarCrossedUnderPeak;
|
||||||
bool isNewValeUnderATRLower;
|
bool isSarCrossedOverVale;
|
||||||
|
|
||||||
|
//
|
||||||
|
bool isStrEqualsToPeak;
|
||||||
|
bool isStrEqualsToVale;
|
||||||
|
|
||||||
|
//
|
||||||
|
bool isStrCrossedUnderPeak;
|
||||||
|
bool isStrCrossedOverVale;
|
||||||
|
|
||||||
|
//
|
||||||
|
bool isPeakOverAtrUpper;
|
||||||
|
bool isValeUnderAtrLower;
|
||||||
|
|
||||||
|
//
|
||||||
|
bool isNewPeakOverAtrUpper;
|
||||||
|
bool isNewValeUnderAtrLower;
|
||||||
|
|
||||||
|
//
|
||||||
|
bool isStrUpperOverPeak;
|
||||||
|
bool isStrUpperUnderPeak;
|
||||||
|
|
||||||
|
//
|
||||||
|
bool isStrUpperCrossedOverPeak;
|
||||||
|
bool isStrUpperCrossedUnderPeak;
|
||||||
|
|
||||||
|
//
|
||||||
|
bool isStrLowerOverVale;
|
||||||
|
bool isStrLowerUnderVale;
|
||||||
|
|
||||||
|
//
|
||||||
|
bool isStrLowerCrossedOverVale;
|
||||||
|
bool isStrLowerCrossedUnderVale;
|
||||||
|
|
||||||
//
|
//
|
||||||
bool isDonHighUpperEqualsToPeak;
|
bool isDonHighUpperEqualsToPeak;
|
||||||
bool isDonLowLowerEqualsToVale;
|
bool isDonLowLowerEqualsToVale;
|
||||||
|
|
||||||
//
|
//
|
||||||
bool isSTRUpperCrossedOverATRUpper;
|
bool isStrUpperOverAtrUpper;
|
||||||
bool isSTRLowerCrossedUnderATRLower;
|
bool isStrUpperUnderAtrUpper;
|
||||||
|
|
||||||
//
|
//
|
||||||
bool isSTRUpperCrossedOverDonHighUpper;
|
bool isStrLowerOverAtrLower;
|
||||||
bool isSTRLowerCrossedUnderDonLowLower;
|
bool isStrLowerUnderAtrLower;
|
||||||
|
|
||||||
|
//
|
||||||
|
bool isStrUpperCrossedOverAtrUpper;
|
||||||
|
bool isStrUpperCrossedUnderAtrUpper;
|
||||||
|
|
||||||
|
//
|
||||||
|
bool isStrLowerCrossedOverAtrLower;
|
||||||
|
bool isStrLowerCrossedUnderAtrLower;
|
||||||
|
|
||||||
|
//
|
||||||
|
bool isStrUpperOverDonHighUpper;
|
||||||
|
bool isStrUpperUnderDonHighUpper;
|
||||||
|
|
||||||
|
//
|
||||||
|
bool isStrLowerOverDonLowLower;
|
||||||
|
bool isStrLowerUnderDonLowLower;
|
||||||
|
|
||||||
|
//
|
||||||
|
bool isStrUpperCrossedOverDonHighUpper;
|
||||||
|
bool isStrUpperCrossedUnderDonHighUpper;
|
||||||
|
|
||||||
|
//
|
||||||
|
bool isStrLowerCrossedOverDonLowLower;
|
||||||
|
bool isStrLowerCrossedUnderDonLowLower;
|
||||||
|
|
||||||
//
|
//
|
||||||
// Constructor ...
|
// Constructor ...
|
||||||
@@ -424,41 +480,41 @@ struct X121Conditions
|
|||||||
// RSI ...
|
// RSI ...
|
||||||
|
|
||||||
//
|
//
|
||||||
isRSIOverBought = false;
|
isRsiOverBought = false;
|
||||||
isRSICrossedOverOverBought = false;
|
isRsiCrossedOverOverBought = false;
|
||||||
isRSICrossedUnderOverBought = false;
|
isRsiCrossedUnderOverBought = false;
|
||||||
|
|
||||||
//
|
//
|
||||||
isRSIOverSold = false;
|
isRsiOverSold = false;
|
||||||
isRSICrossedUnderOverSold = false;
|
isRsiCrossedUnderOverSold = false;
|
||||||
isRSICrossedOverOverSold = false;
|
isRsiCrossedOverOverSold = false;
|
||||||
|
|
||||||
//
|
//
|
||||||
// ATR ...
|
// ATR ...
|
||||||
|
|
||||||
//
|
//
|
||||||
isCloseOverATRUpper = false;
|
isCloseOverAtrUpper = false;
|
||||||
isCloseOverATRLower = false;
|
isCloseOverAtrLower = false;
|
||||||
|
|
||||||
//
|
//
|
||||||
isCloseUnderATRUpper = false;
|
isCloseUnderAtrUpper = false;
|
||||||
isCloseUnderATRLower = false;
|
isCloseUnderAtrLower = false;
|
||||||
|
|
||||||
//
|
//
|
||||||
isRejectUpATRUpper = false;
|
isRejectUpAtrUpper = false;
|
||||||
isRejectDownATRUpper = false;
|
isRejectDownAtrUpper = false;
|
||||||
|
|
||||||
//
|
//
|
||||||
isRejectUpATRLower = false;
|
isRejectUpAtrLower = false;
|
||||||
isRejectDownATRLower = false;
|
isRejectDownAtrLower = false;
|
||||||
|
|
||||||
//
|
//
|
||||||
isBreakUpATRUpper = false;
|
isBreakUpAtrUpper = false;
|
||||||
isBreakDownATRUpper = false;
|
isBreakDownAtrUpper = false;
|
||||||
|
|
||||||
//
|
//
|
||||||
isBreakUpATRLower = false;
|
isBreakUpAtrLower = false;
|
||||||
isBreakDownATRLower = false;
|
isBreakDownAtrLower = false;
|
||||||
|
|
||||||
//
|
//
|
||||||
// DON ...
|
// DON ...
|
||||||
@@ -574,20 +630,76 @@ struct X121Conditions
|
|||||||
isSarEqualsToVale = false;
|
isSarEqualsToVale = false;
|
||||||
|
|
||||||
//
|
//
|
||||||
isNewPeakOverATRUpper = false;
|
isSarCrossedUnderPeak = false;
|
||||||
isNewValeUnderATRLower = false;
|
isSarCrossedOverVale = false;
|
||||||
|
|
||||||
|
//
|
||||||
|
isStrEqualsToPeak = false;
|
||||||
|
isStrEqualsToVale = false;
|
||||||
|
|
||||||
|
//
|
||||||
|
isStrCrossedUnderPeak = false;
|
||||||
|
isStrCrossedOverVale = false;
|
||||||
|
|
||||||
|
//
|
||||||
|
isPeakOverAtrUpper = false;
|
||||||
|
isValeUnderAtrLower = false;
|
||||||
|
|
||||||
|
//
|
||||||
|
isNewPeakOverAtrUpper = false;
|
||||||
|
isNewValeUnderAtrLower = false;
|
||||||
|
|
||||||
|
//
|
||||||
|
isStrUpperOverPeak = false;
|
||||||
|
isStrUpperUnderPeak = false;
|
||||||
|
|
||||||
|
//
|
||||||
|
isStrUpperCrossedOverPeak = false;
|
||||||
|
isStrUpperCrossedUnderPeak = false;
|
||||||
|
|
||||||
|
//
|
||||||
|
isStrLowerOverVale = false;
|
||||||
|
isStrLowerUnderVale = false;
|
||||||
|
|
||||||
|
//
|
||||||
|
isStrLowerCrossedOverVale = false;
|
||||||
|
isStrLowerCrossedUnderVale = false;
|
||||||
|
|
||||||
//
|
//
|
||||||
isDonHighUpperEqualsToPeak = false;
|
isDonHighUpperEqualsToPeak = false;
|
||||||
isDonLowLowerEqualsToVale = false;
|
isDonLowLowerEqualsToVale = false;
|
||||||
|
|
||||||
//
|
//
|
||||||
isSTRUpperCrossedOverATRUpper = false;
|
isStrUpperOverAtrUpper = false;
|
||||||
isSTRLowerCrossedUnderATRLower = false;
|
isStrUpperUnderAtrUpper = false;
|
||||||
|
|
||||||
//
|
//
|
||||||
isSTRUpperCrossedOverDonHighUpper = false;
|
isStrLowerOverAtrLower = false;
|
||||||
isSTRLowerCrossedUnderDonLowLower = false;
|
isStrLowerUnderAtrLower = false;
|
||||||
|
|
||||||
|
//
|
||||||
|
isStrUpperCrossedOverAtrUpper = false;
|
||||||
|
isStrUpperCrossedUnderAtrUpper = false;
|
||||||
|
|
||||||
|
//
|
||||||
|
isStrLowerCrossedOverAtrLower = false;
|
||||||
|
isStrLowerCrossedUnderAtrLower = false;
|
||||||
|
|
||||||
|
//
|
||||||
|
isStrUpperOverDonHighUpper = false;
|
||||||
|
isStrUpperUnderDonHighUpper = false;
|
||||||
|
|
||||||
|
//
|
||||||
|
isStrLowerOverDonLowLower = false;
|
||||||
|
isStrLowerUnderDonLowLower = false;
|
||||||
|
|
||||||
|
//
|
||||||
|
isStrUpperCrossedOverDonHighUpper = false;
|
||||||
|
isStrUpperCrossedUnderDonHighUpper = false;
|
||||||
|
|
||||||
|
//
|
||||||
|
isStrLowerCrossedOverDonLowLower = false;
|
||||||
|
isStrLowerCrossedUnderDonLowLower = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -657,6 +769,7 @@ struct X121Conditions
|
|||||||
//
|
//
|
||||||
string conditionsStr =
|
string conditionsStr =
|
||||||
//
|
//
|
||||||
|
"-----------------------" + separator +
|
||||||
"SAR ..." + separator +
|
"SAR ..." + separator +
|
||||||
"-----------------------" + separator +
|
"-----------------------" + separator +
|
||||||
ToString("isSarBullish", isSarBullish, ignoreFalseConditions, separator) +
|
ToString("isSarBullish", isSarBullish, ignoreFalseConditions, separator) +
|
||||||
@@ -664,6 +777,7 @@ struct X121Conditions
|
|||||||
ToString("isSarSwitchedToBullish", isSarSwitchedToBullish, ignoreFalseConditions, separator) +
|
ToString("isSarSwitchedToBullish", isSarSwitchedToBullish, ignoreFalseConditions, separator) +
|
||||||
ToString("isSarSwitchedToBearish", isSarSwitchedToBearish, ignoreFalseConditions, separator) +
|
ToString("isSarSwitchedToBearish", isSarSwitchedToBearish, ignoreFalseConditions, separator) +
|
||||||
//
|
//
|
||||||
|
"-----------------------" + separator +
|
||||||
"STR ..." + separator +
|
"STR ..." + separator +
|
||||||
"-----------------------" + separator +
|
"-----------------------" + separator +
|
||||||
ToString("isStrBullish", isStrBullish, ignoreFalseConditions, separator) +
|
ToString("isStrBullish", isStrBullish, ignoreFalseConditions, separator) +
|
||||||
@@ -671,6 +785,7 @@ struct X121Conditions
|
|||||||
ToString("isStrSwitchedToBullish", isStrSwitchedToBullish, ignoreFalseConditions, separator) +
|
ToString("isStrSwitchedToBullish", isStrSwitchedToBullish, ignoreFalseConditions, separator) +
|
||||||
ToString("isStrSwitchedToBearish", isStrSwitchedToBearish, ignoreFalseConditions, separator) +
|
ToString("isStrSwitchedToBearish", isStrSwitchedToBearish, ignoreFalseConditions, separator) +
|
||||||
//
|
//
|
||||||
|
"-----------------------" + separator +
|
||||||
"PV ..." + separator +
|
"PV ..." + separator +
|
||||||
"-----------------------" + separator +
|
"-----------------------" + separator +
|
||||||
ToString("isNewPeak", isNewPeak, ignoreFalseConditions, separator) +
|
ToString("isNewPeak", isNewPeak, ignoreFalseConditions, separator) +
|
||||||
@@ -680,32 +795,35 @@ struct X121Conditions
|
|||||||
ToString("isNewValeOverLast", isNewValeOverLast, ignoreFalseConditions, separator) +
|
ToString("isNewValeOverLast", isNewValeOverLast, ignoreFalseConditions, separator) +
|
||||||
ToString("isNewValeUnderLast", isNewValeUnderLast, ignoreFalseConditions, separator) +
|
ToString("isNewValeUnderLast", isNewValeUnderLast, ignoreFalseConditions, separator) +
|
||||||
//
|
//
|
||||||
|
"-----------------------" + separator +
|
||||||
"> RSI ..." + separator +
|
"> RSI ..." + separator +
|
||||||
"-----------------------" + separator +
|
"-----------------------" + separator +
|
||||||
ToString("isRSIOverBought", isRSIOverBought, ignoreFalseConditions, separator) +
|
ToString("isRsiOverBought", isRsiOverBought, ignoreFalseConditions, separator) +
|
||||||
ToString("isRSICrossedOverOverBought", isRSICrossedOverOverBought, ignoreFalseConditions, separator) +
|
ToString("isRsiCrossedOverOverBought", isRsiCrossedOverOverBought, ignoreFalseConditions, separator) +
|
||||||
ToString("isRSICrossedUnderOverBought", isRSICrossedUnderOverBought, ignoreFalseConditions, separator) +
|
ToString("isRsiCrossedUnderOverBought", isRsiCrossedUnderOverBought, ignoreFalseConditions, separator) +
|
||||||
ToString("isRSIOverSold", isRSIOverSold, ignoreFalseConditions, separator) +
|
ToString("isRsiOverSold", isRsiOverSold, ignoreFalseConditions, separator) +
|
||||||
ToString("isRSICrossedUnderOverSold", isRSICrossedUnderOverSold, ignoreFalseConditions, separator) +
|
ToString("isRsiCrossedUnderOverSold", isRsiCrossedUnderOverSold, ignoreFalseConditions, separator) +
|
||||||
ToString("isRSICrossedOverOverSold", isRSICrossedOverOverSold, ignoreFalseConditions, separator) +
|
ToString("isRsiCrossedOverOverSold", isRsiCrossedOverOverSold, ignoreFalseConditions, separator) +
|
||||||
//
|
//
|
||||||
|
"-----------------------" + separator +
|
||||||
"ATR ..." + separator +
|
"ATR ..." + separator +
|
||||||
"-----------------------" + separator +
|
"-----------------------" + separator +
|
||||||
ToString("isCloseOverATRUpper", isCloseOverATRUpper, ignoreFalseConditions, separator) +
|
ToString("isCloseOverAtrUpper", isCloseOverAtrUpper, ignoreFalseConditions, separator) +
|
||||||
ToString("isCloseOverATRLower", isCloseOverATRLower, ignoreFalseConditions, separator) +
|
ToString("isCloseOverAtrLower", isCloseOverAtrLower, ignoreFalseConditions, separator) +
|
||||||
ToString("isCloseUnderATRUpper", isCloseUnderATRUpper, ignoreFalseConditions, separator) +
|
ToString("isCloseUnderAtrUpper", isCloseUnderAtrUpper, ignoreFalseConditions, separator) +
|
||||||
ToString("isCloseUnderATRLower", isCloseUnderATRLower, ignoreFalseConditions, separator) +
|
ToString("isCloseUnderAtrLower", isCloseUnderAtrLower, ignoreFalseConditions, separator) +
|
||||||
ToString("isRejectUpATRUpper", isRejectUpATRUpper, ignoreFalseConditions, separator) +
|
ToString("isRejectUpAtrUpper", isRejectUpAtrUpper, ignoreFalseConditions, separator) +
|
||||||
ToString("isRejectDownATRUpper", isRejectDownATRUpper, ignoreFalseConditions, separator) +
|
ToString("isRejectDownAtrUpper", isRejectDownAtrUpper, ignoreFalseConditions, separator) +
|
||||||
ToString("isRejectUpATRLower", isRejectUpATRLower, ignoreFalseConditions, separator) +
|
ToString("isRejectUpAtrLower", isRejectUpAtrLower, ignoreFalseConditions, separator) +
|
||||||
ToString("isRejectDownATRLower", isRejectDownATRLower, ignoreFalseConditions, separator) +
|
ToString("isRejectDownAtrLower", isRejectDownAtrLower, ignoreFalseConditions, separator) +
|
||||||
ToString("isBreakUpATRUpper", isBreakUpATRUpper, ignoreFalseConditions, separator) +
|
ToString("isBreakUpAtrUpper", isBreakUpAtrUpper, ignoreFalseConditions, separator) +
|
||||||
ToString("isBreakDownATRUpper", isBreakDownATRUpper, ignoreFalseConditions, separator) +
|
ToString("isBreakDownAtrUpper", isBreakDownAtrUpper, ignoreFalseConditions, separator) +
|
||||||
ToString("isBreakUpATRLower", isBreakUpATRLower, ignoreFalseConditions, separator) +
|
ToString("isBreakUpAtrLower", isBreakUpAtrLower, ignoreFalseConditions, separator) +
|
||||||
//
|
//
|
||||||
|
"-----------------------" + separator +
|
||||||
"DON ..." + separator +
|
"DON ..." + separator +
|
||||||
"-----------------------" + separator +
|
"-----------------------" + separator +
|
||||||
ToString("isBreakDownATRLower", isBreakDownATRLower, ignoreFalseConditions, separator) +
|
ToString("isBreakDownAtrLower", isBreakDownAtrLower, ignoreFalseConditions, separator) +
|
||||||
ToString("isRejectDonOpenUpper", isRejectDonOpenUpper, ignoreFalseConditions, separator) +
|
ToString("isRejectDonOpenUpper", isRejectDonOpenUpper, ignoreFalseConditions, separator) +
|
||||||
ToString("isRejectDonHighUpper", isRejectDonHighUpper, ignoreFalseConditions, separator) +
|
ToString("isRejectDonHighUpper", isRejectDonHighUpper, ignoreFalseConditions, separator) +
|
||||||
ToString("isRejectDonLowUpper", isRejectDonLowUpper, ignoreFalseConditions, separator) +
|
ToString("isRejectDonLowUpper", isRejectDonLowUpper, ignoreFalseConditions, separator) +
|
||||||
@@ -723,6 +841,7 @@ struct X121Conditions
|
|||||||
ToString("isBreakDonLowLower", isBreakDonLowLower, ignoreFalseConditions, separator) +
|
ToString("isBreakDonLowLower", isBreakDonLowLower, ignoreFalseConditions, separator) +
|
||||||
ToString("isBreakDonCloseLower", isBreakDonCloseLower, ignoreFalseConditions, separator) +
|
ToString("isBreakDonCloseLower", isBreakDonCloseLower, ignoreFalseConditions, separator) +
|
||||||
//
|
//
|
||||||
|
"-----------------------" + separator +
|
||||||
"VWAP ..." + separator +
|
"VWAP ..." + separator +
|
||||||
"-----------------------" + separator +
|
"-----------------------" + separator +
|
||||||
ToString("isVWapFastBullish", isVWapFastBullish, ignoreFalseConditions, separator) +
|
ToString("isVWapFastBullish", isVWapFastBullish, ignoreFalseConditions, separator) +
|
||||||
@@ -754,14 +873,42 @@ struct X121Conditions
|
|||||||
"-----------------------" + separator +
|
"-----------------------" + separator +
|
||||||
ToString("isSarEqualsToPeak", isSarEqualsToPeak, ignoreFalseConditions, separator) +
|
ToString("isSarEqualsToPeak", isSarEqualsToPeak, ignoreFalseConditions, separator) +
|
||||||
ToString("isSarEqualsToVale", isSarEqualsToVale, ignoreFalseConditions, separator) +
|
ToString("isSarEqualsToVale", isSarEqualsToVale, ignoreFalseConditions, separator) +
|
||||||
ToString("isNewPeakOverATRUpper", isNewPeakOverATRUpper, ignoreFalseConditions, separator) +
|
ToString("isSarCrossedUnderPeak", isSarCrossedUnderPeak, ignoreFalseConditions, separator) +
|
||||||
ToString("isNewValeUnderATRLower", isNewValeUnderATRLower, ignoreFalseConditions, separator) +
|
ToString("isSarCrossedOverVale", isSarCrossedOverVale, ignoreFalseConditions, separator) +
|
||||||
|
ToString("isStrEqualsToPeak", isStrEqualsToPeak, ignoreFalseConditions, separator) +
|
||||||
|
ToString("isStrEqualsToVale", isStrEqualsToVale, ignoreFalseConditions, separator) +
|
||||||
|
ToString("isStrCrossedUnderPeak", isStrCrossedUnderPeak, ignoreFalseConditions, separator) +
|
||||||
|
ToString("isStrCrossedOverVale", isStrCrossedOverVale, ignoreFalseConditions, separator) +
|
||||||
|
ToString("isPeakOverAtrUpper", isPeakOverAtrUpper, ignoreFalseConditions, separator) +
|
||||||
|
ToString("isValeUnderAtrLower", isValeUnderAtrLower, ignoreFalseConditions, separator) +
|
||||||
|
ToString("isNewPeakOverAtrUpper", isNewPeakOverAtrUpper, ignoreFalseConditions, separator) +
|
||||||
|
ToString("isNewValeUnderAtrLower", isNewValeUnderAtrLower, ignoreFalseConditions, separator) +
|
||||||
|
ToString("isStrUpperOverPeak", isStrUpperOverPeak, ignoreFalseConditions, separator) +
|
||||||
|
ToString("isStrUpperUnderPeak", isStrUpperUnderPeak, ignoreFalseConditions, separator) +
|
||||||
|
ToString("isStrUpperCrossedOverPeak", isStrUpperCrossedOverPeak, ignoreFalseConditions, separator) +
|
||||||
|
ToString("isStrUpperCrossedUnderPeak", isStrUpperCrossedUnderPeak, ignoreFalseConditions, separator) +
|
||||||
|
ToString("isStrLowerOverVale", isStrLowerOverVale, ignoreFalseConditions, separator) +
|
||||||
|
ToString("isStrLowerUnderVale", isStrLowerUnderVale, ignoreFalseConditions, separator) +
|
||||||
|
ToString("isStrLowerCrossedOverVale", isStrLowerCrossedOverVale, ignoreFalseConditions, separator) +
|
||||||
|
ToString("isStrLowerCrossedUnderVale", isStrLowerCrossedUnderVale, ignoreFalseConditions, separator) +
|
||||||
ToString("isDonHighUpperEqualsToPeak", isDonHighUpperEqualsToPeak, ignoreFalseConditions, separator) +
|
ToString("isDonHighUpperEqualsToPeak", isDonHighUpperEqualsToPeak, ignoreFalseConditions, separator) +
|
||||||
ToString("isDonLowLowerEqualsToVale", isDonLowLowerEqualsToVale, ignoreFalseConditions, separator) +
|
ToString("isDonLowLowerEqualsToVale", isDonLowLowerEqualsToVale, ignoreFalseConditions, separator) +
|
||||||
ToString("isSTRUpperCrossedOverATRUpper", isSTRUpperCrossedOverATRUpper, ignoreFalseConditions, separator) +
|
ToString("isStrUpperOverAtrUpper", isStrUpperOverAtrUpper, ignoreFalseConditions, separator) +
|
||||||
ToString("isSTRLowerCrossedUnderATRLower", isSTRLowerCrossedUnderATRLower, ignoreFalseConditions, separator) +
|
ToString("isStrUpperUnderAtrUpper", isStrUpperUnderAtrUpper, ignoreFalseConditions, separator) +
|
||||||
ToString("isSTRUpperCrossedOverDonHighUpper", isSTRUpperCrossedOverDonHighUpper, ignoreFalseConditions, separator) +
|
ToString("isStrLowerOverAtrLower", isStrLowerOverAtrLower, ignoreFalseConditions, separator) +
|
||||||
ToString("isSTRLowerCrossedUnderDonLowLower", isSTRLowerCrossedUnderDonLowLower, ignoreFalseConditions, separator) +
|
ToString("isStrLowerUnderAtrLower", isStrLowerUnderAtrLower, ignoreFalseConditions, separator) +
|
||||||
|
ToString("isStrUpperCrossedOverAtrUpper", isStrUpperCrossedOverAtrUpper, ignoreFalseConditions, separator) +
|
||||||
|
ToString("isStrUpperCrossedUnderAtrUpper", isStrUpperCrossedUnderAtrUpper, ignoreFalseConditions, separator) +
|
||||||
|
ToString("isStrLowerCrossedOverAtrLower", isStrLowerCrossedOverAtrLower, ignoreFalseConditions, separator) +
|
||||||
|
ToString("isStrLowerCrossedUnderAtrLower", isStrLowerCrossedUnderAtrLower, ignoreFalseConditions, separator) +
|
||||||
|
ToString("isStrUpperOverDonHighUpper", isStrUpperOverDonHighUpper, ignoreFalseConditions, separator) +
|
||||||
|
ToString("isStrUpperUnderDonHighUpper", isStrUpperUnderDonHighUpper, ignoreFalseConditions, separator) +
|
||||||
|
ToString("isStrLowerOverDonLowLower", isStrLowerOverDonLowLower, ignoreFalseConditions, separator) +
|
||||||
|
ToString("isStrLowerUnderDonLowLower", isStrLowerUnderDonLowLower, ignoreFalseConditions, separator) +
|
||||||
|
ToString("isStrUpperCrossedOverDonHighUpper", isStrUpperCrossedOverDonHighUpper, ignoreFalseConditions, separator) +
|
||||||
|
ToString("isStrUpperCrossedUnderDonHighUpper", isStrUpperCrossedUnderDonHighUpper, ignoreFalseConditions, separator) +
|
||||||
|
ToString("isStrLowerCrossedOverDonLowLower", isStrLowerCrossedOverDonLowLower, ignoreFalseConditions, separator) +
|
||||||
|
ToString("isStrLowerCrossedUnderDonLowLower", isStrLowerCrossedUnderDonLowLower, ignoreFalseConditions, separator) +
|
||||||
//
|
//
|
||||||
""
|
""
|
||||||
//
|
//
|
||||||
@@ -1378,24 +1525,24 @@ class XCX121Helper : public XCBase
|
|||||||
// Conditions ...
|
// Conditions ...
|
||||||
|
|
||||||
//
|
//
|
||||||
conditions.isRSIOverSold = xatrConditions.isRSIOverSold;
|
conditions.isRsiOverSold = xatrConditions.isRsiOverSold;
|
||||||
conditions.isRSIOverBought = xatrConditions.isRSIOverBought;
|
conditions.isRsiOverBought = xatrConditions.isRsiOverBought;
|
||||||
conditions.isBreakUpATRUpper = xatrConditions.isBreakUpATRUpper;
|
conditions.isBreakUpAtrUpper = xatrConditions.isBreakUpAtrUpper;
|
||||||
conditions.isBreakUpATRLower = xatrConditions.isBreakUpATRLower;
|
conditions.isBreakUpAtrLower = xatrConditions.isBreakUpAtrLower;
|
||||||
conditions.isCloseOverATRUpper = xatrConditions.isCloseOverATRUpper;
|
conditions.isCloseOverAtrUpper = xatrConditions.isCloseOverAtrUpper;
|
||||||
conditions.isRejectUpATRUpper = xatrConditions.isRejectUpATRUpper;
|
conditions.isRejectUpAtrUpper = xatrConditions.isRejectUpAtrUpper;
|
||||||
conditions.isRejectUpATRLower = xatrConditions.isRejectUpATRLower;
|
conditions.isRejectUpAtrLower = xatrConditions.isRejectUpAtrLower;
|
||||||
conditions.isCloseOverATRLower = xatrConditions.isCloseOverATRLower;
|
conditions.isCloseOverAtrLower = xatrConditions.isCloseOverAtrLower;
|
||||||
conditions.isBreakDownATRUpper = xatrConditions.isBreakDownATRUpper;
|
conditions.isBreakDownAtrUpper = xatrConditions.isBreakDownAtrUpper;
|
||||||
conditions.isBreakDownATRLower = xatrConditions.isBreakDownATRLower;
|
conditions.isBreakDownAtrLower = xatrConditions.isBreakDownAtrLower;
|
||||||
conditions.isCloseUnderATRUpper = xatrConditions.isCloseUnderATRUpper;
|
conditions.isCloseUnderAtrUpper = xatrConditions.isCloseUnderAtrUpper;
|
||||||
conditions.isCloseUnderATRLower = xatrConditions.isCloseUnderATRLower;
|
conditions.isCloseUnderAtrLower = xatrConditions.isCloseUnderAtrLower;
|
||||||
conditions.isRejectDownATRUpper = xatrConditions.isRejectDownATRUpper;
|
conditions.isRejectDownAtrUpper = xatrConditions.isRejectDownAtrUpper;
|
||||||
conditions.isRejectDownATRLower = xatrConditions.isRejectDownATRLower;
|
conditions.isRejectDownAtrLower = xatrConditions.isRejectDownAtrLower;
|
||||||
conditions.isRSICrossedOverOverSold = xatrConditions.isRSICrossedOverOverSold;
|
conditions.isRsiCrossedOverOverSold = xatrConditions.isRsiCrossedOverOverSold;
|
||||||
conditions.isRSICrossedUnderOverSold = xatrConditions.isRSICrossedUnderOverSold;
|
conditions.isRsiCrossedUnderOverSold = xatrConditions.isRsiCrossedUnderOverSold;
|
||||||
conditions.isRSICrossedOverOverBought = xatrConditions.isRSICrossedOverOverBought;
|
conditions.isRsiCrossedOverOverBought = xatrConditions.isRsiCrossedOverOverBought;
|
||||||
conditions.isRSICrossedUnderOverBought = xatrConditions.isRSICrossedUnderOverBought;
|
conditions.isRsiCrossedUnderOverBought = xatrConditions.isRsiCrossedUnderOverBought;
|
||||||
|
|
||||||
//
|
//
|
||||||
// XSTR ...
|
// XSTR ...
|
||||||
@@ -1613,13 +1760,77 @@ class XCX121Helper : public XCBase
|
|||||||
conditions.sarBuffer[cIDX] == conditions.valesBuffer[cIDX];
|
conditions.sarBuffer[cIDX] == conditions.valesBuffer[cIDX];
|
||||||
|
|
||||||
//
|
//
|
||||||
bool isNewPeakOverATRUpper =
|
bool isSarCrossedUnderPeak =
|
||||||
conditions.isNewPeak &&
|
conditions.sarBuffer[cIDX] < conditions.peaksBuffer[cIDX] &&
|
||||||
|
!(conditions.sarBuffer[pIDX] < conditions.peaksBuffer[pIDX]);
|
||||||
|
bool isSarCrossedOverVale =
|
||||||
|
conditions.sarBuffer[cIDX] > conditions.valesBuffer[cIDX] &&
|
||||||
|
!(conditions.sarBuffer[pIDX] > conditions.valesBuffer[pIDX]);
|
||||||
|
|
||||||
|
//
|
||||||
|
bool isStrEqualsToPeak =
|
||||||
|
conditions.strBuffer[cIDX] == conditions.peaksBuffer[cIDX];
|
||||||
|
bool isStrEqualsToVale =
|
||||||
|
conditions.strBuffer[cIDX] == conditions.valesBuffer[cIDX];
|
||||||
|
|
||||||
|
//
|
||||||
|
bool isStrCrossedUnderPeak =
|
||||||
|
conditions.strBuffer[cIDX] < conditions.peaksBuffer[cIDX] &&
|
||||||
|
!(conditions.strBuffer[pIDX] < conditions.peaksBuffer[pIDX]);
|
||||||
|
bool isStrCrossedOverVale =
|
||||||
|
conditions.strBuffer[cIDX] > conditions.valesBuffer[cIDX] &&
|
||||||
|
!(conditions.strBuffer[pIDX] > conditions.valesBuffer[pIDX]);
|
||||||
|
|
||||||
|
//
|
||||||
|
bool isPeakOverAtrUpper =
|
||||||
conditions.peaksBuffer[cIDX] > conditions.atrUpperBuffer[cIDX];
|
conditions.peaksBuffer[cIDX] > conditions.atrUpperBuffer[cIDX];
|
||||||
bool isNewValeUnderATRLower =
|
bool isValeUnderAtrLower =
|
||||||
conditions.isNewVale &&
|
|
||||||
conditions.valesBuffer[cIDX] > conditions.atrLowerBuffer[cIDX];
|
conditions.valesBuffer[cIDX] > conditions.atrLowerBuffer[cIDX];
|
||||||
|
|
||||||
|
//
|
||||||
|
bool isNewPeakOverAtrUpper =
|
||||||
|
isPeakOverAtrUpper &&
|
||||||
|
conditions.isNewPeak;
|
||||||
|
bool isNewValeUnderAtrLower =
|
||||||
|
isValeUnderAtrLower &&
|
||||||
|
conditions.isNewVale;
|
||||||
|
|
||||||
|
//
|
||||||
|
bool isStrUpperOverPeak =
|
||||||
|
conditions.strBuffer[cIDX] > conditions.peaksBuffer[cIDX];
|
||||||
|
bool isStrUpperOverPeakPrev =
|
||||||
|
conditions.strBuffer[pIDX] > conditions.peaksBuffer[pIDX];
|
||||||
|
|
||||||
|
//
|
||||||
|
bool isStrUpperUnderPeak =
|
||||||
|
conditions.strBuffer[cIDX] < conditions.peaksBuffer[cIDX];
|
||||||
|
bool isStrUpperUnderPeakPrev =
|
||||||
|
conditions.strBuffer[pIDX] < conditions.peaksBuffer[pIDX];
|
||||||
|
|
||||||
|
//
|
||||||
|
bool isStrUpperCrossedOverPeak = isStrUpperOverPeak &&
|
||||||
|
!isStrUpperOverPeakPrev;
|
||||||
|
bool isStrUpperCrossedUnderPeak = isStrUpperUnderPeak &&
|
||||||
|
!isStrUpperUnderPeakPrev;
|
||||||
|
|
||||||
|
//
|
||||||
|
bool isStrLowerOverVale =
|
||||||
|
conditions.strBuffer[cIDX] > conditions.valesBuffer[cIDX];
|
||||||
|
bool isStrLowerOverValePrev =
|
||||||
|
conditions.strBuffer[pIDX] > conditions.valesBuffer[pIDX];
|
||||||
|
|
||||||
|
//
|
||||||
|
bool isStrLowerUnderVale =
|
||||||
|
conditions.strBuffer[cIDX] < conditions.valesBuffer[cIDX];
|
||||||
|
bool isStrLowerUnderValePrev =
|
||||||
|
conditions.strBuffer[pIDX] < conditions.valesBuffer[pIDX];
|
||||||
|
|
||||||
|
//
|
||||||
|
bool isStrLowerCrossedOverVale = isStrLowerOverVale &&
|
||||||
|
!isStrLowerOverValePrev;
|
||||||
|
bool isStrLowerCrossedUnderVale = isStrLowerUnderVale &&
|
||||||
|
!isStrLowerUnderValePrev;
|
||||||
|
|
||||||
//
|
//
|
||||||
bool isDonHighUpperEqualsToPeak =
|
bool isDonHighUpperEqualsToPeak =
|
||||||
conditions.donHighUpperBuffer[cIDX] == conditions.peaksBuffer[cIDX];
|
conditions.donHighUpperBuffer[cIDX] == conditions.peaksBuffer[cIDX];
|
||||||
@@ -1627,48 +1838,108 @@ class XCX121Helper : public XCBase
|
|||||||
conditions.donLowLowerBuffer[cIDX] == conditions.valesBuffer[cIDX];
|
conditions.donLowLowerBuffer[cIDX] == conditions.valesBuffer[cIDX];
|
||||||
|
|
||||||
//
|
//
|
||||||
bool isSTRUpperOverATRUpper =
|
bool isStrUpperOverAtrUpper =
|
||||||
conditions.strUpBuffer[cIDX] > conditions.atrUpperBuffer[cIDX];
|
conditions.strUpBuffer[cIDX] > conditions.atrUpperBuffer[cIDX];
|
||||||
bool isSTRUpperOverATRUpperPrev =
|
bool isStrUpperOverAtrUpperPrev =
|
||||||
conditions.strUpBuffer[pIDX] > conditions.atrUpperBuffer[pIDX];
|
conditions.strUpBuffer[pIDX] > conditions.atrUpperBuffer[pIDX];
|
||||||
bool isSTRUpperCrossedOverATRUpper = isSTRUpperOverATRUpper &&
|
bool isStrUpperCrossedOverAtrUpper = isStrUpperOverAtrUpper &&
|
||||||
!isSTRUpperOverATRUpperPrev;
|
!isStrUpperOverAtrUpperPrev;
|
||||||
|
|
||||||
//
|
//
|
||||||
bool isSTRLowerUnderATRLower =
|
bool isStrUpperUnderAtrUpper =
|
||||||
|
conditions.strUpBuffer[cIDX] < conditions.atrUpperBuffer[cIDX];
|
||||||
|
bool isStrUpperUnderAtrUpperPrev =
|
||||||
|
conditions.strUpBuffer[pIDX] < conditions.atrUpperBuffer[pIDX];
|
||||||
|
bool isStrUpperCrossedUnderAtrUpper = isStrUpperUnderAtrUpper &&
|
||||||
|
!isStrUpperUnderAtrUpperPrev;
|
||||||
|
|
||||||
|
//
|
||||||
|
bool isStrLowerOverAtrLower =
|
||||||
|
conditions.strDownBuffer[cIDX] > conditions.atrLowerBuffer[cIDX];
|
||||||
|
bool isStrLowerOverAtrLowerPrev =
|
||||||
|
conditions.strDownBuffer[pIDX] > conditions.atrLowerBuffer[pIDX];
|
||||||
|
bool isStrLowerCrossedOverAtrLower = isStrLowerOverAtrLower &&
|
||||||
|
!isStrLowerOverAtrLowerPrev;
|
||||||
|
|
||||||
|
//
|
||||||
|
bool isStrLowerUnderAtrLower =
|
||||||
conditions.strDownBuffer[cIDX] < conditions.atrLowerBuffer[cIDX];
|
conditions.strDownBuffer[cIDX] < conditions.atrLowerBuffer[cIDX];
|
||||||
bool isSTRLowerUnderATRLowerPrev =
|
bool isStrLowerUnderAtrLowerPrev =
|
||||||
conditions.strDownBuffer[pIDX] < conditions.atrLowerBuffer[pIDX];
|
conditions.strDownBuffer[pIDX] < conditions.atrLowerBuffer[pIDX];
|
||||||
bool isSTRLowerCrossedUnderATRLower = isSTRLowerUnderATRLower &&
|
bool isStrLowerCrossedUnderAtrLower = isStrLowerUnderAtrLower &&
|
||||||
!isSTRLowerUnderATRLowerPrev;
|
!isStrLowerUnderAtrLowerPrev;
|
||||||
|
|
||||||
//
|
//
|
||||||
bool isSTRUpperOverDonHighUpper =
|
bool isStrUpperOverDonHighUpper =
|
||||||
conditions.strUpBuffer[cIDX] > conditions.donHighUpperBuffer[cIDX];
|
conditions.strUpBuffer[cIDX] > conditions.donHighUpperBuffer[cIDX];
|
||||||
bool isSTRUpperOverDonHighUpperPrev =
|
bool isStrUpperOverDonHighUpperPrev =
|
||||||
conditions.strUpBuffer[pIDX] > conditions.donHighUpperBuffer[pIDX];
|
conditions.strUpBuffer[pIDX] > conditions.donHighUpperBuffer[pIDX];
|
||||||
bool isSTRUpperCrossedOverDonHighUpper = isSTRUpperOverDonHighUpper &&
|
bool isStrUpperCrossedOverDonHighUpper = isStrUpperOverDonHighUpper &&
|
||||||
!isSTRUpperOverDonHighUpperPrev;
|
!isStrUpperOverDonHighUpperPrev;
|
||||||
|
|
||||||
//
|
//
|
||||||
bool isSTRLowerUnderDonLowLower =
|
bool isStrUpperUnderDonHighUpper =
|
||||||
|
conditions.strUpBuffer[cIDX] < conditions.donHighUpperBuffer[cIDX];
|
||||||
|
bool isStrUpperUnderDonHighUpperPrev =
|
||||||
|
conditions.strUpBuffer[pIDX] < conditions.donHighUpperBuffer[pIDX];
|
||||||
|
bool isStrUpperCrossedUnderDonHighUpper = isStrUpperUnderDonHighUpper &&
|
||||||
|
!isStrUpperUnderDonHighUpperPrev;
|
||||||
|
|
||||||
|
//
|
||||||
|
bool isStrLowerOverDonLowLower =
|
||||||
|
conditions.strDownBuffer[cIDX] > conditions.donLowLowerBuffer[cIDX];
|
||||||
|
bool isStrLowerOverDonLowLowerPrev =
|
||||||
|
conditions.strDownBuffer[pIDX] > conditions.donLowLowerBuffer[pIDX];
|
||||||
|
bool isStrLowerCrossedOverDonLowLower = isStrLowerOverDonLowLower &&
|
||||||
|
!isStrLowerOverDonLowLowerPrev;
|
||||||
|
|
||||||
|
//
|
||||||
|
bool isStrLowerUnderDonLowLower =
|
||||||
conditions.strDownBuffer[cIDX] < conditions.donLowLowerBuffer[cIDX];
|
conditions.strDownBuffer[cIDX] < conditions.donLowLowerBuffer[cIDX];
|
||||||
bool isSTRLowerUnderDonLowLowerPrev =
|
bool isStrLowerUnderDonLowLowerPrev =
|
||||||
conditions.strDownBuffer[pIDX] < conditions.donLowLowerBuffer[pIDX];
|
conditions.strDownBuffer[pIDX] < conditions.donLowLowerBuffer[pIDX];
|
||||||
bool isSTRLowerCrossedUnderDonLowLower = isSTRLowerUnderDonLowLower &&
|
bool isStrLowerCrossedUnderDonLowLower = isStrLowerUnderDonLowLower &&
|
||||||
!isSTRLowerUnderDonLowLowerPrev;
|
!isStrLowerUnderDonLowLowerPrev;
|
||||||
|
|
||||||
//
|
//
|
||||||
conditions.isSarEqualsToPeak = isSarEqualsToPeak;
|
conditions.isSarEqualsToPeak = isSarEqualsToPeak;
|
||||||
conditions.isSarEqualsToVale = isSarEqualsToVale;
|
conditions.isSarEqualsToVale = isSarEqualsToVale;
|
||||||
conditions.isNewPeakOverATRUpper = isNewPeakOverATRUpper;
|
conditions.isStrEqualsToPeak = isStrEqualsToPeak;
|
||||||
conditions.isNewValeUnderATRLower = isNewValeUnderATRLower;
|
conditions.isStrEqualsToVale = isStrEqualsToVale;
|
||||||
conditions.isDonHighUpperEqualsToPeak = isDonHighUpperEqualsToPeak;
|
conditions.isStrUpperOverPeak = isStrUpperOverPeak;
|
||||||
|
conditions.isPeakOverAtrUpper = isPeakOverAtrUpper;
|
||||||
|
conditions.isStrLowerOverVale = isStrLowerOverVale;
|
||||||
|
conditions.isStrLowerUnderVale = isStrLowerUnderVale;
|
||||||
|
conditions.isStrUpperUnderPeak = isStrUpperUnderPeak;
|
||||||
|
conditions.isValeUnderAtrLower = isValeUnderAtrLower;
|
||||||
|
conditions.isSarCrossedOverVale = isSarCrossedOverVale;
|
||||||
|
conditions.isStrCrossedOverVale = isStrCrossedOverVale;
|
||||||
|
conditions.isSarCrossedUnderPeak = isSarCrossedUnderPeak;
|
||||||
|
conditions.isStrCrossedUnderPeak = isStrCrossedUnderPeak;
|
||||||
|
conditions.isNewPeakOverAtrUpper = isNewPeakOverAtrUpper;
|
||||||
|
conditions.isNewValeUnderAtrLower = isNewValeUnderAtrLower;
|
||||||
|
conditions.isStrUpperOverAtrUpper = isStrUpperOverAtrUpper;
|
||||||
|
conditions.isStrLowerOverAtrLower = isStrLowerOverAtrLower;
|
||||||
|
conditions.isStrUpperUnderAtrUpper = isStrUpperUnderAtrUpper;
|
||||||
|
conditions.isStrLowerUnderAtrLower = isStrLowerUnderAtrLower;
|
||||||
conditions.isDonLowLowerEqualsToVale = isDonLowLowerEqualsToVale;
|
conditions.isDonLowLowerEqualsToVale = isDonLowLowerEqualsToVale;
|
||||||
conditions.isSTRUpperCrossedOverATRUpper = isSTRUpperCrossedOverATRUpper;
|
conditions.isStrUpperCrossedOverPeak = isStrUpperCrossedOverPeak;
|
||||||
conditions.isSTRLowerCrossedUnderATRLower = isSTRLowerCrossedUnderATRLower;
|
conditions.isStrLowerCrossedOverVale = isStrLowerCrossedOverVale;
|
||||||
conditions.isSTRUpperCrossedOverDonHighUpper = isSTRUpperCrossedOverDonHighUpper;
|
conditions.isStrLowerOverDonLowLower = isStrLowerOverDonLowLower;
|
||||||
conditions.isSTRLowerCrossedUnderDonLowLower = isSTRLowerCrossedUnderDonLowLower;
|
conditions.isStrUpperOverDonHighUpper = isStrUpperOverDonHighUpper;
|
||||||
|
conditions.isStrLowerUnderDonLowLower = isStrLowerUnderDonLowLower;
|
||||||
|
conditions.isDonHighUpperEqualsToPeak = isDonHighUpperEqualsToPeak;
|
||||||
|
conditions.isStrUpperCrossedUnderPeak = isStrUpperCrossedUnderPeak;
|
||||||
|
conditions.isStrLowerCrossedUnderVale = isStrLowerCrossedUnderVale;
|
||||||
|
conditions.isStrUpperUnderDonHighUpper = isStrUpperUnderDonHighUpper;
|
||||||
|
conditions.isStrLowerCrossedOverAtrLower = isStrLowerCrossedOverAtrLower;
|
||||||
|
conditions.isStrUpperCrossedOverAtrUpper = isStrUpperCrossedOverAtrUpper;
|
||||||
|
conditions.isStrUpperCrossedUnderAtrUpper = isStrUpperCrossedUnderAtrUpper;
|
||||||
|
conditions.isStrLowerCrossedUnderAtrLower = isStrLowerCrossedUnderAtrLower;
|
||||||
|
conditions.isStrLowerCrossedOverDonLowLower = isStrLowerCrossedOverDonLowLower;
|
||||||
|
conditions.isStrUpperCrossedOverDonHighUpper = isStrUpperCrossedOverDonHighUpper;
|
||||||
|
conditions.isStrLowerCrossedUnderDonLowLower = isStrLowerCrossedUnderDonLowLower;
|
||||||
|
conditions.isStrUpperCrossedUnderDonHighUpper = isStrUpperCrossedUnderDonHighUpper;
|
||||||
|
|
||||||
//
|
//
|
||||||
return result;
|
return result;
|
||||||
|
|||||||
@@ -197,41 +197,41 @@ struct X121XATRConditions
|
|||||||
// RSI ...
|
// RSI ...
|
||||||
|
|
||||||
//
|
//
|
||||||
bool isRSIOverBought;
|
bool isRsiOverBought;
|
||||||
bool isRSICrossedOverOverBought;
|
bool isRsiCrossedOverOverBought;
|
||||||
bool isRSICrossedUnderOverBought;
|
bool isRsiCrossedUnderOverBought;
|
||||||
|
|
||||||
//
|
//
|
||||||
bool isRSIOverSold;
|
bool isRsiOverSold;
|
||||||
bool isRSICrossedUnderOverSold;
|
bool isRsiCrossedUnderOverSold;
|
||||||
bool isRSICrossedOverOverSold;
|
bool isRsiCrossedOverOverSold;
|
||||||
|
|
||||||
//
|
//
|
||||||
// ATR ...
|
// ATR ...
|
||||||
|
|
||||||
//
|
//
|
||||||
bool isCloseOverATRUpper;
|
bool isCloseOverAtrUpper;
|
||||||
bool isCloseOverATRLower;
|
bool isCloseOverAtrLower;
|
||||||
|
|
||||||
//
|
//
|
||||||
bool isCloseUnderATRUpper;
|
bool isCloseUnderAtrUpper;
|
||||||
bool isCloseUnderATRLower;
|
bool isCloseUnderAtrLower;
|
||||||
|
|
||||||
//
|
//
|
||||||
bool isRejectUpATRUpper;
|
bool isRejectUpAtrUpper;
|
||||||
bool isRejectDownATRUpper;
|
bool isRejectDownAtrUpper;
|
||||||
|
|
||||||
//
|
//
|
||||||
bool isRejectUpATRLower;
|
bool isRejectUpAtrLower;
|
||||||
bool isRejectDownATRLower;
|
bool isRejectDownAtrLower;
|
||||||
|
|
||||||
//
|
//
|
||||||
bool isBreakUpATRUpper;
|
bool isBreakUpAtrUpper;
|
||||||
bool isBreakDownATRUpper;
|
bool isBreakDownAtrUpper;
|
||||||
|
|
||||||
//
|
//
|
||||||
bool isBreakUpATRLower;
|
bool isBreakUpAtrLower;
|
||||||
bool isBreakDownATRLower;
|
bool isBreakDownAtrLower;
|
||||||
|
|
||||||
//
|
//
|
||||||
// bool isCloseLower
|
// bool isCloseLower
|
||||||
@@ -283,41 +283,41 @@ struct X121XATRConditions
|
|||||||
// RSI ...
|
// RSI ...
|
||||||
|
|
||||||
//
|
//
|
||||||
isRSIOverBought = false;
|
isRsiOverBought = false;
|
||||||
isRSICrossedOverOverBought = false;
|
isRsiCrossedOverOverBought = false;
|
||||||
isRSICrossedUnderOverBought = false;
|
isRsiCrossedUnderOverBought = false;
|
||||||
|
|
||||||
//
|
//
|
||||||
isRSIOverSold = false;
|
isRsiOverSold = false;
|
||||||
isRSICrossedUnderOverSold = false;
|
isRsiCrossedUnderOverSold = false;
|
||||||
isRSICrossedOverOverSold = false;
|
isRsiCrossedOverOverSold = false;
|
||||||
|
|
||||||
//
|
//
|
||||||
// ATR ...
|
// ATR ...
|
||||||
|
|
||||||
//
|
//
|
||||||
isCloseOverATRUpper = false;
|
isCloseOverAtrUpper = false;
|
||||||
isCloseOverATRLower = false;
|
isCloseOverAtrLower = false;
|
||||||
|
|
||||||
//
|
//
|
||||||
isCloseUnderATRUpper = false;
|
isCloseUnderAtrUpper = false;
|
||||||
isCloseUnderATRLower = false;
|
isCloseUnderAtrLower = false;
|
||||||
|
|
||||||
//
|
//
|
||||||
isRejectUpATRUpper = false;
|
isRejectUpAtrUpper = false;
|
||||||
isRejectDownATRUpper = false;
|
isRejectDownAtrUpper = false;
|
||||||
|
|
||||||
//
|
//
|
||||||
isRejectUpATRLower = false;
|
isRejectUpAtrLower = false;
|
||||||
isRejectDownATRLower = false;
|
isRejectDownAtrLower = false;
|
||||||
|
|
||||||
//
|
//
|
||||||
isBreakUpATRUpper = false;
|
isBreakUpAtrUpper = false;
|
||||||
isBreakDownATRUpper = false;
|
isBreakDownAtrUpper = false;
|
||||||
|
|
||||||
//
|
//
|
||||||
isBreakUpATRLower = false;
|
isBreakUpAtrLower = false;
|
||||||
isBreakDownATRLower = false;
|
isBreakDownAtrLower = false;
|
||||||
|
|
||||||
//
|
//
|
||||||
// XDON ...
|
// XDON ...
|
||||||
@@ -394,26 +394,26 @@ struct X121XATRConditions
|
|||||||
string conditionsStr =
|
string conditionsStr =
|
||||||
//
|
//
|
||||||
// RSI ...
|
// RSI ...
|
||||||
ToString("isRSIOverBought", isRSIOverBought, ignoreFalseConditions, separator) +
|
ToString("isRsiOverBought", isRsiOverBought, ignoreFalseConditions, separator) +
|
||||||
ToString("isRSICrossedOverOverBought", isRSICrossedOverOverBought, ignoreFalseConditions, separator) +
|
ToString("isRsiCrossedOverOverBought", isRsiCrossedOverOverBought, ignoreFalseConditions, separator) +
|
||||||
ToString("isRSICrossedUnderOverBought", isRSICrossedUnderOverBought, ignoreFalseConditions, separator) +
|
ToString("isRsiCrossedUnderOverBought", isRsiCrossedUnderOverBought, ignoreFalseConditions, separator) +
|
||||||
ToString("isRSIOverSold", isRSIOverSold, ignoreFalseConditions, separator) +
|
ToString("isRsiOverSold", isRsiOverSold, ignoreFalseConditions, separator) +
|
||||||
ToString("isRSICrossedUnderOverSold", isRSICrossedUnderOverSold, ignoreFalseConditions, separator) +
|
ToString("isRsiCrossedUnderOverSold", isRsiCrossedUnderOverSold, ignoreFalseConditions, separator) +
|
||||||
ToString("isRSICrossedOverOverSold", isRSICrossedOverOverSold, ignoreFalseConditions, separator) +
|
ToString("isRsiCrossedOverOverSold", isRsiCrossedOverOverSold, ignoreFalseConditions, separator) +
|
||||||
//
|
//
|
||||||
// ATR ...
|
// ATR ...
|
||||||
ToString("isCloseOverATRUpper", isCloseOverATRUpper, ignoreFalseConditions, separator) +
|
ToString("isCloseOverAtrUpper", isCloseOverAtrUpper, ignoreFalseConditions, separator) +
|
||||||
ToString("isCloseOverATRLower", isCloseOverATRLower, ignoreFalseConditions, separator) +
|
ToString("isCloseOverAtrLower", isCloseOverAtrLower, ignoreFalseConditions, separator) +
|
||||||
ToString("isCloseUnderATRUpper", isCloseUnderATRUpper, ignoreFalseConditions, separator) +
|
ToString("isCloseUnderAtrUpper", isCloseUnderAtrUpper, ignoreFalseConditions, separator) +
|
||||||
ToString("isCloseUnderATRLower", isCloseUnderATRLower, ignoreFalseConditions, separator) +
|
ToString("isCloseUnderAtrLower", isCloseUnderAtrLower, ignoreFalseConditions, separator) +
|
||||||
ToString("isRejectUpATRUpper", isRejectUpATRUpper, ignoreFalseConditions, separator) +
|
ToString("isRejectUpAtrUpper", isRejectUpAtrUpper, ignoreFalseConditions, separator) +
|
||||||
ToString("isRejectDownATRUpper", isRejectDownATRUpper, ignoreFalseConditions, separator) +
|
ToString("isRejectDownAtrUpper", isRejectDownAtrUpper, ignoreFalseConditions, separator) +
|
||||||
ToString("isRejectUpATRLower", isRejectUpATRLower, ignoreFalseConditions, separator) +
|
ToString("isRejectUpAtrLower", isRejectUpAtrLower, ignoreFalseConditions, separator) +
|
||||||
ToString("isRejectDownATRLower", isRejectDownATRLower, ignoreFalseConditions, separator) +
|
ToString("isRejectDownAtrLower", isRejectDownAtrLower, ignoreFalseConditions, separator) +
|
||||||
ToString("isBreakUpATRUpper", isBreakUpATRUpper, ignoreFalseConditions, separator) +
|
ToString("isBreakUpAtrUpper", isBreakUpAtrUpper, ignoreFalseConditions, separator) +
|
||||||
ToString("isBreakDownATRUpper", isBreakDownATRUpper, ignoreFalseConditions, separator) +
|
ToString("isBreakDownAtrUpper", isBreakDownAtrUpper, ignoreFalseConditions, separator) +
|
||||||
ToString("isBreakUpATRLower", isBreakUpATRLower, ignoreFalseConditions, separator) +
|
ToString("isBreakUpAtrLower", isBreakUpAtrLower, ignoreFalseConditions, separator) +
|
||||||
ToString("isBreakDownATRLower", isBreakDownATRLower, ignoreFalseConditions, separator) +
|
ToString("isBreakDownAtrLower", isBreakDownAtrLower, ignoreFalseConditions, separator) +
|
||||||
//
|
//
|
||||||
""
|
""
|
||||||
//
|
//
|
||||||
@@ -999,56 +999,56 @@ class XCX121XATRHelper : public XCBaseHelper
|
|||||||
// RSI ...
|
// RSI ...
|
||||||
|
|
||||||
//
|
//
|
||||||
bool isRSIOverBought = conditions.rsiBuffer[cIDX] > mInputs.rsiOverBoughtLevel;
|
bool isRsiOverBought = conditions.rsiBuffer[cIDX] > mInputs.rsiOverBoughtLevel;
|
||||||
bool isRSIOverBoughtPrev = conditions.rsiBuffer[pIDX] > mInputs.rsiOverBoughtLevel;
|
bool isRsiOverBoughtPrev = conditions.rsiBuffer[pIDX] > mInputs.rsiOverBoughtLevel;
|
||||||
|
|
||||||
//
|
//
|
||||||
bool isRSICrossedOverOverBought = isRSIOverBought &&
|
bool isRsiCrossedOverOverBought = isRsiOverBought &&
|
||||||
!isRSIOverBoughtPrev;
|
!isRsiOverBoughtPrev;
|
||||||
bool isRSICrossedUnderOverBought = !isRSIOverBought &&
|
bool isRsiCrossedUnderOverBought = !isRsiOverBought &&
|
||||||
isRSIOverBoughtPrev;
|
isRsiOverBoughtPrev;
|
||||||
|
|
||||||
//
|
//
|
||||||
bool isRSIOverSold = conditions.rsiBuffer[cIDX] < mInputs.rsiOverSoldLevel;
|
bool isRsiOverSold = conditions.rsiBuffer[cIDX] < mInputs.rsiOverSoldLevel;
|
||||||
bool isRSIOverSoldPrev = conditions.rsiBuffer[pIDX] < mInputs.rsiOverSoldLevel;
|
bool isRsiOverSoldPrev = conditions.rsiBuffer[pIDX] < mInputs.rsiOverSoldLevel;
|
||||||
|
|
||||||
//
|
//
|
||||||
bool isRSICrossedUnderOverSold = isRSIOverSold &&
|
bool isRsiCrossedUnderOverSold = isRsiOverSold &&
|
||||||
!isRSIOverSoldPrev;
|
!isRsiOverSoldPrev;
|
||||||
bool isRSICrossedOverOverSold = !isRSIOverSold &&
|
bool isRsiCrossedOverOverSold = !isRsiOverSold &&
|
||||||
isRSIOverSoldPrev;
|
isRsiOverSoldPrev;
|
||||||
|
|
||||||
//
|
//
|
||||||
// ATR ...
|
// ATR ...
|
||||||
|
|
||||||
//
|
//
|
||||||
bool isCloseOverATRUpper = cBar.close > conditions.atrUpperBuffer[cIDX];
|
bool isCloseOverAtrUpper = cBar.close > conditions.atrUpperBuffer[cIDX];
|
||||||
bool isCloseOverATRLower = cBar.close > conditions.atrLowerBuffer[cIDX];
|
bool isCloseOverAtrLower = cBar.close > conditions.atrLowerBuffer[cIDX];
|
||||||
|
|
||||||
//
|
//
|
||||||
bool isCloseUnderATRUpper = cBar.close < conditions.atrUpperBuffer[cIDX];
|
bool isCloseUnderAtrUpper = cBar.close < conditions.atrUpperBuffer[cIDX];
|
||||||
bool isCloseUnderATRLower = cBar.close < conditions.atrLowerBuffer[cIDX];
|
bool isCloseUnderAtrLower = cBar.close < conditions.atrLowerBuffer[cIDX];
|
||||||
|
|
||||||
//
|
//
|
||||||
bool isRejectUpATRUpper = IsBarReject(
|
bool isRejectUpAtrUpper = IsBarReject(
|
||||||
atrUpperBuffer[cIDX],
|
atrUpperBuffer[cIDX],
|
||||||
X_DIRECTION_BULLISH,
|
X_DIRECTION_BULLISH,
|
||||||
cBar //
|
cBar //
|
||||||
);
|
);
|
||||||
bool isRejectDownATRUpper = IsBarReject(
|
bool isRejectDownAtrUpper = IsBarReject(
|
||||||
atrUpperBuffer[cIDX],
|
atrUpperBuffer[cIDX],
|
||||||
X_DIRECTION_BEARISH,
|
X_DIRECTION_BEARISH,
|
||||||
cBar //
|
cBar //
|
||||||
);
|
);
|
||||||
|
|
||||||
//
|
//
|
||||||
bool isRejectUpATRLower = IsBarReject(
|
bool isRejectUpAtrLower = IsBarReject(
|
||||||
atrLowerBuffer[cIDX],
|
atrLowerBuffer[cIDX],
|
||||||
X_DIRECTION_BULLISH,
|
X_DIRECTION_BULLISH,
|
||||||
cBar //
|
cBar //
|
||||||
);
|
);
|
||||||
;
|
;
|
||||||
bool isRejectDownATRLower = IsBarReject(
|
bool isRejectDownAtrLower = IsBarReject(
|
||||||
atrLowerBuffer[cIDX],
|
atrLowerBuffer[cIDX],
|
||||||
X_DIRECTION_BEARISH,
|
X_DIRECTION_BEARISH,
|
||||||
cBar //
|
cBar //
|
||||||
@@ -1056,48 +1056,48 @@ class XCX121XATRHelper : public XCBaseHelper
|
|||||||
;
|
;
|
||||||
|
|
||||||
//
|
//
|
||||||
bool isBreakUpATRUpper = IsBarBreak(
|
bool isBreakUpAtrUpper = IsBarBreak(
|
||||||
atrUpperBuffer[cIDX],
|
atrUpperBuffer[cIDX],
|
||||||
X_DIRECTION_BULLISH,
|
X_DIRECTION_BULLISH,
|
||||||
cBar //
|
cBar //
|
||||||
);
|
);
|
||||||
bool isBreakDownATRUpper = IsBarBreak(
|
bool isBreakDownAtrUpper = IsBarBreak(
|
||||||
atrUpperBuffer[cIDX],
|
atrUpperBuffer[cIDX],
|
||||||
X_DIRECTION_BEARISH,
|
X_DIRECTION_BEARISH,
|
||||||
cBar //
|
cBar //
|
||||||
);
|
);
|
||||||
|
|
||||||
//
|
//
|
||||||
bool isBreakUpATRLower = IsBarBreak(
|
bool isBreakUpAtrLower = IsBarBreak(
|
||||||
atrLowerBuffer[cIDX],
|
atrLowerBuffer[cIDX],
|
||||||
X_DIRECTION_BULLISH,
|
X_DIRECTION_BULLISH,
|
||||||
cBar //
|
cBar //
|
||||||
);
|
);
|
||||||
bool isBreakDownATRLower = IsBarBreak(
|
bool isBreakDownAtrLower = IsBarBreak(
|
||||||
atrLowerBuffer[cIDX],
|
atrLowerBuffer[cIDX],
|
||||||
X_DIRECTION_BEARISH,
|
X_DIRECTION_BEARISH,
|
||||||
cBar //
|
cBar //
|
||||||
);
|
);
|
||||||
|
|
||||||
//
|
//
|
||||||
conditions.isRSIOverSold = isRSIOverSold;
|
conditions.isRsiOverSold = isRsiOverSold;
|
||||||
conditions.isRSIOverBought = isRSIOverBought;
|
conditions.isRsiOverBought = isRsiOverBought;
|
||||||
conditions.isRejectUpATRUpper = isRejectUpATRUpper;
|
conditions.isRejectUpAtrUpper = isRejectUpAtrUpper;
|
||||||
conditions.isRejectUpATRLower = isRejectUpATRLower;
|
conditions.isRejectUpAtrLower = isRejectUpAtrLower;
|
||||||
conditions.isBreakUpATRUpper = isBreakUpATRUpper;
|
conditions.isBreakUpAtrUpper = isBreakUpAtrUpper;
|
||||||
conditions.isBreakUpATRLower = isBreakUpATRLower;
|
conditions.isBreakUpAtrLower = isBreakUpAtrLower;
|
||||||
conditions.isRejectDownATRUpper = isRejectDownATRUpper;
|
conditions.isRejectDownAtrUpper = isRejectDownAtrUpper;
|
||||||
conditions.isRejectDownATRLower = isRejectDownATRLower;
|
conditions.isRejectDownAtrLower = isRejectDownAtrLower;
|
||||||
conditions.isCloseOverATRUpper = isCloseOverATRUpper;
|
conditions.isCloseOverAtrUpper = isCloseOverAtrUpper;
|
||||||
conditions.isCloseOverATRLower = isCloseOverATRLower;
|
conditions.isCloseOverAtrLower = isCloseOverAtrLower;
|
||||||
conditions.isBreakDownATRUpper = isBreakDownATRUpper;
|
conditions.isBreakDownAtrUpper = isBreakDownAtrUpper;
|
||||||
conditions.isBreakDownATRLower = isBreakDownATRLower;
|
conditions.isBreakDownAtrLower = isBreakDownAtrLower;
|
||||||
conditions.isCloseUnderATRUpper = isCloseUnderATRUpper;
|
conditions.isCloseUnderAtrUpper = isCloseUnderAtrUpper;
|
||||||
conditions.isCloseUnderATRLower = isCloseUnderATRLower;
|
conditions.isCloseUnderAtrLower = isCloseUnderAtrLower;
|
||||||
conditions.isRSICrossedOverOverSold = isRSICrossedOverOverSold;
|
conditions.isRsiCrossedOverOverSold = isRsiCrossedOverOverSold;
|
||||||
conditions.isRSICrossedUnderOverSold = isRSICrossedUnderOverSold;
|
conditions.isRsiCrossedUnderOverSold = isRsiCrossedUnderOverSold;
|
||||||
conditions.isRSICrossedOverOverBought = isRSICrossedOverOverBought;
|
conditions.isRsiCrossedOverOverBought = isRsiCrossedOverOverBought;
|
||||||
conditions.isRSICrossedUnderOverBought = isRSICrossedUnderOverBought;
|
conditions.isRsiCrossedUnderOverBought = isRsiCrossedUnderOverBought;
|
||||||
|
|
||||||
//
|
//
|
||||||
return result;
|
return result;
|
||||||
|
|||||||
@@ -743,6 +743,59 @@ class XCX121XSTRHelper : public XCBaseHelper
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
double GetLastSTR(
|
||||||
|
ENUM_X_DIRECTION dir,
|
||||||
|
int barIndex = 0 //
|
||||||
|
)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
double result = 0;
|
||||||
|
|
||||||
|
//
|
||||||
|
if (barIndex < 0)
|
||||||
|
{
|
||||||
|
barIndex = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
if (!HasDirection(dir))
|
||||||
|
{
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
int index = barIndex;
|
||||||
|
bool isBullish = IsBullish(dir);
|
||||||
|
|
||||||
|
//
|
||||||
|
bool canContinue = true;
|
||||||
|
while (canContinue)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
double iStr = GetSTR(index);
|
||||||
|
double iState = GetSTRState(index);
|
||||||
|
|
||||||
|
//
|
||||||
|
canContinue =
|
||||||
|
isBullish
|
||||||
|
? iState < 0
|
||||||
|
: iState > 0;
|
||||||
|
if (!canContinue)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
result = iStr;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
index++;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
bool GetConditions(
|
bool GetConditions(
|
||||||
X121XSTRConditions &conditions, //
|
X121XSTRConditions &conditions, //
|
||||||
|
|||||||
@@ -676,12 +676,12 @@ bool DetectX121SMCXOBGPVSiganlTrigger(
|
|||||||
double isNewDecisionVale = decisionConditions.x121Conditions.isNewVale;
|
double isNewDecisionVale = decisionConditions.x121Conditions.isNewVale;
|
||||||
|
|
||||||
//
|
//
|
||||||
bool isTriggerRSICrossedOverOverSold = triggerConditions.x121Conditions.isRSICrossedOverOverSold;
|
bool isTriggerRSICrossedOverOverSold = triggerConditions.x121Conditions.isRsiCrossedOverOverSold;
|
||||||
bool isTriggerRSICrossedUnderOverBought = triggerConditions.x121Conditions.isRSICrossedUnderOverBought;
|
bool isTriggerRSICrossedUnderOverBought = triggerConditions.x121Conditions.isRsiCrossedUnderOverBought;
|
||||||
|
|
||||||
//
|
//
|
||||||
bool isDecisionRSICrossedOverOverSold = decisionConditions.x121Conditions.isRSICrossedOverOverSold;
|
bool isDecisionRSICrossedOverOverSold = decisionConditions.x121Conditions.isRsiCrossedOverOverSold;
|
||||||
bool isDecisionRSICrossedUnderOverBought = decisionConditions.x121Conditions.isRSICrossedUnderOverBought;
|
bool isDecisionRSICrossedUnderOverBought = decisionConditions.x121Conditions.isRsiCrossedUnderOverBought;
|
||||||
|
|
||||||
//
|
//
|
||||||
// Waits For Price to Go Inside FVG ...
|
// Waits For Price to Go Inside FVG ...
|
||||||
|
|||||||
@@ -50,6 +50,7 @@ struct X121SMCStrategyXOBSPVSignalConditions
|
|||||||
|
|
||||||
//
|
//
|
||||||
double pivot;
|
double pivot;
|
||||||
|
XPriceZones priceZone;
|
||||||
|
|
||||||
//
|
//
|
||||||
// Constructor ...
|
// Constructor ...
|
||||||
@@ -167,6 +168,9 @@ struct X121SMCStrategyXOBSPVSignalConditions
|
|||||||
{
|
{
|
||||||
//
|
//
|
||||||
pivot = 0;
|
pivot = 0;
|
||||||
|
|
||||||
|
//
|
||||||
|
priceZone.Clean();
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
@@ -408,169 +412,213 @@ bool DetectX121SMCXOBSPVSiganlSetup(
|
|||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
bool isStrSwitchedToBullish = analyseConditions.x121Conditions.isStrSwitchedToBullish;
|
double decisionPeak = decisionConditions.x121Conditions.peaksBuffer[1];
|
||||||
bool isStrSwitchedToBearish = analyseConditions.x121Conditions.isStrSwitchedToBearish;
|
double decisionVale = decisionConditions.x121Conditions.valesBuffer[1];
|
||||||
|
|
||||||
//
|
//
|
||||||
if (isStrSwitchedToBullish ||
|
// Find Price Inside Zone ...
|
||||||
isStrSwitchedToBearish)
|
XPriceZones priceZone = conditions.priceZone;
|
||||||
|
bool hasPriceZones = conditions.priceZone.IsValid();
|
||||||
|
if (!hasPriceZones)
|
||||||
{
|
{
|
||||||
Print("Str State Changed ...");
|
//
|
||||||
|
hasPriceZones = CalculatePriceInsideZones(
|
||||||
|
priceZone,
|
||||||
|
analyseState,
|
||||||
|
cBar //
|
||||||
|
);
|
||||||
|
|
||||||
|
//
|
||||||
|
if (hasPriceZones)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
// Validate Price Zone ...
|
||||||
|
double upper = 0;
|
||||||
|
double lower = 0;
|
||||||
|
hasPriceZones = priceZone.GetBoundary(
|
||||||
|
X_DIRECTION_ALL,
|
||||||
|
upper,
|
||||||
|
lower //
|
||||||
|
);
|
||||||
|
result = hasPriceZones;
|
||||||
|
if (!result)
|
||||||
|
{
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
bool isValid = decisionPeak <= upper ||
|
||||||
|
decisionVale >= lower;
|
||||||
|
hasPriceZones = isValid;
|
||||||
|
result = hasPriceZones;
|
||||||
|
if (!result)
|
||||||
|
{
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
conditions.priceZone = priceZone;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
X121SMCCycleConditions conditionState = consolidationConditions;
|
// Detect Str Change Direction ...
|
||||||
X121SMCCycleConditions conditionStatePrev = consolidationConditionsPrev;
|
|
||||||
|
|
||||||
//
|
//
|
||||||
XOHCL cCBar;
|
bool isDecisionSarBullish = decisionConditions.x121Conditions.isSarBullish;
|
||||||
result = cCBar.Init(
|
bool isDecisionSarBearish = decisionConditions.x121Conditions.isSarBearish;
|
||||||
conditionState.symbol,
|
|
||||||
conditionState.period,
|
|
||||||
cIndex //
|
|
||||||
);
|
|
||||||
if (!result)
|
|
||||||
{
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
//
|
||||||
XOHCL cPBar;
|
bool isDecisionStrBullish = decisionConditions.x121Conditions.isStrBullish;
|
||||||
result = cCBar.GetPreviousBar(cPBar);
|
bool isDecisionStrBearish = decisionConditions.x121Conditions.isStrBearish;
|
||||||
if (!result)
|
|
||||||
{
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Engulf ...
|
bool isDecisionSarCrossedOverVale = decisionConditions.x121Conditions.isSarCrossedOverVale;
|
||||||
ENUM_X_DIRECTION cCBarEngulfDir;
|
bool isDecisionSarCrossedUnderPeak = decisionConditions.x121Conditions.isSarCrossedUnderPeak;
|
||||||
bool isCCBarEngulfed = consolidationCycleHelper
|
|
||||||
.mBarAnalyser
|
|
||||||
.IsEngulfBar(
|
|
||||||
cCBar,
|
|
||||||
cCBarEngulfDir,
|
|
||||||
0 // Extended ...
|
|
||||||
);
|
|
||||||
bool isCCBarBullishEngulfed =
|
|
||||||
isCCBarEngulfed &&
|
|
||||||
IsBullish(cCBarEngulfDir);
|
|
||||||
bool isCCBarBearishEngulfed =
|
|
||||||
isCCBarEngulfed &&
|
|
||||||
IsBearish(cCBarEngulfDir);
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Momentum ...
|
bool isDecisionStrCrossedOverVale = decisionConditions.x121Conditions.isStrCrossedOverVale;
|
||||||
ENUM_X_DIRECTION cCBarMomentumDir;
|
bool isDecisionStrCrossedUnderPeak = decisionConditions.x121Conditions.isStrCrossedUnderPeak;
|
||||||
bool isCCBarMomentum = consolidationCycleHelper
|
|
||||||
.mBarAnalyser
|
|
||||||
.IsMomentumBar(
|
|
||||||
cCBar,
|
|
||||||
cCBarMomentumDir,
|
|
||||||
1 // Extended ...
|
|
||||||
);
|
|
||||||
bool isCCBarBullishMomentum =
|
|
||||||
isCCBarMomentum &&
|
|
||||||
IsBullish(cCBarMomentumDir);
|
|
||||||
bool isCCBarBearishMomentum =
|
|
||||||
isCCBarMomentum &&
|
|
||||||
IsBearish(cCBarMomentumDir);
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Reject ...
|
bool isDecisionPeakOverAtrUpper = decisionConditions.x121Conditions.isPeakOverAtrUpper;
|
||||||
ENUM_X_DIRECTION cCBarRejectDir;
|
bool isDecisionValeUnderAtrLower = decisionConditions.x121Conditions.isValeUnderAtrLower;
|
||||||
bool isCCBarRejected = consolidationCycleHelper
|
|
||||||
.mBarAnalyser
|
|
||||||
.IsRejectionBar(
|
|
||||||
cCBar,
|
|
||||||
cCBarRejectDir,
|
|
||||||
1 // Extended ...
|
|
||||||
);
|
|
||||||
bool isCCBarBullishRejected =
|
|
||||||
isCCBarRejected &&
|
|
||||||
IsBullish(cCBarRejectDir);
|
|
||||||
bool isCCBarBearishRejected =
|
|
||||||
isCCBarRejected &&
|
|
||||||
IsBearish(cCBarRejectDir);
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Bar Checking Summary ...
|
bool isDecisionVWapBullishState = decisionConditions.x121Conditions.isVWapBullishState;
|
||||||
|
bool isDecisionVWapSwitchedToBullishState = decisionConditions.x121Conditions.isVWapSwitchedToBullishState;
|
||||||
|
|
||||||
//
|
//
|
||||||
// Bullish ...
|
bool isDecisionVWapBullishOrdered = decisionConditions.x121Conditions.isVWapBullishOrdered;
|
||||||
bool isCCBarPassedBullish =
|
bool isDecisionVWapSwitchedToBullishOrdered = decisionConditions.x121Conditions.isVWapSwitchedToBullishOrdered;
|
||||||
//
|
|
||||||
isCCBarBullishEngulfed ||
|
|
||||||
isCCBarBullishMomentum ||
|
|
||||||
isCCBarBullishRejected
|
|
||||||
//
|
|
||||||
;
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Bearish ...
|
bool isDecisionVWapBearishState = decisionConditions.x121Conditions.isVWapBearishState;
|
||||||
bool isCCBarPassedBearish =
|
bool isDecisionVWapSwitchedToBearishState = decisionConditions.x121Conditions.isVWapSwitchedToBearishState;
|
||||||
//
|
|
||||||
isCCBarBearishEngulfed ||
|
|
||||||
isCCBarBearishMomentum ||
|
|
||||||
isCCBarBearishRejected
|
|
||||||
//
|
|
||||||
;
|
|
||||||
|
|
||||||
//
|
//
|
||||||
double cPeakPrev = conditionStatePrev.x121Conditions.peaksBuffer[0];
|
bool isDecisionVWapBearishOrdered = decisionConditions.x121Conditions.isVWapBearishOrdered;
|
||||||
double cValePrev = conditionStatePrev.x121Conditions.valesBuffer[0];
|
bool isDecisionVWapSwitchedToBearishOrdered = decisionConditions.x121Conditions.isVWapSwitchedToBearishOrdered;
|
||||||
|
|
||||||
//
|
//
|
||||||
double cPeak = conditionState.x121Conditions.peaksBuffer[1];
|
bool isDecisionStrUpperOverPeak = decisionConditions.x121Conditions.isStrUpperOverPeak;
|
||||||
double cVale = conditionState.x121Conditions.valesBuffer[1];
|
bool isDecisionStrLowerOverVale = decisionConditions.x121Conditions.isStrLowerOverVale;
|
||||||
|
|
||||||
//
|
//
|
||||||
bool isCPeakSame = cPeak == cPeakPrev;
|
bool isDecisionStrUpperUnderPeak = decisionConditions.x121Conditions.isStrUpperUnderPeak;
|
||||||
bool isCValeSame = cVale == cValePrev;
|
bool isDecisionStrLowerUnderVale = decisionConditions.x121Conditions.isStrLowerUnderVale;
|
||||||
|
|
||||||
//
|
//
|
||||||
bool isCNewPeakPrev = conditionStatePrev.x121Conditions.isNewPeak;
|
bool isDecisionDonLowUpperLesserThanDonCloseUpper =
|
||||||
bool isCNewPeakOverLastPrev = conditionStatePrev.x121Conditions.isNewPeakOverLast;
|
decisionConditions.x121Conditions.donLowUpperBuffer[1] <
|
||||||
bool isCNewPeakUnderLastPrev = conditionStatePrev.x121Conditions.isNewPeakUnderLast;
|
decisionConditions.x121Conditions.donCloseUpperBuffer[1];
|
||||||
|
|
||||||
//
|
//
|
||||||
bool isCNewValePrev = conditionStatePrev.x121Conditions.isNewVale;
|
bool isDecisionDonHighLowerGreaterThanDonCloseLower =
|
||||||
bool isCNewValeOverLastPrev = conditionStatePrev.x121Conditions.isNewValeOverLast;
|
decisionConditions.x121Conditions.donHighLowerBuffer[1] <
|
||||||
bool isCNewValeUnderLastPrev = conditionStatePrev.x121Conditions.isNewValeUnderLast;
|
decisionConditions.x121Conditions.donCloseLowerBuffer[1];
|
||||||
|
|
||||||
//
|
//
|
||||||
bool isCRSIOverSold = conditionState.x121Conditions.isRSIOverSold;
|
// Summarize Conditions ...
|
||||||
bool isCRSICrossedOverOverSold = conditionState.x121Conditions.isRSICrossedOverOverSold;
|
|
||||||
bool isCRSICrossedUnderOverSold = conditionState.x121Conditions.isRSICrossedUnderOverSold;
|
|
||||||
|
|
||||||
//
|
|
||||||
bool isCRSIOverBought = conditionState.x121Conditions.isRSIOverBought;
|
|
||||||
bool isCRSICrossedOverOverBought = conditionState.x121Conditions.isRSICrossedOverOverBought;
|
|
||||||
bool isCRSICrossedUnderOverBought = conditionState.x121Conditions.isRSICrossedUnderOverBought;
|
|
||||||
|
|
||||||
//
|
|
||||||
bool isCRSIOverSoldPrev = conditionStatePrev.x121Conditions.isRSIOverSold;
|
|
||||||
bool isCRSICrossedOverOverSoldPrev = conditionStatePrev.x121Conditions.isRSICrossedOverOverSold;
|
|
||||||
bool isCRSICrossedUnderOverSoldPrev = conditionStatePrev.x121Conditions.isRSICrossedUnderOverSold;
|
|
||||||
|
|
||||||
//
|
|
||||||
bool isCRSIOverBoughtPrev = conditionStatePrev.x121Conditions.isRSIOverBought;
|
|
||||||
bool isCRSICrossedOverOverBoughtPrev = conditionStatePrev.x121Conditions.isRSICrossedOverOverBought;
|
|
||||||
bool isCRSICrossedUnderOverBoughtPrev = conditionStatePrev.x121Conditions.isRSICrossedUnderOverBought;
|
|
||||||
|
|
||||||
//
|
//
|
||||||
isBullish =
|
isBullish =
|
||||||
//
|
//
|
||||||
isCNewValePrev &&
|
isDecisionValeUnderAtrLower
|
||||||
isCCBarPassedBullish
|
//
|
||||||
|
&&
|
||||||
|
//
|
||||||
|
isDecisionDonHighLowerGreaterThanDonCloseLower
|
||||||
|
//
|
||||||
|
&&
|
||||||
|
//
|
||||||
|
(
|
||||||
|
//
|
||||||
|
isDecisionVWapBullishState ||
|
||||||
|
isDecisionVWapBullishOrdered
|
||||||
|
//
|
||||||
|
)
|
||||||
|
//
|
||||||
|
&&
|
||||||
|
//
|
||||||
|
(
|
||||||
|
//
|
||||||
|
isDecisionStrUpperOverPeak ||
|
||||||
|
isDecisionStrLowerOverVale
|
||||||
|
//
|
||||||
|
)
|
||||||
|
//
|
||||||
|
&&
|
||||||
|
//
|
||||||
|
(
|
||||||
|
//
|
||||||
|
(
|
||||||
|
//
|
||||||
|
isDecisionStrBullish &&
|
||||||
|
isDecisionSarCrossedOverVale
|
||||||
|
//
|
||||||
|
)
|
||||||
|
//
|
||||||
|
||
|
||||||
|
//
|
||||||
|
(
|
||||||
|
//
|
||||||
|
isDecisionSarBullish &&
|
||||||
|
isDecisionStrCrossedOverVale
|
||||||
|
//
|
||||||
|
)
|
||||||
|
//
|
||||||
|
)
|
||||||
//
|
//
|
||||||
;
|
;
|
||||||
|
|
||||||
//
|
//
|
||||||
isBearish =
|
isBearish =
|
||||||
//
|
//
|
||||||
isCNewPeakPrev &&
|
isDecisionPeakOverAtrUpper
|
||||||
isCCBarPassedBearish
|
//
|
||||||
|
&&
|
||||||
|
//
|
||||||
|
isDecisionDonLowUpperLesserThanDonCloseUpper
|
||||||
|
//
|
||||||
|
&&
|
||||||
|
//
|
||||||
|
(
|
||||||
|
//
|
||||||
|
isDecisionVWapBearishState ||
|
||||||
|
isDecisionVWapBearishOrdered
|
||||||
|
//
|
||||||
|
)
|
||||||
|
//
|
||||||
|
&&
|
||||||
|
//
|
||||||
|
(
|
||||||
|
//
|
||||||
|
isDecisionStrUpperUnderPeak ||
|
||||||
|
isDecisionStrLowerUnderVale
|
||||||
|
//
|
||||||
|
)
|
||||||
|
//
|
||||||
|
&&
|
||||||
|
//
|
||||||
|
(
|
||||||
|
//
|
||||||
|
(
|
||||||
|
//
|
||||||
|
isDecisionStrBearish &&
|
||||||
|
isDecisionSarCrossedUnderPeak
|
||||||
|
//
|
||||||
|
)
|
||||||
|
//
|
||||||
|
||
|
||||||
|
//
|
||||||
|
(
|
||||||
|
//
|
||||||
|
isDecisionSarBearish &&
|
||||||
|
isDecisionStrCrossedUnderPeak //
|
||||||
|
)
|
||||||
|
//
|
||||||
|
)
|
||||||
//
|
//
|
||||||
;
|
;
|
||||||
|
|
||||||
@@ -582,12 +630,6 @@ bool DetectX121SMCXOBSPVSiganlSetup(
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
|
||||||
conditions.pivot =
|
|
||||||
isBullish
|
|
||||||
? conditionState.x121Conditions.valesBuffer[1]
|
|
||||||
: conditionState.x121Conditions.peaksBuffer[1];
|
|
||||||
|
|
||||||
//
|
//
|
||||||
conditions.setupTime = cTime;
|
conditions.setupTime = cTime;
|
||||||
conditions.dir =
|
conditions.dir =
|
||||||
@@ -615,7 +657,7 @@ bool DetectX121SMCXOBSPVSiganlTrigger(
|
|||||||
XC121SMCCycleHelper *consolidationCycleHelper,
|
XC121SMCCycleHelper *consolidationCycleHelper,
|
||||||
XC121SMCCycleHelper *visionCycleHelper,
|
XC121SMCCycleHelper *visionCycleHelper,
|
||||||
//
|
//
|
||||||
int maxAllowedSetupAge = 576 //
|
int maxAllowedSetupAge = 60 //
|
||||||
//
|
//
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
@@ -817,25 +859,29 @@ bool DetectX121SMCXOBSPVSiganlTrigger(
|
|||||||
// Trigger Conditions ...
|
// Trigger Conditions ...
|
||||||
|
|
||||||
//
|
//
|
||||||
// Looking for STR Direction Change ...
|
double decisionLastBullishStr = decisionCycleHelper.mX121Helper.xstrHelper.GetLastSTR(X_DIRECTION_BULLISH);
|
||||||
|
double decisionLastBearishStr = decisionCycleHelper.mX121Helper.xstrHelper.GetLastSTR(X_DIRECTION_BEARISH);
|
||||||
|
|
||||||
//
|
//
|
||||||
bool isStrSwitchedToBullish = analyseConditions.x121Conditions.isStrSwitchedToBullish;
|
bool isDecisionLastBearishStrBreakedUp = IsBarBreak(
|
||||||
bool isStrSwitchedToBearish = analyseConditions.x121Conditions.isStrSwitchedToBearish;
|
decisionLastBearishStr,
|
||||||
|
X_DIRECTION_BULLISH,
|
||||||
|
cBar //
|
||||||
|
);
|
||||||
|
|
||||||
//
|
//
|
||||||
result = isStrSwitchedToBullish ||
|
bool isDecisionLastBullishStrBreakedDown = IsBarBreak(
|
||||||
isStrSwitchedToBearish;
|
decisionLastBullishStr,
|
||||||
if (!result)
|
X_DIRECTION_BEARISH,
|
||||||
{
|
cBar //
|
||||||
return result;
|
);
|
||||||
}
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Detect Bullish Conditions ...
|
// Detect Bullish Conditions ...
|
||||||
isBullish =
|
isBullish =
|
||||||
//
|
//
|
||||||
false
|
isBullish &&
|
||||||
|
isDecisionLastBearishStrBreakedUp
|
||||||
//
|
//
|
||||||
;
|
;
|
||||||
|
|
||||||
@@ -843,7 +889,8 @@ bool DetectX121SMCXOBSPVSiganlTrigger(
|
|||||||
// Detect Bearish Conditions ...
|
// Detect Bearish Conditions ...
|
||||||
isBearish =
|
isBearish =
|
||||||
//
|
//
|
||||||
false
|
isBearish &&
|
||||||
|
isDecisionLastBullishStrBreakedDown
|
||||||
//
|
//
|
||||||
;
|
;
|
||||||
|
|
||||||
@@ -854,6 +901,13 @@ bool DetectX121SMCXOBSPVSiganlTrigger(
|
|||||||
{
|
{
|
||||||
//
|
//
|
||||||
// Cleanup Setup Conditions ...
|
// Cleanup Setup Conditions ...
|
||||||
|
int setupAge = conditions.GetSetupAge();
|
||||||
|
if (IsValidSize(setupAge) &&
|
||||||
|
IsValidSize(maxAllowedSetupAge) &&
|
||||||
|
setupAge >= maxAllowedSetupAge)
|
||||||
|
{
|
||||||
|
conditions.Clean();
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
return result;
|
return result;
|
||||||
@@ -899,15 +953,15 @@ bool DetectX121SMCXOBSPVSiganlTrigger(
|
|||||||
double sls[];
|
double sls[];
|
||||||
|
|
||||||
//
|
//
|
||||||
double atr = triggerConditions.x121Conditions.atrBuffer[1];
|
double iAtr = triggerConditions.x121Conditions.atrBuffer[1];
|
||||||
double peak = triggerConditions.x121Conditions.peaksBuffer[1];
|
double iPeak = triggerConditions.x121Conditions.peaksBuffer[1];
|
||||||
double vale = triggerConditions.x121Conditions.valesBuffer[1];
|
double iVale = triggerConditions.x121Conditions.valesBuffer[1];
|
||||||
|
|
||||||
//
|
//
|
||||||
if (isBullish)
|
if (isBullish)
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
double lowerVale = triggerCycleHelper.mX121Helper.xpvHelper.GetLowerVale(vale);
|
double lowerVale = triggerCycleHelper.mX121Helper.xpvHelper.GetLowerVale(iVale);
|
||||||
if (lowerVale > 0)
|
if (lowerVale > 0)
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
@@ -919,14 +973,14 @@ bool DetectX121SMCXOBSPVSiganlTrigger(
|
|||||||
|
|
||||||
//
|
//
|
||||||
Add(
|
Add(
|
||||||
vale,
|
iVale,
|
||||||
sls //
|
sls //
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
else if (isBearish)
|
else if (isBearish)
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
double higherPeak = triggerCycleHelper.mX121Helper.xpvHelper.GetHigherPeak(peak);
|
double higherPeak = triggerCycleHelper.mX121Helper.xpvHelper.GetHigherPeak(iPeak);
|
||||||
if (higherPeak > 0)
|
if (higherPeak > 0)
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
@@ -938,7 +992,7 @@ bool DetectX121SMCXOBSPVSiganlTrigger(
|
|||||||
|
|
||||||
//
|
//
|
||||||
Add(
|
Add(
|
||||||
peak,
|
iPeak,
|
||||||
sls //
|
sls //
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -949,8 +1003,8 @@ bool DetectX121SMCXOBSPVSiganlTrigger(
|
|||||||
|
|
||||||
//
|
//
|
||||||
double sl = isBullish
|
double sl = isBullish
|
||||||
? slsMin - atr
|
? slsMin - iAtr
|
||||||
: slsMax + atr;
|
: slsMax + iAtr;
|
||||||
double risk = MathAbs(entry - sl);
|
double risk = MathAbs(entry - sl);
|
||||||
double targetDelta = 2 * (risk / 3);
|
double targetDelta = 2 * (risk / 3);
|
||||||
if (target == 0)
|
if (target == 0)
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -185,7 +185,7 @@ class XCX121SMCStrategy : public XCX121SMCBaseStrategy
|
|||||||
|
|
||||||
//
|
//
|
||||||
bool useTestSignal = false;
|
bool useTestSignal = false;
|
||||||
bool useXOBGPVSignal = false;
|
bool useXOBGPVSignal = true;
|
||||||
bool useXOBSPVSignal = true;
|
bool useXOBSPVSignal = true;
|
||||||
|
|
||||||
//
|
//
|
||||||
@@ -874,58 +874,6 @@ class XCX121SMCStrategy : public XCX121SMCBaseStrategy
|
|||||||
X121SMCStrategyXOBSPVSignalConditions mConditions;
|
X121SMCStrategyXOBSPVSignalConditions mConditions;
|
||||||
for (int i = 0; i < conditionsCount; i++)
|
for (int i = 0; i < conditionsCount; i++)
|
||||||
{
|
{
|
||||||
//
|
|
||||||
// Update Conditions ...
|
|
||||||
// mTmpConditions[i].UpdateOrderBlocks();
|
|
||||||
|
|
||||||
//
|
|
||||||
// Retrieve Required Data ...
|
|
||||||
// ENUM_X_DIRECTION iDir = mTmpConditions[i].dir;
|
|
||||||
// bool isIBullish = IsBullish(iDir);
|
|
||||||
// double iUpper = 0;
|
|
||||||
// double iLower = 0;
|
|
||||||
// bool iHasBoundary = mTmpConditions[i].fvgOB.GetBoundary(
|
|
||||||
// iUpper,
|
|
||||||
// iLower //
|
|
||||||
// );
|
|
||||||
// if (!iHasBoundary)
|
|
||||||
// {
|
|
||||||
// continue;
|
|
||||||
// }
|
|
||||||
|
|
||||||
//
|
|
||||||
// Draw Conditions ...
|
|
||||||
|
|
||||||
//
|
|
||||||
// XFVGOrderBlock iFVGOB = mTmpConditions[i].fvgOB;
|
|
||||||
// XCBaseObject *drawnObjects[];
|
|
||||||
// mPOIDrawer.DrawFVGOrderBlock(
|
|
||||||
// iFVGOB,
|
|
||||||
// drawnObjects //
|
|
||||||
// );
|
|
||||||
// AddObjectsIfNotExists(drawnObjects);
|
|
||||||
|
|
||||||
//
|
|
||||||
// Check Broken Order Blocks and Remove them ...
|
|
||||||
// bool isBreaked =
|
|
||||||
// isBullish
|
|
||||||
// ? (cBar.high < iLower ||
|
|
||||||
// pBar.high < iLower)
|
|
||||||
// : (cBar.low > iUpper ||
|
|
||||||
// cBar.low > iUpper);
|
|
||||||
// if (isBreaked)
|
|
||||||
// {
|
|
||||||
// //
|
|
||||||
// ArrayRemove(
|
|
||||||
// mXOBSPVConditionsCollection,
|
|
||||||
// i,
|
|
||||||
// 1 //
|
|
||||||
// );
|
|
||||||
|
|
||||||
// //
|
|
||||||
// continue;
|
|
||||||
// }
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Check Triggers ...
|
// Check Triggers ...
|
||||||
bool canTrigger = mTmpConditions[i].CanTrigger();
|
bool canTrigger = mTmpConditions[i].CanTrigger();
|
||||||
@@ -950,6 +898,17 @@ class XCX121SMCStrategy : public XCX121SMCBaseStrategy
|
|||||||
result = canTrigger;
|
result = canTrigger;
|
||||||
if (!result)
|
if (!result)
|
||||||
{
|
{
|
||||||
|
//
|
||||||
|
bool isISetuped = mTmpConditions[i].IsSetuped();
|
||||||
|
if (!isISetuped)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
ArrayRemove(
|
||||||
|
mXOBSPVConditionsCollection,
|
||||||
|
i,
|
||||||
|
1 //
|
||||||
|
);
|
||||||
|
}
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1057,7 +1016,7 @@ class XCX121SMCStrategy : public XCX121SMCBaseStrategy
|
|||||||
x121Inputs.Default();
|
x121Inputs.Default();
|
||||||
|
|
||||||
//
|
//
|
||||||
x121Inputs.showRSI = true;
|
x121Inputs.showRSI = false;
|
||||||
|
|
||||||
//
|
//
|
||||||
bool isInited = false;
|
bool isInited = false;
|
||||||
@@ -1082,27 +1041,27 @@ class XCX121SMCStrategy : public XCX121SMCBaseStrategy
|
|||||||
|
|
||||||
//
|
//
|
||||||
// XATR ...
|
// XATR ...
|
||||||
x121Inputs.xatrInputs.showATRUpper = true;
|
x121Inputs.xatrInputs.showATRUpper = false;
|
||||||
x121Inputs.xatrInputs.showATRLower = true;
|
x121Inputs.xatrInputs.showATRLower = false;
|
||||||
|
|
||||||
//
|
//
|
||||||
// XSTR ...
|
// XSTR ...
|
||||||
x121Inputs.xstrInputs.showStr = true;
|
x121Inputs.xstrInputs.showStr = true;
|
||||||
x121Inputs.xstrInputs.showStrUpper = true;
|
x121Inputs.xstrInputs.showStrUpper = false;
|
||||||
x121Inputs.xstrInputs.showStrLower = true;
|
x121Inputs.xstrInputs.showStrLower = false;
|
||||||
|
|
||||||
//
|
//
|
||||||
// XDON ...
|
// XDON ...
|
||||||
x121Inputs.xdonInputs.showOpen = false;
|
x121Inputs.xdonInputs.showOpen = false;
|
||||||
x121Inputs.xdonInputs.showClose = false;
|
x121Inputs.xdonInputs.showClose = true;
|
||||||
x121Inputs.xdonInputs.showLow = false;
|
x121Inputs.xdonInputs.showLow = true;
|
||||||
x121Inputs.xdonInputs.showHigh = false;
|
x121Inputs.xdonInputs.showHigh = true;
|
||||||
|
|
||||||
//
|
//
|
||||||
// XVWAP ...
|
// XVWAP ...
|
||||||
x121Inputs.xvwapInputs.showVWapFast = true;
|
x121Inputs.xvwapInputs.showVWapFast = false;
|
||||||
x121Inputs.xvwapInputs.showVWapMedium = true;
|
x121Inputs.xvwapInputs.showVWapMedium = false;
|
||||||
x121Inputs.xvwapInputs.showVWapSlow = true;
|
x121Inputs.xvwapInputs.showVWapSlow = false;
|
||||||
|
|
||||||
//
|
//
|
||||||
// Initialize Cycle Helpers ...
|
// Initialize Cycle Helpers ...
|
||||||
|
|||||||
Reference in New Issue
Block a user