last ...
This commit is contained in:
@@ -3288,7 +3288,7 @@ class XC121SMCTradeHandler : public XCBaseAlert
|
||||
|
||||
//
|
||||
// Handle Last Executed Signal ...
|
||||
HandleSignalExecuted(signal);
|
||||
HandleSignalExecuted(signal);
|
||||
|
||||
//
|
||||
// Alert Executed Signal ...
|
||||
|
||||
@@ -387,27 +387,13 @@ bool DetectX121SMCXSTRPVSiganlSetup(
|
||||
XPOIState visionState = visionConditions.state;
|
||||
|
||||
//
|
||||
// Setup Conditions ...
|
||||
|
||||
//
|
||||
// Waits for new Peak or Vale ...
|
||||
|
||||
//
|
||||
// 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;
|
||||
}
|
||||
// Cycle X121Conditions ...
|
||||
X121Conditions triggerXConditions = triggerConditions.x121Conditions;
|
||||
X121Conditions decisionXConditions = decisionConditions.x121Conditions;
|
||||
X121Conditions analyseXConditions = analyseConditions.x121Conditions;
|
||||
X121Conditions verificationXConditions = verificationConditions.x121Conditions;
|
||||
X121Conditions consolidationXConditions = consolidationConditions.x121Conditions;
|
||||
X121Conditions visionXConditions = visionConditions.x121Conditions;
|
||||
|
||||
//
|
||||
// Setup Conditions ...
|
||||
@@ -430,7 +416,7 @@ bool DetectX121SMCXSTRPVSiganlSetup(
|
||||
IsBearish(marketDir);
|
||||
|
||||
//
|
||||
// Reading Bar State ...
|
||||
// Detect Bar State ...
|
||||
|
||||
//
|
||||
// Engulf ...
|
||||
@@ -526,370 +512,11 @@ bool DetectX121SMCXSTRPVSiganlSetup(
|
||||
;
|
||||
|
||||
//
|
||||
// Read Slopes ...
|
||||
double rsiSlope = decisionConditions.x121Conditions.rsiSlope;
|
||||
double strSlope = decisionConditions.x121Conditions.strSlope;
|
||||
double atrUpperSlope = decisionConditions.x121Conditions.atrUpperSlope;
|
||||
double atrLowerSlope = decisionConditions.x121Conditions.atrLowerSlope;
|
||||
double vwapFastSlope = decisionConditions.x121Conditions.vwapFastSlope;
|
||||
double vwapMidSlope = decisionConditions.x121Conditions.vwapMidSlope;
|
||||
double vwapSlowSlope = decisionConditions.x121Conditions.vwapSlowSlope;
|
||||
// Detect Price Zone ...
|
||||
|
||||
//
|
||||
bool isRsiSlopeBullish = decisionConditions.x121Conditions.isRsiSlopeBullish;
|
||||
bool isStrSlopeBullish = decisionConditions.x121Conditions.isStrSlopeBullish;
|
||||
bool isAtrUpperSlopeBullish = decisionConditions.x121Conditions.isAtrUpperSlopeBullish;
|
||||
bool isAtrLowerSlopeBullish = decisionConditions.x121Conditions.isAtrLowerSlopeBullish;
|
||||
bool isVwapFastSlopeBullish = decisionConditions.x121Conditions.isVwapFastSlopeBullish;
|
||||
bool isVwapMidSlopeBullish = decisionConditions.x121Conditions.isVwapMidSlopeBullish;
|
||||
bool isVwapSlowSlopeBullish = decisionConditions.x121Conditions.isVwapSlowSlopeBullish;
|
||||
|
||||
//
|
||||
bool isRsiSlopeBearish = decisionConditions.x121Conditions.isRsiSlopeBearish;
|
||||
bool isStrSlopeBearish = decisionConditions.x121Conditions.isStrSlopeBearish;
|
||||
bool isAtrUpperSlopeBearish = decisionConditions.x121Conditions.isAtrUpperSlopeBearish;
|
||||
bool isAtrLowerSlopeBearish = decisionConditions.x121Conditions.isAtrLowerSlopeBearish;
|
||||
bool isVwapFastSlopeBearish = decisionConditions.x121Conditions.isVwapFastSlopeBearish;
|
||||
bool isVwapMidSlopeBearish = decisionConditions.x121Conditions.isVwapMidSlopeBearish;
|
||||
bool isVwapSlowSlopeBearish = decisionConditions.x121Conditions.isVwapSlowSlopeBearish;
|
||||
|
||||
//
|
||||
bool isSlopesBullish =
|
||||
isRsiSlopeBullish &&
|
||||
isVwapMidSlopeBullish &&
|
||||
isAtrUpperSlopeBullish &&
|
||||
isAtrLowerSlopeBullish &&
|
||||
isVwapFastSlopeBullish &&
|
||||
isVwapSlowSlopeBullish;
|
||||
|
||||
//
|
||||
bool isSlopesBearish =
|
||||
isRsiSlopeBearish &&
|
||||
isVwapMidSlopeBearish &&
|
||||
isAtrUpperSlopeBearish &&
|
||||
isAtrLowerSlopeBearish &&
|
||||
isVwapFastSlopeBearish &&
|
||||
isVwapSlowSlopeBearish;
|
||||
|
||||
//
|
||||
// RSI ...
|
||||
|
||||
//
|
||||
double rsiMult1 = 2;
|
||||
double rsiMult2 = 2;
|
||||
|
||||
//
|
||||
double rsi = decisionConditions.x121Conditions.rsiBuffer[1];
|
||||
|
||||
//
|
||||
bool isRsiOverSold = decisionConditions.x121Conditions.isRsiOverSold;
|
||||
bool isRsiOverBought = decisionConditions.x121Conditions.isRsiOverBought;
|
||||
|
||||
//
|
||||
bool isRsiCrossedOverOverSold = decisionConditions.x121Conditions.isRsiCrossedOverOverSold;
|
||||
bool isRsiCrossedUnderOverBought = decisionConditions.x121Conditions.isRsiCrossedUnderOverBought;
|
||||
|
||||
//
|
||||
bool isRsiBullishFormed =
|
||||
//
|
||||
(rsiSlope > rsiMult2)
|
||||
//
|
||||
||
|
||||
//
|
||||
(rsiSlope > rsiMult1 &&
|
||||
isRsiCrossedOverOverSold)
|
||||
//
|
||||
;
|
||||
|
||||
//
|
||||
bool isRsiBearishFormed =
|
||||
//
|
||||
(rsiSlope < (-1 * rsiMult2))
|
||||
//
|
||||
||
|
||||
//
|
||||
(rsiSlope < (-1 * rsiMult1) &&
|
||||
isRsiCrossedUnderOverBought)
|
||||
//
|
||||
;
|
||||
|
||||
//
|
||||
// SAR ...
|
||||
|
||||
//
|
||||
double sar = decisionConditions.x121Conditions.sarBuffer[1];
|
||||
double sarPrev = decisionConditions.x121Conditions.sarBuffer[2];
|
||||
|
||||
//
|
||||
bool isSarBullish = decisionConditions.x121Conditions.isSarBullish;
|
||||
bool isSarBearish = decisionConditions.x121Conditions.isSarBearish;
|
||||
|
||||
//
|
||||
bool isSarSwitchedToBullish = decisionConditions.x121Conditions.isSarSwitchedToBullish;
|
||||
bool isSarSwitchedToBearish = decisionConditions.x121Conditions.isSarSwitchedToBearish;
|
||||
|
||||
//
|
||||
bool isPrevSarBreakedUp = IsBarBreak(
|
||||
sarPrev,
|
||||
X_DIRECTION_BULLISH,
|
||||
cBar //
|
||||
);
|
||||
bool isPrevSarBreakedDown = IsBarBreak(
|
||||
sarPrev,
|
||||
X_DIRECTION_BEARISH,
|
||||
cBar //
|
||||
);
|
||||
|
||||
//
|
||||
// ATR ...
|
||||
|
||||
//
|
||||
double atr = decisionConditions.x121Conditions.atrBuffer[1];
|
||||
double atrUpper = decisionConditions.x121Conditions.atrUpperBuffer[1];
|
||||
double atrLower = decisionConditions.x121Conditions.atrLowerBuffer[1];
|
||||
|
||||
//
|
||||
bool isAtrUpperBullishSlope = atrUpperSlope > 0;
|
||||
bool isAtrLowerBullishSlope = atrLowerSlope > 0;
|
||||
|
||||
//
|
||||
bool isAtrUpperBearishSlope = atrUpperSlope < 0;
|
||||
bool isAtrLowerBearishSlope = atrLowerSlope < 0;
|
||||
|
||||
//
|
||||
bool isAtrBullishSlope = isAtrUpperBullishSlope &&
|
||||
isAtrLowerBullishSlope;
|
||||
bool isAtrBearishSlope = isAtrUpperBearishSlope &&
|
||||
isAtrLowerBearishSlope;
|
||||
|
||||
//
|
||||
// STR ...
|
||||
|
||||
//
|
||||
double str = decisionConditions.x121Conditions.strBuffer[1];
|
||||
|
||||
//
|
||||
bool isStrBullish = decisionConditions.x121Conditions.isStrBullish;
|
||||
bool isStrBearish = decisionConditions.x121Conditions.isStrBearish;
|
||||
|
||||
//
|
||||
bool isStrSwitchedToBullish = decisionConditions.x121Conditions.isStrSwitchedToBullish;
|
||||
bool isStrSwitchedToBearish = decisionConditions.x121Conditions.isStrSwitchedToBearish;
|
||||
|
||||
//
|
||||
// PV ...
|
||||
|
||||
//
|
||||
double peak = decisionConditions.x121Conditions.peaksBuffer[1];
|
||||
double vale = decisionConditions.x121Conditions.valesBuffer[1];
|
||||
|
||||
//
|
||||
bool isPeakIncreasing = IsIncreasing(decisionConditions.x121Conditions.peaksBuffer);
|
||||
bool isPeakDecreasing = IsDecreasing(decisionConditions.x121Conditions.peaksBuffer);
|
||||
|
||||
//
|
||||
bool isValeIncreasing = IsIncreasing(decisionConditions.x121Conditions.valesBuffer);
|
||||
bool isValeDecreasing = IsDecreasing(decisionConditions.x121Conditions.valesBuffer);
|
||||
|
||||
//
|
||||
bool isPVIncreasing = (isPeakIncreasing &&
|
||||
isValeIncreasing) &&
|
||||
!(isPeakDecreasing &&
|
||||
isValeDecreasing);
|
||||
bool isPVDecreasing = (isPeakDecreasing &&
|
||||
isValeDecreasing) &&
|
||||
!(isPeakIncreasing &&
|
||||
isValeIncreasing);
|
||||
|
||||
//
|
||||
bool isNewPeak = decisionConditions.x121Conditions.isNewPeak;
|
||||
bool isNewPeakOverLast = decisionConditions.x121Conditions.isNewPeakOverLast;
|
||||
bool isNewPeakUnderLast = decisionConditions.x121Conditions.isNewPeakUnderLast;
|
||||
|
||||
//
|
||||
bool isNewVale = decisionConditions.x121Conditions.isNewVale;
|
||||
bool isNewValeOverLast = decisionConditions.x121Conditions.isNewValeOverLast;
|
||||
bool isNewValeUnderLast = decisionConditions.x121Conditions.isNewValeUnderLast;
|
||||
|
||||
//
|
||||
bool isPVBullishFormed =
|
||||
isPVIncreasing ||
|
||||
isNewPeakOverLast ||
|
||||
isNewValeOverLast;
|
||||
|
||||
//
|
||||
bool isPVBearishFormed =
|
||||
isPVDecreasing ||
|
||||
isNewPeakUnderLast ||
|
||||
isNewValeUnderLast;
|
||||
|
||||
//
|
||||
// VWAP ...
|
||||
|
||||
//
|
||||
bool isVWapFastOverMid = decisionConditions.x121Conditions.isVWapFastOverMid;
|
||||
bool isVWapFastUnderMid = decisionConditions.x121Conditions.isVWapFastUnderMid;
|
||||
|
||||
//
|
||||
bool isVWapBullishState = decisionConditions.x121Conditions.isVWapBullishState;
|
||||
bool isVWapBearishState = decisionConditions.x121Conditions.isVWapBearishState;
|
||||
|
||||
//
|
||||
bool isVWapSwitchedToBullishState = decisionConditions.x121Conditions.isVWapSwitchedToBullishState;
|
||||
bool isVWapSwitchedToBearishState = decisionConditions.x121Conditions.isVWapSwitchedToBearishState;
|
||||
|
||||
//
|
||||
bool isVWapBullishOrdered = decisionConditions.x121Conditions.isVWapBullishOrdered;
|
||||
bool isVWapBearishOrdered = decisionConditions.x121Conditions.isVWapBearishOrdered;
|
||||
|
||||
//
|
||||
bool isVWapSwitchedToBullishOrdered = decisionConditions.x121Conditions.isVWapSwitchedToBullishOrdered;
|
||||
bool isVWapSwitchedToBearishOrdered = decisionConditions.x121Conditions.isVWapSwitchedToBearishOrdered;
|
||||
|
||||
//
|
||||
bool isVWapMinBreakedUp = decisionConditions.x121Conditions.isVWapMinBreakedUp;
|
||||
bool isVWapMaxBreakedUp = decisionConditions.x121Conditions.isVWapMaxBreakedUp;
|
||||
|
||||
//
|
||||
bool isVWapMinBreakedDown = decisionConditions.x121Conditions.isVWapMinBreakedDown;
|
||||
bool isVWapMaxBreakedDown = decisionConditions.x121Conditions.isVWapMaxBreakedDown;
|
||||
|
||||
//
|
||||
bool isVWapFastCrossedOverMid = decisionConditions.x121Conditions.isVWapFastCrossedOverMid;
|
||||
bool isVWapFastCrossedUnderMid = decisionConditions.x121Conditions.isVWapFastCrossedUnderMid;
|
||||
|
||||
//
|
||||
bool isVWapFastCrossedOverSlow = decisionConditions.x121Conditions.isVWapFastCrossedOverSlow;
|
||||
bool isVWapFastCrossedUnderSlow = decisionConditions.x121Conditions.isVWapFastCrossedUnderSlow;
|
||||
|
||||
//
|
||||
bool isClosedOverVWapMin = decisionConditions.x121Conditions.isClosedOverVWapMin;
|
||||
bool isClosedUnderVWapMin = decisionConditions.x121Conditions.isClosedUnderVWapMin;
|
||||
|
||||
//
|
||||
bool isClosedOverVWapMax = decisionConditions.x121Conditions.isClosedOverVWapMax;
|
||||
bool isClosedUnderVWapMax = decisionConditions.x121Conditions.isClosedUnderVWapMax;
|
||||
|
||||
//
|
||||
bool isVWapBullishSlope =
|
||||
vwapFastSlope > 0 &&
|
||||
vwapMidSlope > 0 &&
|
||||
vwapSlowSlope > 0;
|
||||
|
||||
//
|
||||
bool isVWapBearishSlope =
|
||||
vwapFastSlope < 0 &&
|
||||
vwapMidSlope < 0 &&
|
||||
vwapSlowSlope < 0;
|
||||
|
||||
//
|
||||
bool isVWapBullishFormed =
|
||||
//
|
||||
isVWapBullishSlope
|
||||
//
|
||||
&&
|
||||
//
|
||||
(
|
||||
//
|
||||
(isVWapBullishOrdered &&
|
||||
isVWapSwitchedToBullishState)
|
||||
//
|
||||
||
|
||||
//
|
||||
(isVWapBullishState &&
|
||||
isVWapSwitchedToBullishOrdered)
|
||||
//
|
||||
||
|
||||
//
|
||||
((isVWapMaxBreakedUp ||
|
||||
isClosedOverVWapMax) &&
|
||||
(isVWapFastCrossedOverMid ||
|
||||
isVWapFastCrossedOverSlow))
|
||||
//
|
||||
)
|
||||
//
|
||||
;
|
||||
|
||||
//
|
||||
bool isVWapBearishFormed =
|
||||
//
|
||||
isVWapBearishSlope
|
||||
//
|
||||
&&
|
||||
//
|
||||
(
|
||||
//
|
||||
(isVWapBearishOrdered &&
|
||||
isVWapSwitchedToBearishState)
|
||||
//
|
||||
||
|
||||
//
|
||||
(isVWapBearishState &&
|
||||
isVWapSwitchedToBearishOrdered)
|
||||
//
|
||||
||
|
||||
//
|
||||
((isVWapMinBreakedDown ||
|
||||
isClosedUnderVWapMin) &&
|
||||
(isVWapFastCrossedUnderMid ||
|
||||
isVWapFastCrossedUnderSlow))
|
||||
//
|
||||
)
|
||||
//
|
||||
;
|
||||
|
||||
//
|
||||
// Complext ...
|
||||
|
||||
//
|
||||
bool isSarIncreased = decisionConditions.x121Conditions.isSarIncreased;
|
||||
bool isSarDecreased = decisionConditions.x121Conditions.isSarDecreased;
|
||||
bool isSarEqualsToPeak = decisionConditions.x121Conditions.isSarEqualsToPeak;
|
||||
bool isSarEqualsToVale = decisionConditions.x121Conditions.isSarEqualsToVale;
|
||||
bool isStrEqualsToPeak = decisionConditions.x121Conditions.isStrEqualsToPeak;
|
||||
bool isStrEqualsToVale = decisionConditions.x121Conditions.isStrEqualsToVale;
|
||||
bool isStrUpperOverPeak = decisionConditions.x121Conditions.isStrUpperOverPeak;
|
||||
bool isPeakOverAtrUpper = decisionConditions.x121Conditions.isPeakOverAtrUpper;
|
||||
bool isStrLowerOverVale = decisionConditions.x121Conditions.isStrLowerOverVale;
|
||||
bool isBreakedUpPrevSar = decisionConditions.x121Conditions.isBreakedUpPrevSar;
|
||||
bool isBreakedUpPrevStr = decisionConditions.x121Conditions.isBreakedUpPrevStr;
|
||||
bool isStrLowerUnderVale = decisionConditions.x121Conditions.isStrLowerUnderVale;
|
||||
bool isStrUpperUnderPeak = decisionConditions.x121Conditions.isStrUpperUnderPeak;
|
||||
bool isValeUnderAtrLower = decisionConditions.x121Conditions.isValeUnderAtrLower;
|
||||
bool isSarCrossedOverVale = decisionConditions.x121Conditions.isSarCrossedOverVale;
|
||||
bool isStrCrossedOverVale = decisionConditions.x121Conditions.isStrCrossedOverVale;
|
||||
bool isBreakedDownPrevStr = decisionConditions.x121Conditions.isBreakedDownPrevStr;
|
||||
bool isBreakedDownPrevSar = decisionConditions.x121Conditions.isBreakedDownPrevSar;
|
||||
bool isSarCrossedUnderPeak = decisionConditions.x121Conditions.isSarCrossedUnderPeak;
|
||||
bool isStrCrossedUnderPeak = decisionConditions.x121Conditions.isStrCrossedUnderPeak;
|
||||
bool isNewPeakOverAtrUpper = decisionConditions.x121Conditions.isNewPeakOverAtrUpper;
|
||||
bool isNewValeUnderAtrLower = decisionConditions.x121Conditions.isNewValeUnderAtrLower;
|
||||
bool isStrUpperOverAtrUpper = decisionConditions.x121Conditions.isStrUpperOverAtrUpper;
|
||||
bool isStrLowerOverAtrLower = decisionConditions.x121Conditions.isStrLowerOverAtrLower;
|
||||
bool isStrUpperUnderAtrUpper = decisionConditions.x121Conditions.isStrUpperUnderAtrUpper;
|
||||
bool isStrLowerUnderAtrLower = decisionConditions.x121Conditions.isStrLowerUnderAtrLower;
|
||||
bool isBreakedUpPrevAtrUpper = decisionConditions.x121Conditions.isBreakedUpPrevAtrUpper;
|
||||
bool isBreakedUpPrevAtrLower = decisionConditions.x121Conditions.isBreakedUpPrevAtrLower;
|
||||
bool isBreakedDownPrevAtrUpper = decisionConditions.x121Conditions.isBreakedDownPrevAtrUpper;
|
||||
bool isBreakedDownPrevAtrLower = decisionConditions.x121Conditions.isBreakedDownPrevAtrLower;
|
||||
bool isDonLowLowerEqualsToVale = decisionConditions.x121Conditions.isDonLowLowerEqualsToVale;
|
||||
bool isStrUpperCrossedOverPeak = decisionConditions.x121Conditions.isStrUpperCrossedOverPeak;
|
||||
bool isStrLowerCrossedOverVale = decisionConditions.x121Conditions.isStrLowerCrossedOverVale;
|
||||
bool isStrLowerOverDonLowLower = decisionConditions.x121Conditions.isStrLowerOverDonLowLower;
|
||||
bool isStrUpperOverDonHighUpper = decisionConditions.x121Conditions.isStrUpperOverDonHighUpper;
|
||||
bool isStrLowerUnderDonLowLower = decisionConditions.x121Conditions.isStrLowerUnderDonLowLower;
|
||||
bool isDonHighUpperEqualsToPeak = decisionConditions.x121Conditions.isDonHighUpperEqualsToPeak;
|
||||
bool isStrUpperCrossedUnderPeak = decisionConditions.x121Conditions.isStrUpperCrossedUnderPeak;
|
||||
bool isStrLowerCrossedUnderVale = decisionConditions.x121Conditions.isStrLowerCrossedUnderVale;
|
||||
bool isStrUpperUnderDonHighUpper = decisionConditions.x121Conditions.isStrUpperUnderDonHighUpper;
|
||||
bool isStrLowerCrossedOverAtrLower = decisionConditions.x121Conditions.isStrLowerCrossedOverAtrLower;
|
||||
bool isStrUpperCrossedOverAtrUpper = decisionConditions.x121Conditions.isStrUpperCrossedOverAtrUpper;
|
||||
bool isStrUpperCrossedUnderAtrUpper = decisionConditions.x121Conditions.isStrUpperCrossedUnderAtrUpper;
|
||||
bool isStrLowerCrossedUnderAtrLower = decisionConditions.x121Conditions.isStrLowerCrossedUnderAtrLower;
|
||||
bool isStrLowerCrossedOverDonLowLower = decisionConditions.x121Conditions.isStrLowerCrossedOverDonLowLower;
|
||||
bool isStrUpperCrossedOverDonHighUpper = decisionConditions.x121Conditions.isStrUpperCrossedOverDonHighUpper;
|
||||
bool isStrLowerCrossedUnderDonLowLower = decisionConditions.x121Conditions.isStrLowerCrossedUnderDonLowLower;
|
||||
bool isStrUpperCrossedUnderDonHighUpper = decisionConditions.x121Conditions.isStrUpperCrossedUnderDonHighUpper;
|
||||
double pzPeak = decisionConditions.x121Conditions.peaksBuffer[1];
|
||||
double pzVale = decisionConditions.x121Conditions.valesBuffer[1];
|
||||
|
||||
//
|
||||
XPriceZones priceZones;
|
||||
@@ -914,107 +541,90 @@ bool DetectX121SMCXSTRPVSiganlSetup(
|
||||
//
|
||||
isPriceZoneValidForPeak =
|
||||
hasBoundary &&
|
||||
peak <= priceZonesUpper &&
|
||||
peak >= priceZonesLower;
|
||||
pzPeak <= priceZonesUpper &&
|
||||
pzPeak >= priceZonesLower;
|
||||
|
||||
//
|
||||
isPriceZoneValidForVale =
|
||||
hasBoundary &&
|
||||
vale <= priceZonesUpper &&
|
||||
vale >= priceZonesLower;
|
||||
pzVale <= priceZonesUpper &&
|
||||
pzVale >= priceZonesLower;
|
||||
}
|
||||
|
||||
//
|
||||
//
|
||||
//
|
||||
|
||||
//
|
||||
// Method 1 ...
|
||||
// VWap Switch Start ...
|
||||
|
||||
//
|
||||
bool bullishMethod1 =
|
||||
//
|
||||
isSarBullish &&
|
||||
isStrBullish &&
|
||||
isSlopesBullish &&
|
||||
hasBullishTrend &&
|
||||
cBar.IsBullish() &&
|
||||
isAtrBullishSlope &&
|
||||
isPVBullishFormed &&
|
||||
isRsiBullishFormed &&
|
||||
isVWapBullishFormed
|
||||
//
|
||||
;
|
||||
|
||||
//
|
||||
bool bearishMethod1 =
|
||||
//
|
||||
isSarBearish &&
|
||||
isStrBearish &&
|
||||
isSlopesBearish &&
|
||||
hasBearishTrend &&
|
||||
cBar.IsBearish() &&
|
||||
isAtrBearishSlope &&
|
||||
isPVBearishFormed &&
|
||||
isRsiBearishFormed &&
|
||||
isVWapBearishFormed
|
||||
//
|
||||
;
|
||||
|
||||
//
|
||||
// Method 2 ...
|
||||
// PV Start ...
|
||||
|
||||
//
|
||||
bool bullishMethod2 =
|
||||
//
|
||||
false
|
||||
// isStrCrossedOverVale
|
||||
//
|
||||
;
|
||||
|
||||
//
|
||||
bool bearishMethod2 =
|
||||
//
|
||||
!isNewVale &&
|
||||
(
|
||||
//
|
||||
isStrCrossedUnderPeak
|
||||
//
|
||||
||
|
||||
//
|
||||
(isPrevSarBreakedDown &&
|
||||
isStrSwitchedToBearish)
|
||||
//
|
||||
)
|
||||
//
|
||||
;
|
||||
|
||||
//
|
||||
|
||||
//
|
||||
// Summarize Conditions ...
|
||||
|
||||
//
|
||||
isBullish =
|
||||
//
|
||||
// bullishMethod1
|
||||
// //
|
||||
// ||
|
||||
// Other Time Frames ...
|
||||
//
|
||||
bullishMethod2
|
||||
// Consolidation ...
|
||||
(consolidationXConditions.isCheBullish &&
|
||||
consolidationXConditions.isStrBullish &&
|
||||
consolidationXConditions.isSarBullish &&
|
||||
consolidationXConditions.isClosedOverVWapMax) &&
|
||||
//
|
||||
// Analyse ...
|
||||
(analyseXConditions.isCheBullish &&
|
||||
analyseXConditions.isStrBullish &&
|
||||
analyseXConditions.isSarBullish &&
|
||||
analyseXConditions.isClosedOverVWapMax) &&
|
||||
//
|
||||
// Decision ...
|
||||
hasBullishTrend &&
|
||||
(
|
||||
//
|
||||
((decisionXConditions.isStrSwitchedToBullish &&
|
||||
decisionXConditions.isCheBullish &&
|
||||
decisionXConditions.isSarBullish) ||
|
||||
(decisionXConditions.isCheSwitchedToBullish &&
|
||||
decisionXConditions.isSarBullish &&
|
||||
decisionXConditions.isStrBullish) ||
|
||||
(decisionXConditions.isSarSwitchedToBullish &&
|
||||
decisionXConditions.isCheBullish &&
|
||||
decisionXConditions.isStrBullish))
|
||||
//
|
||||
)
|
||||
//
|
||||
;
|
||||
|
||||
//
|
||||
isBearish =
|
||||
//
|
||||
// bearishMethod1
|
||||
// //
|
||||
// ||
|
||||
// Other Time Frames ...
|
||||
//
|
||||
bearishMethod2
|
||||
// Consolidation ...
|
||||
(consolidationXConditions.isCheBearish &&
|
||||
consolidationXConditions.isStrBearish &&
|
||||
consolidationXConditions.isSarBearish &&
|
||||
consolidationXConditions.isClosedUnderVWapMax) &&
|
||||
//
|
||||
// Analyse ...
|
||||
(analyseXConditions.isCheBearish &&
|
||||
analyseXConditions.isStrBearish &&
|
||||
analyseXConditions.isSarBearish &&
|
||||
analyseXConditions.isClosedUnderVWapMax) &&
|
||||
//
|
||||
// Decision ...
|
||||
hasBearishTrend &&
|
||||
(
|
||||
//
|
||||
((decisionXConditions.isStrSwitchedToBearish &&
|
||||
decisionXConditions.isCheBearish &&
|
||||
decisionXConditions.isSarBearish) ||
|
||||
(decisionXConditions.isCheSwitchedToBearish &&
|
||||
decisionXConditions.isSarBearish &&
|
||||
decisionXConditions.isStrBearish) ||
|
||||
(decisionXConditions.isSarSwitchedToBearish &&
|
||||
decisionXConditions.isCheBearish &&
|
||||
decisionXConditions.isStrBearish))
|
||||
//
|
||||
)
|
||||
//
|
||||
;
|
||||
|
||||
@@ -1027,10 +637,10 @@ bool DetectX121SMCXSTRPVSiganlSetup(
|
||||
}
|
||||
|
||||
//
|
||||
conditions.point =
|
||||
conditions.pivot =
|
||||
isBullish
|
||||
? vale
|
||||
: peak;
|
||||
? pzVale
|
||||
: pzPeak;
|
||||
conditions.setupTime = cTime;
|
||||
conditions.dir =
|
||||
isBullish
|
||||
@@ -1262,26 +872,42 @@ bool DetectX121SMCXSTRPVSiganlTrigger(
|
||||
XPOIState consolidationState = consolidationConditions.state;
|
||||
XPOIState visionState = visionConditions.state;
|
||||
|
||||
//
|
||||
// Cycle X121Conditions ...
|
||||
X121Conditions triggerXConditions = triggerConditions.x121Conditions;
|
||||
X121Conditions decisionXConditions = decisionConditions.x121Conditions;
|
||||
X121Conditions analyseXConditions = analyseConditions.x121Conditions;
|
||||
X121Conditions verificationXConditions = verificationConditions.x121Conditions;
|
||||
X121Conditions consolidationXConditions = consolidationConditions.x121Conditions;
|
||||
X121Conditions visionXConditions = visionConditions.x121Conditions;
|
||||
|
||||
//
|
||||
// Trigger Conditions ...
|
||||
|
||||
//
|
||||
// SAR ...
|
||||
double sar = decisionConditions.x121Conditions.sarBuffer[1];
|
||||
double sar = decisionXConditions.sarBuffer[1];
|
||||
|
||||
//
|
||||
// STR ...
|
||||
double str = decisionConditions.x121Conditions.strBuffer[1];
|
||||
double str = decisionXConditions.strBuffer[1];
|
||||
|
||||
//
|
||||
// CHE ...
|
||||
double le1 = decisionXConditions.le1Buffer[1];
|
||||
double le2 = decisionXConditions.le2Buffer[1];
|
||||
double se1 = decisionXConditions.se1Buffer[1];
|
||||
double se2 = decisionXConditions.se2Buffer[1];
|
||||
|
||||
//
|
||||
// ATR ...
|
||||
double atrUpper = decisionConditions.x121Conditions.atrUpperBuffer[1];
|
||||
double atrLower = decisionConditions.x121Conditions.atrLowerBuffer[1];
|
||||
double atrUpper = decisionXConditions.atrUpperBuffer[1];
|
||||
double atrLower = decisionXConditions.atrLowerBuffer[1];
|
||||
|
||||
//
|
||||
// PV ...
|
||||
double peak = decisionConditions.x121Conditions.peaksBuffer[1];
|
||||
double vale = decisionConditions.x121Conditions.valesBuffer[1];
|
||||
double peak = decisionXConditions.peaksBuffer[1];
|
||||
double vale = decisionXConditions.valesBuffer[1];
|
||||
|
||||
//
|
||||
int higherPeakIDX = -1;
|
||||
@@ -1301,6 +927,47 @@ bool DetectX121SMCXSTRPVSiganlTrigger(
|
||||
vale //
|
||||
);
|
||||
|
||||
//
|
||||
// Slopes ...
|
||||
|
||||
//
|
||||
bool isRsiSlopeBullish = decisionXConditions.isRsiSlopeBullish;
|
||||
bool isStrSlopeBullish = decisionXConditions.isStrSlopeBullish;
|
||||
bool isAtrUpperSlopeBullish = decisionXConditions.isAtrUpperSlopeBullish;
|
||||
bool isAtrLowerSlopeBullish = decisionXConditions.isAtrLowerSlopeBullish;
|
||||
bool isVwapFastSlopeBullish = decisionXConditions.isVwapFastSlopeBullish;
|
||||
bool isVwapMidSlopeBullish = decisionXConditions.isVwapMidSlopeBullish;
|
||||
bool isVwapSlowSlopeBullish = decisionXConditions.isVwapSlowSlopeBullish;
|
||||
|
||||
//
|
||||
bool isRsiSlopeBearish = decisionXConditions.isRsiSlopeBearish;
|
||||
bool isStrSlopeBearish = decisionXConditions.isStrSlopeBearish;
|
||||
bool isAtrUpperSlopeBearish = decisionXConditions.isAtrUpperSlopeBearish;
|
||||
bool isAtrLowerSlopeBearish = decisionXConditions.isAtrLowerSlopeBearish;
|
||||
bool isVwapFastSlopeBearish = decisionXConditions.isVwapFastSlopeBearish;
|
||||
bool isVwapMidSlopeBearish = decisionXConditions.isVwapMidSlopeBearish;
|
||||
bool isVwapSlowSlopeBearish = decisionXConditions.isVwapSlowSlopeBearish;
|
||||
|
||||
//
|
||||
bool isSlopesBullish =
|
||||
isRsiSlopeBullish &&
|
||||
isStrSlopeBullish &&
|
||||
isAtrUpperSlopeBullish &&
|
||||
isAtrLowerSlopeBullish &&
|
||||
isVwapFastSlopeBullish &&
|
||||
isVwapMidSlopeBullish &&
|
||||
isVwapSlowSlopeBullish;
|
||||
|
||||
//
|
||||
bool isSlopesBearish =
|
||||
isRsiSlopeBearish &&
|
||||
isStrSlopeBearish &&
|
||||
isAtrUpperSlopeBearish &&
|
||||
isAtrLowerSlopeBearish &&
|
||||
isVwapFastSlopeBearish &&
|
||||
isVwapMidSlopeBearish &&
|
||||
isVwapSlowSlopeBearish;
|
||||
|
||||
//
|
||||
double point = conditions.point;
|
||||
bool isPointBreak = IsBarBreak(
|
||||
@@ -1310,31 +977,26 @@ bool DetectX121SMCXSTRPVSiganlTrigger(
|
||||
);
|
||||
|
||||
//
|
||||
// Detect Bullish Conditions ...
|
||||
// Summary ...
|
||||
|
||||
//
|
||||
isBullish =
|
||||
//
|
||||
isBullish &&
|
||||
isPointBreak &&
|
||||
isSlopesBullish &&
|
||||
cBar.IsBullish()
|
||||
//
|
||||
// &&
|
||||
// //
|
||||
// false
|
||||
//
|
||||
;
|
||||
|
||||
//
|
||||
// Detect Bearish Conditions ...
|
||||
isBearish =
|
||||
//
|
||||
isBearish &&
|
||||
isPointBreak &&
|
||||
isSlopesBearish &&
|
||||
cBar.IsBearish()
|
||||
//
|
||||
// &&
|
||||
// //
|
||||
// false
|
||||
//
|
||||
;
|
||||
|
||||
//
|
||||
@@ -1512,11 +1174,11 @@ bool DetectX121SMCXSTRPVSiganlTrigger(
|
||||
sls //
|
||||
);
|
||||
|
||||
//
|
||||
Add(
|
||||
vale,
|
||||
sls //
|
||||
);
|
||||
// //
|
||||
// Add(
|
||||
// vale,
|
||||
// sls //
|
||||
// );
|
||||
|
||||
//
|
||||
if (bullishMomentumBar.IsValid())
|
||||
@@ -1528,12 +1190,32 @@ bool DetectX121SMCXSTRPVSiganlTrigger(
|
||||
);
|
||||
}
|
||||
|
||||
// //
|
||||
// if (IsValidIndex(lowerValeIDX))
|
||||
// {
|
||||
// //
|
||||
// Add(
|
||||
// lowerVale,
|
||||
// sls //
|
||||
// );
|
||||
// }
|
||||
|
||||
//
|
||||
if (IsValidIndex(lowerValeIDX))
|
||||
if (le1 != EMPTY_VALUE)
|
||||
{
|
||||
//
|
||||
Add(
|
||||
lowerVale,
|
||||
le1,
|
||||
sls //
|
||||
);
|
||||
}
|
||||
|
||||
//
|
||||
if (le2 != EMPTY_VALUE)
|
||||
{
|
||||
//
|
||||
Add(
|
||||
le2,
|
||||
sls //
|
||||
);
|
||||
}
|
||||
@@ -1546,11 +1228,11 @@ bool DetectX121SMCXSTRPVSiganlTrigger(
|
||||
sls //
|
||||
);
|
||||
|
||||
//
|
||||
Add(
|
||||
peak,
|
||||
sls //
|
||||
);
|
||||
// //
|
||||
// Add(
|
||||
// peak,
|
||||
// sls //
|
||||
// );
|
||||
|
||||
//
|
||||
if (bearishMomentumBar.IsValid())
|
||||
@@ -1563,11 +1245,31 @@ bool DetectX121SMCXSTRPVSiganlTrigger(
|
||||
}
|
||||
|
||||
//
|
||||
if (IsValidIndex(higherPeakIDX))
|
||||
// if (IsValidIndex(higherPeakIDX))
|
||||
// {
|
||||
// //
|
||||
// Add(
|
||||
// higherPeak,
|
||||
// sls //
|
||||
// );
|
||||
// }
|
||||
|
||||
//
|
||||
if (se1 != EMPTY_VALUE)
|
||||
{
|
||||
//
|
||||
Add(
|
||||
higherPeak,
|
||||
se1,
|
||||
sls //
|
||||
);
|
||||
}
|
||||
|
||||
//
|
||||
if (se2 != EMPTY_VALUE)
|
||||
{
|
||||
//
|
||||
Add(
|
||||
se2,
|
||||
sls //
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1261,7 +1261,7 @@ class XCX121SMCStrategy : public XCX121SMCBaseStrategy
|
||||
bool showAll = false;
|
||||
|
||||
//
|
||||
x121Inputs.showRSI = false;
|
||||
x121Inputs.showRSI = true;
|
||||
|
||||
//
|
||||
bool isInited = false;
|
||||
@@ -1286,8 +1286,8 @@ class XCX121SMCStrategy : public XCX121SMCBaseStrategy
|
||||
|
||||
//
|
||||
// XATR ...
|
||||
x121Inputs.xatrInputs.showATRUpper = showAll || false;
|
||||
x121Inputs.xatrInputs.showATRLower = showAll || false;
|
||||
x121Inputs.xatrInputs.showATRUpper = showAll || true;
|
||||
x121Inputs.xatrInputs.showATRLower = showAll || true;
|
||||
|
||||
//
|
||||
// XSTR ...
|
||||
@@ -1311,9 +1311,9 @@ class XCX121SMCStrategy : public XCX121SMCBaseStrategy
|
||||
|
||||
//
|
||||
// XVWAP ...
|
||||
x121Inputs.xvwapInputs.showVWapFast = showAll || false;
|
||||
x121Inputs.xvwapInputs.showVWapMedium = showAll || false;
|
||||
x121Inputs.xvwapInputs.showVWapSlow = showAll || false;
|
||||
x121Inputs.xvwapInputs.showVWapFast = showAll || true;
|
||||
x121Inputs.xvwapInputs.showVWapMedium = showAll || true;
|
||||
x121Inputs.xvwapInputs.showVWapSlow = showAll || true;
|
||||
|
||||
//
|
||||
// Initialize Cycle Helpers ...
|
||||
|
||||
Reference in New Issue
Block a user