last ...
This commit is contained in:
@@ -238,6 +238,11 @@ class XCBasePOI : public XCBase
|
||||
//
|
||||
};
|
||||
|
||||
//
|
||||
typedef void (*TOnPOIEvent)(ENUM_XPOI_EVENTS event,
|
||||
XCBasePOI *param //
|
||||
);
|
||||
|
||||
//
|
||||
// Zone POI Class ...
|
||||
class XCZone : public XCBasePOI
|
||||
@@ -8560,6 +8565,10 @@ int GetLowest(
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
//
|
||||
//
|
||||
|
||||
/**
|
||||
* Extract XOBFVG Collection of Market ...
|
||||
*
|
||||
@@ -9485,286 +9494,113 @@ int ExtractOBFVGZones(
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
typedef void (*TOnPOIEvent)(ENUM_XPOI_EVENTS event,
|
||||
XCBasePOI *param //
|
||||
);
|
||||
|
||||
//
|
||||
//
|
||||
//
|
||||
|
||||
/**
|
||||
* Extract UnActivated Order Blocks / Fair Value Gaps ...
|
||||
* Find Highest Order Block of XOBFVG Collection ...
|
||||
*
|
||||
* @param source: XOBFVG Collection ...
|
||||
*
|
||||
* @return ( int )
|
||||
*/
|
||||
template <typename T>
|
||||
int ExtractUnActivatedZones(
|
||||
T *&source[],
|
||||
T *&dest[] //
|
||||
int GetHighest(
|
||||
XOBFVG &source[] //
|
||||
)
|
||||
{
|
||||
//
|
||||
int result = 0;
|
||||
|
||||
//
|
||||
Clean(dest);
|
||||
int result = -1;
|
||||
|
||||
//
|
||||
int count = ArraySize(source);
|
||||
int hasChild = IsValidSize(count);
|
||||
if (!hasChild)
|
||||
bool has = IsValidSize(count);
|
||||
if (!has)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
XOBFVG item;
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
//
|
||||
T *iChild = source[i];
|
||||
ENUM_X_DIRECTION iChildForDir = iChild.GetDirection();
|
||||
XOBFVG iOBFVG = source[i];
|
||||
|
||||
//
|
||||
// Validate Started Zones ...
|
||||
XOHCL iChildStartedBar;
|
||||
ENUM_X_DIRECTION iChildStartedDir;
|
||||
bool isStarted = iChild.IsStarted(
|
||||
iChildForDir,
|
||||
iChildStartedBar,
|
||||
iChildStartedDir //
|
||||
);
|
||||
if (!isStarted)
|
||||
bool canSet =
|
||||
!item.IsValid()
|
||||
? true
|
||||
: item.ob.Upper() < iOBFVG.ob.Upper();
|
||||
if (canSet)
|
||||
{
|
||||
continue;
|
||||
//
|
||||
item = iOBFVG;
|
||||
result = i;
|
||||
}
|
||||
|
||||
//
|
||||
// Validate InActive Zone ...
|
||||
XOHCL iChildActivatedBar;
|
||||
ENUM_X_DIRECTION iChildActivatedDir;
|
||||
bool isActivated = iChild.IsActivated(
|
||||
iChildForDir,
|
||||
iChildActivatedBar,
|
||||
iChildActivatedDir //
|
||||
);
|
||||
if (isActivated)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
//
|
||||
// Validate Zone Iverse Breake ...
|
||||
XOHCL iChildBreakedBar;
|
||||
ENUM_X_DIRECTION iChildBreakedDir;
|
||||
bool isBreaked = iChild.IsBreaked(
|
||||
Opposit(iChildForDir),
|
||||
iChildBreakedBar,
|
||||
iChildBreakedDir,
|
||||
true // Ignore Activation ...
|
||||
);
|
||||
if (isBreaked)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
//
|
||||
int iChildIDX = -1;
|
||||
bool isIChildExists = FindIndex(
|
||||
iChildIDX,
|
||||
iChild,
|
||||
dest //
|
||||
);
|
||||
if (isIChildExists)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
//
|
||||
Add(
|
||||
iChild,
|
||||
dest //
|
||||
);
|
||||
iOBFVG.Clean();
|
||||
}
|
||||
|
||||
//
|
||||
result = ArraySize(dest);
|
||||
item.Clean();
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Extract ctivated Order Blocks / Fair Value Gaps ...
|
||||
* Find Lowest Order Block of XOBFVG Collection ...
|
||||
*
|
||||
* @param source: XOBFVG Collection ...
|
||||
*
|
||||
* @return ( int )
|
||||
*/
|
||||
template <typename T>
|
||||
int ExtractActivatedZones(
|
||||
T *&source[],
|
||||
T *&dest[],
|
||||
bool ignoreBreaktion = false //
|
||||
int GetLowest(
|
||||
XOBFVG &source[] //
|
||||
)
|
||||
{
|
||||
//
|
||||
int result = 0;
|
||||
|
||||
//
|
||||
Clean(dest);
|
||||
int result = -1;
|
||||
|
||||
//
|
||||
int count = ArraySize(source);
|
||||
int hasChild = IsValidSize(count);
|
||||
if (!hasChild)
|
||||
bool has = IsValidSize(count);
|
||||
if (!has)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
XOBFVG item;
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
//
|
||||
T *iChild = source[i];
|
||||
ENUM_X_DIRECTION iChildForDir = iChild.GetDirection();
|
||||
XOBFVG iOBFVG = source[i];
|
||||
|
||||
//
|
||||
// Validate Started Zones ...
|
||||
XOHCL iChildStartedBar;
|
||||
ENUM_X_DIRECTION iChildStartedDir;
|
||||
bool isStarted = iChild.IsStarted(
|
||||
iChildForDir,
|
||||
iChildStartedBar,
|
||||
iChildStartedDir //
|
||||
);
|
||||
if (!isStarted)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
//
|
||||
// Validate InActive Zone ...
|
||||
XOHCL iChildActivatedBar;
|
||||
ENUM_X_DIRECTION iChildActivatedDir;
|
||||
bool isActivated = iChild.IsActivated(
|
||||
iChildForDir,
|
||||
iChildActivatedBar,
|
||||
iChildActivatedDir //
|
||||
);
|
||||
if (!isActivated)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
//
|
||||
// Validate Zone Iverse Breake ...
|
||||
if (!ignoreBreaktion)
|
||||
bool canSet =
|
||||
!item.IsValid()
|
||||
? true
|
||||
: item.ob.Lower() > iOBFVG.ob.Lower();
|
||||
if (canSet)
|
||||
{
|
||||
//
|
||||
XOHCL iChildBreakedBar;
|
||||
ENUM_X_DIRECTION iChildBreakedDir;
|
||||
bool isBreaked = iChild.IsBreaked(
|
||||
Opposit(iChildForDir),
|
||||
iChildBreakedBar,
|
||||
iChildBreakedDir,
|
||||
true // Ignore Activation ...
|
||||
);
|
||||
if (isBreaked)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
//
|
||||
isBreaked = iChild.IsBreaked(
|
||||
iChildForDir,
|
||||
iChildBreakedBar,
|
||||
iChildBreakedDir,
|
||||
true // Ignore Activation ...
|
||||
);
|
||||
if (isBreaked)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
item = iOBFVG;
|
||||
result = i;
|
||||
}
|
||||
|
||||
//
|
||||
int iChildIDX = -1;
|
||||
bool isIChildExists = FindIndex(
|
||||
iChildIDX,
|
||||
iChild,
|
||||
dest //
|
||||
);
|
||||
if (isIChildExists)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
//
|
||||
Add(
|
||||
iChild,
|
||||
dest //
|
||||
);
|
||||
iOBFVG.Clean();
|
||||
}
|
||||
|
||||
//
|
||||
result = ArraySize(dest);
|
||||
item.Clean();
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Extract Directinal Based Order Blocks / Fair Value Gaps ...
|
||||
*
|
||||
* @param forDir: ENUM_X_DIRECTION member ...
|
||||
*
|
||||
* @return ( int )
|
||||
*/
|
||||
template <typename T>
|
||||
int ExtractDirectionalZones(
|
||||
ENUM_X_DIRECTION forDir,
|
||||
T *&source[],
|
||||
T *&dest[] //
|
||||
)
|
||||
{
|
||||
//
|
||||
int result = 0;
|
||||
|
||||
//
|
||||
Clean(dest);
|
||||
|
||||
//
|
||||
int count = ArraySize(source);
|
||||
if (!IsValidSize(count) ||
|
||||
!HasDirection(forDir))
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
//
|
||||
T *iChild = source[i];
|
||||
|
||||
//
|
||||
ENUM_X_DIRECTION iForDir = iChild.GetDirection();
|
||||
if (forDir == iForDir)
|
||||
{
|
||||
//
|
||||
Add(
|
||||
iChild,
|
||||
dest //
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
result = ArraySize(dest);
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
//
|
||||
//
|
||||
//
|
||||
|
||||
/**
|
||||
* Check Trading Conditions based on Specified Box ...
|
||||
|
||||
Reference in New Issue
Block a user