This commit is contained in:
2025-03-19 01:38:07 +03:30
parent 9f0ebd1afe
commit 012499cc73
7 changed files with 1242 additions and 387 deletions
@@ -2631,7 +2631,7 @@ struct X121SMCStrategyConditionParser
XBoxZone &box,
XBoxZone &holderBox,
ENUM_X_DIRECTION &dir,
XBoxZone &waitingBoxes[],
XSignalBox &waitingBoxes[],
X121SMCStrategySignalProviderData &provider,
ENUM_X_CYCLES holderCycle = X_CYCLE_NONE,
int barIndex = 0 //
@@ -2783,41 +2783,6 @@ struct X121SMCStrategyConditionParser
return result;
}
//
// Detect Inside Box ...
XBoxZone insideBox;
count = ArraySize(waitingBoxes);
has = IsValidSize(count);
if (has)
{
//
for (int i = 0; i < count; i++)
{
//
XBoxZone iBox = waitingBoxes[i];
bool isBullish = iBox.IsBullish();
double iMid = iBox.lower + ((iBox.upper - iBox.lower) / 2);
//
has =
//
isBullish
? cBar.low < iMid &&
cBar.low > iBox.lower
: cBar.high > iMid &&
cBar.high < iBox.upper
//
;
if (has)
{
//
insideBox = iBox;
break;
}
}
}
has = insideBox.IsValid();
//
ENUM_X_DIRECTION iBarPosDir;
bool isBarValidForDir = cHelper
@@ -2834,55 +2799,27 @@ struct X121SMCStrategyConditionParser
IsBearish(iBarPosDir);
//
if (has)
{
//
XCBoxObject *iObj;
has = drawer.DrawBox(
insideBox,
iObj //
);
if (has)
{
//
Print("Dec Scores:");
Print("-------------");
Print("Bull: ", provider.decisionBullishScore);
Print("Bear: ", provider.decisionBearishScore);
Print("-------------");
Print("Anal Scores:");
Print("-------------");
Print("Bull: ", provider.analyseBullishScore);
Print("Bear: ", provider.analyseBearishScore);
Print("-------------");
Print("Bar Valid For: " + ToString(iBarPosDir));
Print("-------------");
Print(ToString(insideBox.dir), " Inside ...");
Print("-------------");
}
}
// result = isBarValidForBullish ||
// isBarValidForBearish;
// if (!result)
// {
// //
// zBar.Clean();
// cBar.Clean();
// pBar.Clean();
// cState.Clean();
// chState.Clean();
// insideBox.Clean();
// ZeroMemory(cHelper);
// cConditions.Clean();
// cXConditions.Clean();
// ZeroMemory(chHelper);
// chConditions.Clean();
// chXConditions.Clean();
//
result = has;
if (!result)
{
//
zBar.Clean();
cBar.Clean();
pBar.Clean();
cState.Clean();
chState.Clean();
insideBox.Clean();
ZeroMemory(cHelper);
cConditions.Clean();
cXConditions.Clean();
ZeroMemory(chHelper);
chConditions.Clean();
chXConditions.Clean();
//
return result;
}
// //
// return result;
// }
//
// Detecting Signal Conditions ...
@@ -2894,8 +2831,11 @@ struct X121SMCStrategyConditionParser
// Base Condition ...
(
//
insideBox.IsBullish() &&
isBarValidForBullish
false
// cBar.IsBullish() &&
// isBarValidForBullish &&
// cBar.close > cXConditions.x3maFastBuffer[cIDX] &&
// cXConditions.x3maFastBuffer[cIDX] < cXConditions.x3maSlowBuffer[cIDX]
//
)
//
@@ -2908,8 +2848,11 @@ struct X121SMCStrategyConditionParser
// Base Condition ...
(
//
insideBox.IsBearish() &&
isBarValidForBearish
false
// cBar.IsBearish() &&
// isBarValidForBearish &&
// cBar.close < cXConditions.x3maFastBuffer[cIDX] &&
// cXConditions.x3maFastBuffer[cIDX] > cXConditions.x3maSlowBuffer[cIDX]
//
)
//
@@ -2931,9 +2874,9 @@ struct X121SMCStrategyConditionParser
//
box.dir = dir;
box.to = TimeCurrent();
box.from = insideBox.from;
box.upper = insideBox.upper;
box.lower = insideBox.lower;
// box.from = insideBox.from;
// box.upper = insideBox.upper;
// box.lower = insideBox.lower;
box.symbol = cXConditions.symbol;
box.period = cXConditions.period;
}
@@ -2953,7 +2896,7 @@ struct X121SMCStrategyConditionParser
pBar.Clean();
cState.Clean();
chState.Clean();
insideBox.Clean();
// insideBox.Clean();
ZeroMemory(cHelper);
cConditions.Clean();
cStateEvents.Clean();