last works ...
This commit is contained in:
@@ -1074,7 +1074,8 @@ bool IsBoxInside(
|
||||
*/
|
||||
bool IsBoxInsideOr(
|
||||
XBoxZone &source,
|
||||
XBoxZone &dest //
|
||||
XBoxZone &dest,
|
||||
bool forceInside = false //
|
||||
)
|
||||
{
|
||||
//
|
||||
@@ -1090,19 +1091,25 @@ bool IsBoxInsideOr(
|
||||
}
|
||||
|
||||
//
|
||||
bool isLowerInside =
|
||||
source.lower > dest.lower &&
|
||||
source.lower < dest.upper &&
|
||||
(source.upper < dest.upper ||
|
||||
source.upper > dest.upper);
|
||||
bool isInside =
|
||||
source.upper <= dest.upper &&
|
||||
source.upper >= dest.lower &&
|
||||
source.lower >= dest.lower &&
|
||||
source.lower <= dest.upper;
|
||||
bool isUpperInside =
|
||||
source.upper < dest.upper &&
|
||||
source.upper > dest.lower &&
|
||||
(source.lower > dest.lower ||
|
||||
source.lower < dest.lower);
|
||||
source.upper <= dest.upper &&
|
||||
source.upper >= dest.lower;
|
||||
bool isLowerInside =
|
||||
source.lower >= dest.lower &&
|
||||
source.lower <= dest.upper;
|
||||
|
||||
//
|
||||
result =
|
||||
isLowerInside ||
|
||||
isUpperInside;
|
||||
forceInside
|
||||
? isInside
|
||||
: (isInside ||
|
||||
isLowerInside ||
|
||||
isUpperInside);
|
||||
|
||||
//
|
||||
return result;
|
||||
|
||||
@@ -5301,18 +5301,35 @@ struct XBoxZone
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check Box is Bullish or not ...
|
||||
*
|
||||
* @return ( bool )
|
||||
*/
|
||||
bool IsBullish()
|
||||
{
|
||||
return IsValid() &&
|
||||
IsBullish(dir);
|
||||
}
|
||||
|
||||
/**
|
||||
* Check Box is Bearish or not ...
|
||||
*
|
||||
* @return ( bool )
|
||||
*/
|
||||
bool IsBearish()
|
||||
{
|
||||
return IsValid() &&
|
||||
IsBearish(dir);
|
||||
}
|
||||
|
||||
/**
|
||||
* Check Box is Same as Other ...
|
||||
*
|
||||
* @param item: XBoxZone instance Resource ...
|
||||
*
|
||||
* @return ( bool )
|
||||
*/
|
||||
bool IsSameAs(XBoxZone &item)
|
||||
{
|
||||
//
|
||||
@@ -5364,6 +5381,76 @@ struct XBoxZone
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* To Bar Index ...
|
||||
*
|
||||
* @return ( int )
|
||||
*/
|
||||
int ToIndex(
|
||||
ENUM_TIMEFRAMES forPeriod = NULL //
|
||||
)
|
||||
{
|
||||
//
|
||||
int result = -1;
|
||||
|
||||
//
|
||||
if (!IsValid())
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
if (!IsValid(forPeriod))
|
||||
{
|
||||
forPeriod = period;
|
||||
}
|
||||
|
||||
//
|
||||
result = GetBarIndex(
|
||||
symbol,
|
||||
forPeriod,
|
||||
to //
|
||||
);
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* From Bar Index ...
|
||||
*
|
||||
* @return ( int )
|
||||
*/
|
||||
int FromIndex(
|
||||
ENUM_TIMEFRAMES forPeriod = NULL //
|
||||
)
|
||||
{
|
||||
//
|
||||
int result = -1;
|
||||
|
||||
//
|
||||
if (!IsValid())
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
if (!IsValid(forPeriod))
|
||||
{
|
||||
forPeriod = period;
|
||||
}
|
||||
|
||||
//
|
||||
result = GetBarIndex(
|
||||
symbol,
|
||||
forPeriod,
|
||||
from //
|
||||
);
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve Unique Identifier ...
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user