add support of Consolidation Zone ibside XPOIDetector and XPOIState ...

This commit is contained in:
2025-02-26 22:34:40 +03:30
parent 476bcaece8
commit af9c398338
14 changed files with 1993 additions and 1986 deletions
+114 -114
View File
@@ -1082,26 +1082,26 @@ class XCX121SMCXWZSignalDetector : public XCBase
//
//
//
// Detect Consolidation Zone ...
// //
// // Detect Consolidation Zone ...
//
// Bullish ...
XConsolidationZone bullishConsolidationZone;
bool hasBullishConsolidationZone = decisionCycleHelper
.GetLastDirectionalConsolidationZone(
X_DIRECTION_BULLISH,
bullishConsolidationZone //
);
// //
// // Bullish ...
// XConsolidationZone bullishConsolidationZone;
// bool hasBullishConsolidationZone = decisionCycleHelper
// .GetLastDirectionalConsolidationZone(
// X_DIRECTION_BULLISH,
// bullishConsolidationZone //
// );
//
// Bearish ...
XConsolidationZone bearishConsolidationZone;
bool hasBearishConsolidationZone = decisionCycleHelper
.GetLastDirectionalConsolidationZone(
X_DIRECTION_BEARISH,
bearishConsolidationZone //
);
// //
// // Bearish ...
// XConsolidationZone bearishConsolidationZone;
// bool hasBearishConsolidationZone = decisionCycleHelper
// .GetLastDirectionalConsolidationZone(
// X_DIRECTION_BEARISH,
// bearishConsolidationZone //
// );
//
// Detect High Probability Swings ...
@@ -1179,114 +1179,114 @@ class XCX121SMCXWZSignalDetector : public XCBase
double sl = iPosition.sl;
double tp = iPosition.tp;
//
// Trail Stops Using Consolidation Zones ...
bool canTraiLonglUsingCZone =
//
(isLong &&
isInProfit &&
hasBullishConsolidationZone &&
bullishConsolidationZone.lower > iPosition.sl &&
bullishConsolidationZone.lower > iPosition.entry)
//
;
if (canTraiLonglUsingCZone)
{
sl = bullishConsolidationZone.lower;
}
// //
// // Trail Stops Using Consolidation Zones ...
// bool canTraiLonglUsingCZone =
// //
// (isLong &&
// isInProfit &&
// hasBullishConsolidationZone &&
// bullishConsolidationZone.lower > iPosition.sl &&
// bullishConsolidationZone.lower > iPosition.entry)
// //
// ;
// if (canTraiLonglUsingCZone)
// {
// sl = bullishConsolidationZone.lower;
// }
//
bool canTraiShortlUsingCZone =
//
(!isLong &&
isInProfit &&
hasBearishConsolidationZone &&
bearishConsolidationZone.upper < iPosition.sl &&
bearishConsolidationZone.upper < iPosition.entry)
//
;
if (canTraiShortlUsingCZone)
{
sl = bearishConsolidationZone.upper;
}
// //
// bool canTraiShortlUsingCZone =
// //
// (!isLong &&
// isInProfit &&
// hasBearishConsolidationZone &&
// bearishConsolidationZone.upper < iPosition.sl &&
// bearishConsolidationZone.upper < iPosition.entry)
// //
// ;
// if (canTraiShortlUsingCZone)
// {
// sl = bearishConsolidationZone.upper;
// }
//
bool canTrailUsingCZone =
canTraiLonglUsingCZone ||
canTraiShortlUsingCZone;
// //
// bool canTrailUsingCZone =
// canTraiLonglUsingCZone ||
// canTraiShortlUsingCZone;
//
// Trail Stops Using Swings ...
// //
// // Trail Stops Using Swings ...
//
bool canTrailLongUsingSwings =
//
isLong &&
isInProfit &&
(isSwingLow ||
isStrongSwingLow) &&
pBar.low > iPosition.sl &&
pBar.low > iPosition.entry
//
;
if (canTrailLongUsingSwings)
{
sl = pBar.low;
}
// //
// bool canTrailLongUsingSwings =
// //
// isLong &&
// isInProfit &&
// (isSwingLow ||
// isStrongSwingLow) &&
// pBar.low > iPosition.sl &&
// pBar.low > iPosition.entry
// //
// ;
// if (canTrailLongUsingSwings)
// {
// sl = pBar.low;
// }
//
bool canTraiShortlUsingSwings =
//
!isLong &&
isInProfit &&
(isSwingHigh ||
isStrongSwingHigh) &&
pBar.high < iPosition.sl &&
pBar.high < iPosition.entry
//
;
if (canTraiShortlUsingSwings)
{
sl = pBar.high;
}
// //
// bool canTraiShortlUsingSwings =
// //
// !isLong &&
// isInProfit &&
// (isSwingHigh ||
// isStrongSwingHigh) &&
// pBar.high < iPosition.sl &&
// pBar.high < iPosition.entry
// //
// ;
// if (canTraiShortlUsingSwings)
// {
// sl = pBar.high;
// }
//
bool canTrailUsingSwings =
canTrailLongUsingSwings ||
canTraiShortlUsingSwings;
// //
// bool canTrailUsingSwings =
// canTrailLongUsingSwings ||
// canTraiShortlUsingSwings;
//
//
//
// //
// //
// //
//
bool canTrail =
sl != iPosition.sl &&
(canTrailUsingCZone ||
canTrailUsingSwings);
if (canTrail)
{
//
X121SMCGuard iGuard;
// //
// bool canTrail =
// sl != iPosition.sl &&
// (canTrailUsingCZone ||
// canTrailUsingSwings);
// if (canTrail)
// {
// //
// X121SMCGuard iGuard;
//
iGuard.time = cTime;
iGuard.symbol = symbol;
iGuard.provider = provider;
iGuard.action = X_121_SMC_GUARD_ACTION_TRAIL_STOP;
// //
// iGuard.time = cTime;
// iGuard.symbol = symbol;
// iGuard.provider = provider;
// iGuard.action = X_121_SMC_GUARD_ACTION_TRAIL_STOP;
//
iGuard.ticket = iPosition.ticket;
// //
// iGuard.ticket = iPosition.ticket;
//
iGuard.sl = sl;
// //
// iGuard.sl = sl;
//
AddGuard(
iGuard,
guards //
);
}
// //
// AddGuard(
// iGuard,
// guards //
// );
// }
}
//