This commit is contained in:
2025-03-22 15:32:23 +03:30
parent 7970785883
commit ddf021f4d4
2 changed files with 113 additions and 2 deletions
@@ -3471,6 +3471,9 @@ class XC121SMCTradeHandler : public XCBaseAlert
//
string prefix = "Protector: ";
//
int targetDistance = 5;
//
// Implement Protection Senario Here ...
int count = Count();
@@ -3758,8 +3761,8 @@ class XC121SMCTradeHandler : public XCBaseAlert
//
double targetDelta = isLong
? target + (15 * points)
: target - (15 * points);
? target + (targetDistance * points)
: target - (targetDistance * points);
bool canRF =
target > 0 &&
(isLong ? target > entry
@@ -776,6 +776,114 @@ struct X121SMCStrategyXWZWorkingZone
}
}
//
// Checking Other Senario for Waiting Boxes ...
if (obStateEvents.hasNewSharp)
{
//
XBoxZone currSharp;
XBoxZone prevSharp;
//
// Retrieve Current Sharp ...
XCPOIDrawer *drawer = provider.visionCycleHelper.mPOIDrawer;
XBoxZone tmpBoxes[];
Copy(
obState.sharps,
tmpBoxes //
);
idx = GetYoungest(tmpBoxes);
has = IsValidIndex(idx);
if (has)
{
//
currSharp = tmpBoxes[idx];
bool isBullish = currSharp.IsBullish();
//
ArrayRemove(
tmpBoxes,
idx,
1 //
);
//
while (HasChild(tmpBoxes))
{
//
idx = GetYoungest(tmpBoxes);
has = IsValidIndex(idx);
//
if (!has)
{
break;
}
//
XBoxZone iBox = tmpBoxes[idx];
ArrayRemove(
tmpBoxes,
idx,
1 //
);
//
if (iBox.dir == currSharp.dir)
{
//
prevSharp = iBox;
iBox.Clean();
break;
}
//
iBox.Clean();
}
//
Clean(tmpBoxes);
}
Clean(tmpBoxes);
//
has = currSharp.IsValid() &&
prevSharp.IsValid();
if (has)
{
//
XCBoxObject *iCurrObj;
XCBoxObject *iPrevObj;
has = drawer.DrawBox(
currSharp,
iCurrObj //
);
has =
has &&
drawer.DrawBox(
prevSharp,
iPrevObj //
);
if (has)
{
//
Print("Sharp Detection ...");
//
iCurrObj.Delete();
iPrevObj.Delete();
//
iCurrObj.Detach();
iPrevObj.Detach();
//
ZeroMemory(iCurrObj);
ZeroMemory(iPrevObj);
}
}
}
//
count = CountWaitingBoxes();
result = IsValidSize(count);