last ...
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user