last works ...

This commit is contained in:
2025-10-09 12:34:26 +03:30
parent fc318b5c19
commit e97b44b938
7 changed files with 642 additions and 33 deletions
+33
View File
@@ -758,6 +758,39 @@ struct XOHCL
return result;
}
//
bool BarAt(
datetime _time,
XOHCL &bar //
)
{
//
bool result = false;
//
bar.Clean();
//
result = IsValid();
if (!result)
{
return result;
}
//
_time = NormalizeTime(_time);
//
result = bar.Init(
symbol,
period,
_time //
);
//
return result;
}
//
bool BarIn(
ENUM_TIMEFRAMES _period,
@@ -1378,7 +1378,7 @@ struct XPatternAnalysis
for (int i = 0; i < count; i++)
{
//
has = forDir = patternsDir[i];
has = forDir == patternsDir[i];
if (has)
{
result++;
@@ -4955,6 +4955,86 @@ bool HasInside(
return result;
}
/**
* Extract Affected Zones for Specified Bar ...
*
* @param bar: XOHCL, reference to Specified Bar ...
* @param source: XBoxZone, reference collection to Provide Data Source ...
* @param dest: XBoxZone, reference collection to holds result ...
* @param forDir: ENUM_X_DIRECTION, Specified Zones Direction to Lookup ...
*
* @return ( int )
*/
int ExtractAffectedZones(
XOHCL &bar,
XBoxZone &source[],
XBoxZone &dest[],
ENUM_X_DIRECTION forDir = X_DIRECTION_NONE //
)
{
//
int result = 0;
//
// Prepare ...
XClean(dest);
//
// Validate ...
bool has = bar.IsValid() &&
HasChild(source);
if (!has)
{
return result;
}
//
bool isActed;
bool isTested;
bool isInside;
bool isFakeBreaked;
for (int i = 0; i < ArraySize(source); i++)
{
//
// Validate Direction ...
has =
!HasDirection(forDir) ||
forDir == source[i].dir;
if (!has)
{
continue;
}
//
// Check Affected ...
isActed = IsActed(bar, source[i]);
isTested = IsTested(bar, source[i]);
isInside = IsInside(bar, source[i]);
isFakeBreaked = IsFakeBreaked(bar, source[i]);
//
has =
isActed ||
isTested ||
isInside ||
isFakeBreaked;
if (has)
{
//
AddIfNotExists(
source[i],
dest //
);
}
}
//
result = ArraySize(dest);
//
return result;
}
/**
* Extract all Items which Specified Bar is inside them ...
*