last ...
This commit is contained in:
@@ -3588,6 +3588,45 @@ struct XMarketParser
|
||||
//
|
||||
};
|
||||
|
||||
//
|
||||
struct XPoint
|
||||
{
|
||||
//
|
||||
// Props ...
|
||||
double value;
|
||||
datetime at;
|
||||
|
||||
//
|
||||
XPoint()
|
||||
{
|
||||
Clean();
|
||||
}
|
||||
|
||||
//
|
||||
// Tools ...
|
||||
|
||||
//
|
||||
void Clean()
|
||||
{
|
||||
//
|
||||
value = 0;
|
||||
at = NULL;
|
||||
|
||||
//
|
||||
ZeroMemory(this);
|
||||
}
|
||||
|
||||
//
|
||||
bool IsValid()
|
||||
{
|
||||
//
|
||||
return value > 0 &&
|
||||
IsValid(at);
|
||||
}
|
||||
|
||||
//
|
||||
};
|
||||
|
||||
//
|
||||
// Specified Swing Point ...
|
||||
struct XSwingPoint
|
||||
|
||||
@@ -2006,6 +2006,77 @@ void SortZones(
|
||||
Clean(tmpItems);
|
||||
}
|
||||
|
||||
/**
|
||||
* Extract all Zones Which provided bar is Inside it ...
|
||||
*
|
||||
* @return ( int )
|
||||
*/
|
||||
template <typename T>
|
||||
int ExtractInsideZones(
|
||||
XOHCL &bar, // Bar ...
|
||||
T *&zones[], // Source of Zones ...
|
||||
T *&dest[] // Dest (all inside Zones) ...
|
||||
)
|
||||
{
|
||||
//
|
||||
int result = 0;
|
||||
|
||||
//
|
||||
Clean(dest);
|
||||
|
||||
//
|
||||
int count = ArraySize(zones);
|
||||
bool isValid = bar.IsValid() &&
|
||||
IsValidSize(count);
|
||||
if (!isValid)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
//
|
||||
T *iZone = zones[i];
|
||||
|
||||
//
|
||||
bool isHighInside = IsInside(
|
||||
bar.high,
|
||||
iZone //
|
||||
);
|
||||
|
||||
//
|
||||
bool isLowInside = IsInside(
|
||||
bar.low,
|
||||
iZone //
|
||||
);
|
||||
|
||||
//
|
||||
bool isInside =
|
||||
isLowInside &&
|
||||
isHighInside;
|
||||
|
||||
//
|
||||
if (isInside)
|
||||
{
|
||||
//
|
||||
Add(
|
||||
iZone,
|
||||
dest //
|
||||
);
|
||||
}
|
||||
|
||||
//
|
||||
ZeroMemory(iZone);
|
||||
}
|
||||
|
||||
//
|
||||
result = ArraySize(dest);
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
template <typename T>
|
||||
int FilterZones(
|
||||
|
||||
Reference in New Issue
Block a user