This commit is contained in:
2025-10-25 16:45:25 +03:30
parent 2db26ee5f6
commit 7c0c48128e
6 changed files with 1416 additions and 17 deletions
@@ -652,6 +652,53 @@ int GetHighestByBar(
return result;
}
/**
* Get Highest Bar Price Index of Specified Collection ...
*
* @param source: reference collection, Provides Data Source ...
*
* @return ( int )
*/
int GetHighestBarPrice(
XOHCL &source[],
ENUM_X_PRICE priceType //
)
{
//
int result = -1;
//
// Validate ...
bool has = HasChild(source) &&
IsXValid(priceType);
if (!has)
{
return result;
}
//
double price = EMPTY_VALUE;
double selected = EMPTY_VALUE;
int count = ArraySize(source);
for (int i = 0; i < count; i++)
{
//
price = source[i].GetPrice(priceType);
has = !NotEmptyZero(selected)
? true
: price > selected;
if (has)
{
//
result = i;
selected = price;
}
}
//
return result;
}
/**
* Get Highest Index of Specified Collection ...
*
@@ -903,6 +950,53 @@ int GetLowestByBar(
return result;
}
/**
* Get Lowest Bar Price Index of Specified Collection ...
*
* @param source: reference collection, Provides Data Source ...
*
* @return ( int )
*/
int GetLowestBarPrice(
XOHCL &source[],
ENUM_X_PRICE priceType //
)
{
//
int result = -1;
//
// Validate ...
bool has = HasChild(source) &&
IsXValid(priceType);
if (!has)
{
return result;
}
//
double price = EMPTY_VALUE;
double selected = EMPTY_VALUE;
int count = ArraySize(source);
for (int i = 0; i < count; i++)
{
//
price = source[i].GetPrice(priceType);
has = !NotEmptyZero(selected)
? true
: price < selected;
if (has)
{
//
result = i;
selected = price;
}
}
//
return result;
}
/**
* Get Lowest Index of Specified Collection ...
*