This commit is contained in:
2025-03-25 21:46:48 +03:30
parent 9c034fce4f
commit a5511f2f69
8 changed files with 4933 additions and 788 deletions
+214
View File
@@ -0,0 +1,214 @@
//
// Checking Bar Based on Positions State ...
ENUM_X_DIRECTION iBarPosDir;
bool isBarValidForDir = cHelper
.mBarAnalyser
.IsValidForPosition(
cBar,
iBarPosDir //
);
bool isBarValidForBullish =
isBarValidForDir &&
IsBullish(iBarPosDir);
bool isBarValidForBearish =
isBarValidForDir &&
IsBearish(iBarPosDir);
//
// Check Bar Place Based on Golden Zones ...
//
bool isBarInPeaksGoldenZone =
cBar.high <= cXConditions.peaksBuffer[cIDX] &&
cBar.low >= cXConditions.peaksGoldenBuffer[cIDX];
//
bool isBarInValesGoldenZone =
cBar.high >= cXConditions.valesBuffer[cIDX] &&
cBar.low <= cXConditions.valesGoldenBuffer[cIDX];
//
XCPOIDrawer *drawer = provider.visionCycleHelper.mPOIDrawer;
//
// X3MA ...
//
bool isX3MaFastMidOverPeaksGoldeZone =
isX3MaFastOverPeaksGoldenZone &&
isX3MaMidOverPeaksGoldenZone;
//
bool isX3MaFastMidUnderValesGoldeZone =
isX3MaFastUnderValesGoldenZone &&
isX3MaMidUnderValesGoldenZone;
//
// XVWAP ...
//
bool isVWapFastMidOverPeaksGoldeZone =
isVWapFastOverPeaksGoldenZone &&
isVWapMidOverPeaksGoldenZone;
//
bool isVWapFastMidUnderValesGoldeZone =
isVWapFastUnderValesGoldenZone &&
isVWapMidUnderValesGoldenZone;
//
//
//
bool isX3MaVWapFastUnderValuesGoldenZone =
isX3MaFastUnderValesGoldenZone &&
isVWapFastUnderValesGoldenZone;
//
bool isX3MaVWapFastOverPeaksGoldenZone =
isX3MaFastOverPeaksGoldenZone &&
isVWapFastOverPeaksGoldenZone;
//
//
//
double x3MaFastMidMax = MathMax(
cXConditions.x3maFastBuffer[cIDX],
cXConditions.x3maMidBuffer[cIDX] //
);
//
double x3MaFastMidMin = MathMin(
cXConditions.x3maFastBuffer[cIDX],
cXConditions.x3maMidBuffer[cIDX] //
);
//
double vwapFastMidMax = MathMax(
cXConditions.vwapFastBuffer[cIDX],
cXConditions.vwapMidBuffer[cIDX] //
);
//
double vwapFastMidMin = MathMin(
cXConditions.vwapFastBuffer[cIDX],
cXConditions.vwapMidBuffer[cIDX] //
);
//
//
//
double x3maVWapFastMidMax = MathMax(x3MaFastMidMax, vwapFastMidMax);
double x3maVWapFastMidMin = MathMin(x3MaFastMidMin, vwapFastMidMin);
//
double x3maVWapMax = MathMax(cXConditions.x3maMax, cXConditions.vwapMax);
double x3maVWapMin = MathMin(cXConditions.x3maMin, cXConditions.vwapMin);
//
double x3maVWapDiff = x3maVWapMax - x3maVWapMin;
//
double atr = cXConditions.atrBuffer[cIDX];
//
bool isConsolidate = x3maVWapDiff <= (3 * atr);
//
bool isX3MaVWapSwitchedToBullish =
//
// VWap ...
(
//
(cXConditions.isVWapBullishOrdered &&
cXConditions.isVWapSwitchedToBullishState) ||
(cXConditions.isVWapBullishState &&
cXConditions.isVWapSwitchedToBullishOrdered)
//
)
//
||
//
// X3Ma ...
(
//
(cXConditions.isX3MaBullishOrdered &&
cXConditions.isX3MaSwitchedToBullishState) ||
(cXConditions.isX3MaBullishState &&
cXConditions.isX3MaSwitchedToBullishOrdered)
//
)
//
;
//
bool isX3MaVWapSwitchedToBearish =
//
// VWap ...
(
//
(cXConditions.isVWapBearishOrdered &&
cXConditions.isVWapSwitchedToBearishState) ||
(cXConditions.isVWapBearishState &&
cXConditions.isVWapSwitchedToBearishOrdered)
//
)
//
||
//
// X3Ma ...
(
//
(cXConditions.isX3MaBearishOrdered &&
cXConditions.isX3MaSwitchedToBearishState) ||
(cXConditions.isX3MaBearishState &&
cXConditions.isX3MaSwitchedToBearishOrdered)
//
)
//
;
//
// Bullish Conditions ...
isBullish =
//
// Base Condition ...
(
//
false
//
// isConsolidate &&
// isBarValidForBullish &&
// cXConditions.isSarBullish &&
// isX3MaVWapSwitchedToBullish &&
// cXConditions.isNewPeakOverLast // &&
// isVWapFastMidUnderValesGoldeZone // &&
// cXConditions.isAtrLowerSlopeBullish
//
)
//
;
//
// Bearish Conditions ...
isBearish =
//
// Base Condition ...
(
//
false
//
// isConsolidate &&
// isBarValidForBearish &&
// cXConditions.isSarBearish &&
// isX3MaVWapSwitchedToBearish &&
// cXConditions.isNewValeUnderLast // &&
// isVWapFastMidOverPeaksGoldeZone // &&
// cXConditions.isAtrUpperSlopeBearish
//
)
//
;
File diff suppressed because it is too large Load Diff
+2 -2
View File
@@ -140,8 +140,8 @@ struct X121Inputs
// //
int xpvMax = xpvInputs.Max(); int xpvMax = xpvInputs.Max();
int xhkMax = xpvInputs.Max(); int xhkMax = xhkInputs.Max();
int xmasMax = xpvInputs.Max(); int xmasMax = xmasInputs.Max();
int xatrMax = xatrInputs.Max(); int xatrMax = xatrInputs.Max();
int xstrMax = xstrInputs.Max(); int xstrMax = xstrInputs.Max();
int xcheMax = xcheInputs.Max(); int xcheMax = xcheInputs.Max();
+1 -1
View File
@@ -92,7 +92,7 @@ struct X121XSTRInputs
// //
strLength = 14; strLength = 14;
strMultiplier = 3.0; strMultiplier = 3.0;
strAppliedTo = PRICE_MEDIAN; strAppliedTo = PRICE_CLOSE;
// //
showStr = true; showStr = true;
File diff suppressed because it is too large Load Diff
@@ -190,87 +190,87 @@ class XCX121SMCXWZSignalDetector : public XCBase
// //
// First We Have to Has Working Zone ... // First We Have to Has Working Zone ...
bool hasWorkingZone = workingZone.IsValid(); // bool hasWorkingZone = workingZone.IsValid();
if (!hasWorkingZone) // if (!hasWorkingZone)
{ // {
// // //
hasWorkingZone = workingZone.Init( // hasWorkingZone = workingZone.Init(
symbol, // symbol,
period, // period,
zIndex, // zIndex,
provider // // provider //
); // );
} // }
// // //
// Update Working Zone ... // // Update Working Zone ...
if (hasWorkingZone) // if (hasWorkingZone)
{ // {
// // //
// Reset POI Detector Required POI(s) ... // // Reset POI Detector Required POI(s) ...
provider.MaxRequiredPOIs(50); // provider.MaxRequiredPOIs(50);
// // //
// Reset POI Detector Allowed Loopback ... // // Reset POI Detector Allowed Loopback ...
provider.MaxAllowedLoopbackForInit(578); // provider.MaxAllowedLoopbackForInit(578);
// // //
// Check Working Zone Has Trend ... // // Check Working Zone Has Trend ...
hasTrend = workingZone.DetectTreand( // hasTrend = workingZone.DetectTreand(
X_CYCLE_CONSOLIDATION, // X_CYCLE_CONSOLIDATION,
trend, // trend,
provider, // provider,
zIndex // // zIndex //
); // );
// // //
// Detectiong Signal Boxes ... // // Detectiong Signal Boxes ...
hasWaitingBoxes = workingZone // // hasWaitingBoxes = workingZone
.DetectWaitingBoxes( // // .DetectWaitingBoxes(
X_CYCLE_ANALYSE, // // X_CYCLE_ANALYSE,
X_CYCLE_DECISION, // // X_CYCLE_DECISION,
provider, // // provider,
zIndex // // // zIndex //
); // // );
if (hasWaitingBoxes) // if (hasWaitingBoxes)
{ // {
// // //
// Validate Working Zone Waiting Boxes ... // // Validate Working Zone Waiting Boxes ...
workingZone.ValidateWaitingBoxes(zIndex); // workingZone.ValidateWaitingBoxes(zIndex);
// // //
// Double Check Has Waiting Boxes or not ... // // Double Check Has Waiting Boxes or not ...
hasWaitingBoxes = workingZone.HasWaitingBoxes(); // hasWaitingBoxes = workingZone.HasWaitingBoxes();
} // }
// // //
// Checking Working Zone Destory or not ... // // Checking Working Zone Destory or not ...
bool isWorkingZoneDestroyed = workingZone.IsDestroyed( // bool isWorkingZoneDestroyed = workingZone.IsDestroyed(
zIndex, // zIndex,
period // // period //
); // );
// // //
// Cleanup WorkingZone and ignore all conditions ... // // Cleanup WorkingZone and ignore all conditions ...
if (isWorkingZoneDestroyed) // if (isWorkingZoneDestroyed)
{ // {
// // //
result = false; // result = false;
workingZone.Clean(); // workingZone.Clean();
hasWorkingZone = false; // hasWorkingZone = false;
// // //
// Cleanup Resources ... // // Cleanup Resources ...
provider.Clean(); // provider.Clean();
// // //
mConditions.Clean(); // mConditions.Clean();
consolidationZBar.Clean(); // consolidationZBar.Clean();
// // //
return result; // return result;
} // }
} // }
// //
// Update Models To Time ... // Update Models To Time ...
@@ -290,7 +290,7 @@ class XCX121SMCXWZSignalDetector : public XCBase
// //
// Detect Signal Box ... // Detect Signal Box ...
hasSignalBox = hasSignalBox =
hasWorkingZone && // hasWorkingZone &&
workingZone.DetectSignalConditions( workingZone.DetectSignalConditions(
signalBox, signalBox,
signalBoxDir, signalBoxDir,
@@ -377,25 +377,25 @@ class XCX121SMCXWZSignalDetector : public XCBase
// //
// Check Priority Exists ... // Check Priority Exists ...
hasPriority = // hasPriority =
hasWorkingZone && // hasWorkingZone &&
workingZone // workingZone
.DetectPriority( // .DetectPriority(
priority, // priority,
signalBoxDir, // signalBoxDir,
zIndex, // zIndex,
period // // period //
); // );
// //
// Check Price Reward and Amount Exists ... // Check Price Reward and Amount Exists ...
hasRewardAmount = // hasRewardAmount =
hasWorkingZone && // hasWorkingZone &&
CalculateRiskReward( // CalculateRiskReward(
priority, // priority,
reward, // reward,
amountPercent // // amountPercent //
); // );
// //
// Check Signal Conditions ... // Check Signal Conditions ...
@@ -839,9 +839,10 @@ class XCX121SMCXWZSignalDetector : public XCBase
// //
// Summarize Results ... // Summarize Results ...
result = hasPriority && // result = hasPriority &&
hasSignalBox && // hasSignalBox &&
hasRewardAmount; // hasRewardAmount;
result = hasSignalBox;
// //
if (result) if (result)
+31 -5
View File
@@ -31,6 +31,7 @@
enum ENUM_X121SMC_XWZ_PROVIDERS enum ENUM_X121SMC_XWZ_PROVIDERS
{ {
X121SMC_XWZ_PROVIDER_NONE, X121SMC_XWZ_PROVIDER_NONE,
X121SMC_XWZ_PROVIDER_XWPVZ,
X121SMC_XWZ_PROVIDER_XFVGMA, X121SMC_XWZ_PROVIDER_XFVGMA,
X121SMC_XWZ_PROVIDER_XBREAKED_BOX, X121SMC_XWZ_PROVIDER_XBREAKED_BOX,
X121SMC_XWZ_PROVIDER_XREJECTED_BOX, X121SMC_XWZ_PROVIDER_XREJECTED_BOX,
@@ -1929,7 +1930,7 @@ struct X121SMCStrategyXWZWorkingZone
// --------------------------------------------- // ---------------------------------------------
// Rejected Box ... // Rejected Box ...
// --------------------------------------------- // ---------------------------------------------
bool useSenario1 = true; bool useSenario1 = false;
bool isSenario1Happend = false; bool isSenario1Happend = false;
bool isSenario1Bullish = false; bool isSenario1Bullish = false;
bool isSenario1Bearish = false; bool isSenario1Bearish = false;
@@ -1967,7 +1968,7 @@ struct X121SMCStrategyXWZWorkingZone
// --------------------------------------------------- // ---------------------------------------------------
// Activated Box ... // Activated Box ...
// --------------------------------------------------- // ---------------------------------------------------
bool useSenario2 = true; bool useSenario2 = false;
bool isSenario2Happend = false; bool isSenario2Happend = false;
bool isSenario2Bullish = false; bool isSenario2Bullish = false;
bool isSenario2Bearish = false; bool isSenario2Bearish = false;
@@ -2006,7 +2007,7 @@ struct X121SMCStrategyXWZWorkingZone
// --------------------------------------------------- // ---------------------------------------------------
// Breaked Box ... // Breaked Box ...
// --------------------------------------------------- // ---------------------------------------------------
bool useSenario3 = true; bool useSenario3 = false;
bool isSenario3Happend = false; bool isSenario3Happend = false;
bool isSenario3Bullish = false; bool isSenario3Bullish = false;
bool isSenario3Bearish = false; bool isSenario3Bearish = false;
@@ -2046,7 +2047,7 @@ struct X121SMCStrategyXWZWorkingZone
// ----------------------------------------------- // -----------------------------------------------
// Detect Signal Box Based On FVG Conditions ... // Detect Signal Box Based On FVG Conditions ...
// ----------------------------------------------- // -----------------------------------------------
bool useSenario4 = true; bool useSenario4 = false;
bool isSenario4Happend = false; bool isSenario4Happend = false;
bool isSenario4Bullish = false; bool isSenario4Bullish = false;
bool isSenario4Bearish = false; bool isSenario4Bearish = false;
@@ -2085,8 +2086,9 @@ struct X121SMCStrategyXWZWorkingZone
// //
// Senario 5: // Senario 5:
// --------------------------------------------- // ---------------------------------------------
// XWPVZ ...
// --------------------------------------------- // ---------------------------------------------
bool useSenario5 = false; bool useSenario5 = true;
bool isSenario5Happend = false; bool isSenario5Happend = false;
bool isSenario5Bullish = false; bool isSenario5Bullish = false;
bool isSenario5Bearish = false; bool isSenario5Bearish = false;
@@ -2096,6 +2098,30 @@ struct X121SMCStrategyXWZWorkingZone
!isSenario4Happend && !isSenario4Happend &&
useSenario5) useSenario5)
{ {
//
isSenario5Happend = cParser.HasXWPVZConditions(
X_CYCLE_DECISION,
box,
dir,
provider,
barIndex //
);
//
isSenario5Bullish =
isSenario5Happend &&
IsBullish(dir);
//
isSenario5Bearish =
isSenario5Happend &&
IsBearish(dir);
//
if (isSenario5Happend)
{
signalProvider = X121SMC_XWZ_PROVIDER_XWPVZ;
}
} }
// //
+21 -11
View File
@@ -755,7 +755,7 @@ class XCX121SMCStrategy : public XCX121SMCBaseStrategy
// //
x121Inputs.xatrInputs.atrMultiplier = 1.5; x121Inputs.xatrInputs.atrMultiplier = 1.5;
x121Inputs.xatrInputs.atrSmoothingMode = X_MA_MODE_NONE; x121Inputs.xatrInputs.atrSmoothingMode = X_MA_MODE_EMA;
x121Inputs.xpvInputs.goldenZoneLevel = X_FIBO_LEVEL_236; x121Inputs.xpvInputs.goldenZoneLevel = X_FIBO_LEVEL_236;
// //
@@ -768,6 +768,16 @@ class XCX121SMCStrategy : public XCX121SMCBaseStrategy
x121Inputs.x3maInputs.x3maMidMALength = 50; x121Inputs.x3maInputs.x3maMidMALength = 50;
x121Inputs.x3maInputs.x3maSlowMALength = 200; x121Inputs.x3maInputs.x3maSlowMALength = 200;
//
// x121Inputs.xcheInputs.cheLength = 14;
// x121Inputs.xcheInputs.cheLoopback = 7;
// x121Inputs.xcheInputs.cheMultiplier1 = 1.5;
// x121Inputs.xcheInputs.cheMultiplier2 = 2;
//
// x121Inputs.xstrInputs.strLength = 14;
// x121Inputs.xstrInputs.strMultiplier = 1.5;
// //
// x121Inputs.xccInputs.upColor = clrLime; // x121Inputs.xccInputs.upColor = clrLime;
// x121Inputs.xccInputs.downColor = clrRed; // x121Inputs.xccInputs.downColor = clrRed;
@@ -786,12 +796,12 @@ class XCX121SMCStrategy : public XCX121SMCBaseStrategy
// //
// XPV ... // XPV ...
x121Inputs.xpvInputs.showSar = showAll || false; x121Inputs.xpvInputs.showSar = showAll || true;
x121Inputs.xpvInputs.showPeaks = showAll || false; x121Inputs.xpvInputs.showPeaks = showAll || true;
x121Inputs.xpvInputs.showVales = showAll || false; x121Inputs.xpvInputs.showVales = showAll || true;
x121Inputs.xpvInputs.showSupports = showAll || false; x121Inputs.xpvInputs.showSupports = showAll || false;
x121Inputs.xpvInputs.showResistances = showAll || false; x121Inputs.xpvInputs.showResistances = showAll || false;
x121Inputs.xpvInputs.showGoldenZones = showAll || false; x121Inputs.xpvInputs.showGoldenZones = showAll || true;
// //
// XHK ... // XHK ...
@@ -804,9 +814,9 @@ class XCX121SMCStrategy : public XCX121SMCBaseStrategy
// XMAS ... // XMAS ...
// //
x121Inputs.xmasInputs.showUpper = showAll || false; x121Inputs.xmasInputs.showUpper = showAll || true;
x121Inputs.xmasInputs.showMid = showAll || false; x121Inputs.xmasInputs.showMid = showAll || true;
x121Inputs.xmasInputs.showLower = showAll || false; x121Inputs.xmasInputs.showLower = showAll || true;
// //
// XATR ... // XATR ...
@@ -835,9 +845,9 @@ class XCX121SMCStrategy : public XCX121SMCBaseStrategy
// //
// XVWAP ... // XVWAP ...
x121Inputs.xvwapInputs.showVWapFast = showAll || true; x121Inputs.xvwapInputs.showVWapFast = showAll || false;
x121Inputs.xvwapInputs.showVWapMedium = showAll || true; x121Inputs.xvwapInputs.showVWapMedium = showAll || false;
x121Inputs.xvwapInputs.showVWapSlow = showAll || true; x121Inputs.xvwapInputs.showVWapSlow = showAll || false;
// //
// X3MA ... // X3MA ...