This commit is contained in:
2025-03-05 20:32:40 +03:30
parent 94341f9ad5
commit 32deb20560
2 changed files with 125 additions and 30 deletions
@@ -728,6 +728,99 @@ struct X121SMCStrategyXWZWorkingZone
return result;
}
//
bool IsZoneOBRejected(
XOBFVG &zone,
X121Conditions &conditions,
int barIndex = 0 //
)
{
//
bool result = false;
//
// Cleanup Result ...
zone.Clean();
//
// Normalize Bar Index ...
if (barIndex < 0)
{
barIndex = 0;
}
//
if (barIndex == 0)
{
barIndex = 1;
}
//
XOHCL bar;
bool isInited = bar.Init(
symbol,
period,
barIndex //
);
//
// Validate ...
result = isInited &&
IsValid() &&
HasWaitingZones();
if (!result)
{
return result;
}
//
double points = GetPoints(bar.symbol);
//
// Detecting Rejected Waiting Zone ...
int count = CountWaitingZones();
for (int i = 0; i < count; i++)
{
//
// Detecting XBoxZone Area of Waiting Zone ...
XBoxZone iBox;
bool hasBox = waitingZones[i]
.ToZone(iBox);
if (hasBox)
{
//
double peak = conditions.peaksBuffer[1];
double lower = waitingZones[i].ob.Lower();
//
double delta = MathAbs(lower - peak);
//
result = delta == 0 ||
delta < points * 2;
}
//
// Validate Result ...
if (result)
{
//
iBox.Clean();
zone = waitingZones[i];
break;
}
//
iBox.Clean();
}
//
bar.Clean();
//
return result;
}
//
bool IsExists(XOBFVG &zone)
{