This commit is contained in:
2025-02-26 19:19:50 +03:30
parent 959ef1fee4
commit 476bcaece8
5 changed files with 2501 additions and 89 deletions
@@ -361,6 +361,14 @@ class XCX121SMCXWZSignalDetector : public XCBase
Print("Has Inside Zones");
}
//
bool hasBreakedZones = hasWorkingZone &&
workingZone.HasBreakedZones();
if (hasBreakedZones)
{
Print("Has Breaked Zones");
}
//
UpdateTo(cTime);
+180 -67
View File
@@ -75,6 +75,7 @@ struct X121SMCStrategyXWZWorkingZone
//
XOBFVG insideZones[];
XOBFVG breakedZones[];
XOBFVG waitingZones[];
//
@@ -109,6 +110,7 @@ struct X121SMCStrategyXWZWorkingZone
//
Clean(insideZones);
Clean(waitingZones);
Clean(breakedZones);
//
Clean(supportZones);
@@ -432,70 +434,72 @@ struct X121SMCStrategyXWZWorkingZone
return;
}
// //
// // Supply Zones ...
// count = mtfState.FilterSupplyZones(
// supplyZones,
// NULL,
// XZONE_STATE_PASSED,
// false,
// XZONE_STATE_FAILED,
// false,
// XZONE_STATE_FAILED,
// false,
// XZONE_STATE_IGNORED,
// false //
// );
// //
// // Demand Zones ...
// count = mtfState.FilterDemandZones(
// demandZones,
// NULL,
// XZONE_STATE_PASSED,
// false,
// XZONE_STATE_FAILED,
// false,
// XZONE_STATE_FAILED,
// false,
// XZONE_STATE_IGNORED,
// false //
// );
// //
// // Support Zones ...
// count = stfState.FilterSupportZones(
// supportZones,
// period,
// XZONE_STATE_PASSED,
// false,
// XZONE_STATE_FAILED,
// false,
// XZONE_STATE_FAILED,
// false,
// XZONE_STATE_IGNORED,
// false //
// );
// //
// // Resistance Zones ...
// count = stfState.FilterResistanceZones(
// resistanceZones,
// period,
// XZONE_STATE_PASSED,
// false,
// XZONE_STATE_FAILED,
// false,
// XZONE_STATE_FAILED,
// false,
// XZONE_STATE_IGNORED,
// false //
// );
//
// Supply Zones ...
count = mtfState.FilterSupplyZones(
supplyZones,
NULL,
XZONE_STATE_PASSED,
false,
XZONE_STATE_FAILED,
false,
XZONE_STATE_FAILED,
false,
XZONE_STATE_IGNORED,
false //
);
//
// Detect price Inside Zones ...
// Demand Zones ...
count = mtfState.FilterDemandZones(
demandZones,
NULL,
XZONE_STATE_PASSED,
false,
XZONE_STATE_FAILED,
false,
XZONE_STATE_FAILED,
false,
XZONE_STATE_IGNORED,
false //
);
//
// Support Zones ...
count = stfState.FilterSupportZones(
supportZones,
period,
XZONE_STATE_PASSED,
false,
XZONE_STATE_FAILED,
false,
XZONE_STATE_FAILED,
false,
XZONE_STATE_IGNORED,
false //
);
//
// Resistance Zones ...
count = stfState.FilterResistanceZones(
resistanceZones,
period,
XZONE_STATE_PASSED,
false,
XZONE_STATE_FAILED,
false,
XZONE_STATE_FAILED,
false,
XZONE_STATE_IGNORED,
false //
);
//
//
//
//
// Detect Price Inside Zones ...
has = HasWaitingZones();
if (has)
{
@@ -520,16 +524,25 @@ struct X121SMCStrategyXWZWorkingZone
if (isInside)
{
//
Add(
i,
mustRemove //
);
//
AddRef(
idx = FindIndex(
iOBFVG,
insideZones //
);
has = IsValidSize(idx);
if (!has)
{
//
Add(
i,
mustRemove //
);
//
AddRef(
iOBFVG,
insideZones //
);
}
}
}
@@ -549,9 +562,97 @@ struct X121SMCStrategyXWZWorkingZone
);
}
}
//
Clean(mustRemove);
}
//
// Detect Inside Zones ...
has = HasInsideZones();
if (has)
{
//
int mustRemove[];
count = CountInsideZones();
for (int i = 0; i < count; i++)
{
//
XOBFVG iOBFVG = insideZones[i];
ENUM_X_DIRECTION iDir = iOBFVG.GetDirection();
bool isBullish = IsBullish(iDir);
//
bool isBullishBreaked =
//
zBar.high < iOBFVG.ob.Lower() &&
cBar.high < iOBFVG.ob.Lower()
//
;
//
bool isBearishBreaked =
//
zBar.low > iOBFVG.ob.Upper() &&
cBar.low > iOBFVG.ob.Upper()
//
;
//
bool isBreaked =
isBullish
? isBullishBreaked
: isBearishBreaked;
//
if (isBreaked)
{
//
idx = FindIndex(
iOBFVG,
breakedZones //
);
has = IsValidIndex(idx);
if (!has)
{
//
Add(
i,
mustRemove //
);
//
AddRef(
iOBFVG,
breakedZones //
);
}
}
}
//
has = HasChild(mustRemove);
if (has)
{
//
count = ArraySize(mustRemove);
for (int i = 0; i < count; i++)
{
//
ArrayRemove(
insideZones,
mustRemove[i],
1 //
);
}
}
//
Clean(mustRemove);
}
//
// Adding New OBFVG to Waiting Zones if not Exists ...
XOBFVG tmpWaitingZones[];
count = ExtractOBFVGs(
tmpWaitingZones,
@@ -682,6 +783,18 @@ struct X121SMCStrategyXWZWorkingZone
return ArraySize(insideZones);
}
//
bool HasBreakedZones()
{
return HasChild(breakedZones);
}
//
int CountBreakedZones()
{
return ArraySize(breakedZones);
}
//
//
//