add support of Consolidation Zone ibside XPOIDetector and XPOIState ...

This commit is contained in:
2025-02-26 22:34:40 +03:30
parent 476bcaece8
commit af9c398338
14 changed files with 1993 additions and 1986 deletions
+128 -2
View File
@@ -3754,6 +3754,132 @@ int ExtractSwings(
return result;
}
//
// Consolidation Zone ...
struct XConsolidationZone
{
//
// Props ...
//
string symbol; // Symbol ...
ENUM_TIMEFRAMES period; // Period ...
//
double upper; // Upper ...
double lower; // Lower ...
//
datetime from; // Start Date
datetime to; // Breake Date
//
ENUM_X_DIRECTION dir; // Break Direction ...
//
// Constructor ...
XConsolidationZone()
{
Clean();
}
//
// Tools ...
/**
* Cleanup ...
*/
void Clean()
{
//
upper = 0;
lower = 0;
//
to = NULL;
from = NULL;
symbol = NULL;
period = NULL;
dir = X_DIRECTION_NONE;
//
ZeroMemory(this);
}
/**
* Validate ...
*
* @return ( bool )
*/
bool IsValid()
{
//
bool result = false;
//
result =
//
upper > 0 &&
lower > 0 &&
IsValid(to) &&
IsValid(from) &&
IsValid(symbol) &&
IsValid(period) &&
HasDirection(dir)
//
;
//
return result;
}
bool IsSameAs(
XConsolidationZone &item //
)
{
//
bool result = false;
//
result = IsValid() &&
item.IsValid() &&
dir == item.dir &&
from == item.from &&
upper == item.upper &&
lower == item.lower &&
symbol == item.symbol &&
period == item.period;
//
return result;
}
/**
* Retrieve Unique Identifier ...
*
* @return ( string )
*/
string GetTag()
{
//
string result =
//
"XCZONE" + "_" +
ToString(dir) + "_" +
symbol + "_" +
ToString(period) + "_" +
ToString(upper) + "_" +
ToString(lower)
//
;
//
return result;
}
//
};
//
// Functions ...
@@ -5255,9 +5381,9 @@ int FillPrice(
}
//
if (_mLoopback < 7)
if (_mLoopback < 1)
{
_mLoopback = 7;
_mLoopback = 1;
}
//