This commit is contained in:
2025-02-14 09:21:04 +03:30
parent 54fcca4044
commit b9ce179fa3
8 changed files with 3451 additions and 70 deletions
+80
View File
@@ -7528,6 +7528,86 @@ bool IsBelowBox(
return result;
}
/**
* Check a Box is Used or not ...
*
* @param box: XBoxZone instance Reference ...
* @param fromIndex: int ...
* @param toIndex: int
* @param forPeriod: Specified Period ...
*
* @return ( bool )
*/
bool IsBoxUsed(
XBoxZone &box,
int fromIndex,
int toIndex = 0,
ENUM_TIMEFRAMES forPeriod = NULL //
)
{
//
bool result = false;
//
if (toIndex < 0)
{
toIndex = 0;
}
//
result =
//
box.IsValid()
fromIndex > 0 &&
fromIndex > toIndex
//
;
if (!result)
{
return result;
}
//
if (!IsValid(forPeriod))
{
forPeriod = box.period;
}
//
EUM_X_DIRECT forDir = box.dir;
bool isBllish = IsBullish(forDir);
//
for (int i = fromIndex; i >= toIndex; i--)
{
//
XOHCL iBar;
bool isInited = iBar.Init(
box.symbol,
forPeriod,
i //
);
//
bool isTouched =
isBullish
? iBar.high > box.lower
: iBar.low < box.upper;
if (!isTouched)
{
continue;
}
//
iBar.Clean();
result = false;
break;
}
//
return result;
}
//
bool IsRejectBox(
ENUM_X_DIRECTION &forDir,