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
@@ -400,11 +400,11 @@ class XCX121SMCXWZSignalDetector : public XCBase
hasWaitingZones = workingZone.DetectZone( hasWaitingZones = workingZone.DetectZone(
drawer, drawer,
analysePoiEvents, analysePoiEvents,
consolidationPoiEvents, decisionPoiEvents,
consolidationPoiEvents, analysePoiEvents,
consolidationState,
analyseState, analyseState,
consolidationState // decisionState,
analyseState //
); );
// //
@@ -468,8 +468,9 @@ class XCX121SMCXWZSignalDetector : public XCBase
// Detect Signal Box ... // Detect Signal Box ...
hasSignalBox = hasWorkingZone && hasSignalBox = hasWorkingZone &&
hasWaitingZones && hasWaitingZones &&
workingZone.IsZoneRejected( workingZone.IsZoneOBRejected(
activatedZone, activatedZone,
decisionXConditions,
zIndex // zIndex //
); );
if (hasSignalBox) if (hasSignalBox)
@@ -484,27 +485,27 @@ class XCX121SMCXWZSignalDetector : public XCBase
signalBoxDir = signalBox.dir; signalBoxDir = signalBox.dir;
provider = X121SMC_XWZ_PROVIDER_ACTIVATED_ZONE; provider = X121SMC_XWZ_PROVIDER_ACTIVATED_ZONE;
// // //
// int idx = FindIndex( int idx = FindIndex(
// activatedZone, activatedZone,
// workingZone.waitingZones // workingZone.waitingZones //
// ); );
// bool has = IsValidIndex(idx); bool has = IsValidIndex(idx);
// if (has) if (has)
// { {
// // //
// ArrayRemove( ArrayRemove(
// workingZone.waitingZones, workingZone.waitingZones,
// idx, idx,
// 1 // 1 //
// ); );
// // //
// AddRef( AddRef(
// activatedZone, activatedZone,
// workingZone.unavailableZones // workingZone.unavailableZones //
// ); );
// } }
} }
} }
@@ -914,8 +915,7 @@ class XCX121SMCXWZSignalDetector : public XCBase
// //
// Summarize Results ... // Summarize Results ...
result = false && result = hasPriority &&
hasPriority &&
hasSignalBox && hasSignalBox &&
hasRewardAmount; hasRewardAmount;
@@ -962,10 +962,12 @@ class XCX121SMCXWZSignalDetector : public XCBase
true // Draw Waiting Zones Box Area ... true // Draw Waiting Zones Box Area ...
// //
); );
// //
if (hasSignalBox) { if (hasSignalBox)
Print("Has Signal Box ..."); {
//
Print("Has Signal Box ...");
} }
} }
@@ -728,6 +728,99 @@ struct X121SMCStrategyXWZWorkingZone
return result; 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) bool IsExists(XOBFVG &zone)
{ {