last works ...

This commit is contained in:
2025-09-22 21:20:27 +03:30
parent bd5bce9d77
commit 383d58eaed
+113 -5
View File
@@ -32,6 +32,7 @@ struct XPivotAnalysis
{ {
// //
// Props ... // Props ...
string name; // Name ...
string symbol; // Symbol ... string symbol; // Symbol ...
datetime time; // Time ... datetime time; // Time ...
XPivot pivots[]; // Pivots ... XPivot pivots[]; // Pivots ...
@@ -92,6 +93,7 @@ struct XPivotAnalysis
{ {
// //
time = NULL; time = NULL;
name = NULL;
symbol = NULL; symbol = NULL;
period = NULL; period = NULL;
SpecifiedClean(pivots); SpecifiedClean(pivots);
@@ -143,6 +145,7 @@ struct XPivotAnalysis
/** /**
* Initialize Model ... * Initialize Model ...
* *
* @param _name: Name ...
* @param _symbol: Symbol ... * @param _symbol: Symbol ...
* @param _period: Period ... * @param _period: Period ...
* @param _pivots: Provided Pivots ... * @param _pivots: Provided Pivots ...
@@ -150,6 +153,7 @@ struct XPivotAnalysis
* @return ( bool ) * @return ( bool )
*/ */
bool Init( bool Init(
string _name,
string _symbol, string _symbol,
ENUM_TIMEFRAMES _period, ENUM_TIMEFRAMES _period,
XPivot &_pivots[] // XPivot &_pivots[] //
@@ -162,6 +166,7 @@ struct XPivotAnalysis
// Validate Args ... // Validate Args ...
result = result =
HasChild(_pivots) && HasChild(_pivots) &&
IsSpecifiedValid(_name) &&
IsSpecifiedValid(_symbol) && IsSpecifiedValid(_symbol) &&
IsSpecifiedValid(_period); IsSpecifiedValid(_period);
if (!result) if (!result)
@@ -172,6 +177,7 @@ struct XPivotAnalysis
} }
// //
name = _name;
symbol = _symbol; symbol = _symbol;
period = _period; period = _period;
Copy( Copy(
@@ -913,6 +919,107 @@ struct XPivotAnalysis
); );
} }
//
// Boxing Tools ...
/**
* Generate Support Box if Has Strong Supports ...
*
* @param box: a refrence XBoxZone to holds Generated result ...
*
* @return ( bool )
*/
bool HasSupportBox(XBoxZone &box)
{
//
bool result = false;
//
// Prepare ...
box.Clean();
//
// Validate ...
result =
IsValid() &&
IsAnalysed();
if (!result)
{
return result;
}
//
box.to = toTime;
box.symbol = symbol;
box.period = period;
box.from = fromTime;
//
box.upper = minorSupport;
box.lower = majorSupport;
box.dir = X_DIRECTION_BULLISH;
box.type = GetTag() + "_Support";
//
result = box.IsValid();
if (!result)
{
box.Clean();
}
//
return result;
}
/**
* Generate Resistance Box if Has Strong Resistance ...
*
* @param box: a refrence XBoxZone to holds Generated result ...
*
* @return ( bool )
*/
bool HasResistanceBox(XBoxZone &box)
{
//
bool result = false;
//
// Prepare ...
box.Clean();
//
// Validate ...
result =
IsValid() &&
IsAnalysed();
if (!result)
{
return result;
}
//
box.to = toTime;
box.symbol = symbol;
box.period = period;
box.from = fromTime;
//
box.upper = minorResistance;
box.lower = majorResistance;
box.dir = X_DIRECTION_BEARISH;
box.type = GetTag() + "_Resistance";
//
result = box.IsValid();
if (!result)
{
box.Clean();
}
//
return result;
}
// //
// Detecting ... // Detecting ...
@@ -923,7 +1030,7 @@ struct XPivotAnalysis
* *
* @return ( bool ) * @return ( bool )
*/ */
bool IsSameAs(XPivot &item) bool IsSameAs(XPivotAnalysis &item)
{ {
// //
bool result = false; bool result = false;
@@ -932,6 +1039,7 @@ struct XPivotAnalysis
result = IsValid() && result = IsValid() &&
item.IsValid() && item.IsValid() &&
IsSameMarketAs(item) && IsSameMarketAs(item) &&
name == item.name &&
time == item.time; time == item.time;
// //
@@ -945,7 +1053,7 @@ struct XPivotAnalysis
* *
* @return ( bool ) * @return ( bool )
*/ */
bool IsSameSymbolAs(XPivot &item) bool IsSameSymbolAs(XPivotAnalysis &item)
{ {
// //
bool result = false; bool result = false;
@@ -966,7 +1074,7 @@ struct XPivotAnalysis
* *
* @return ( bool ) * @return ( bool )
*/ */
bool IsSamePeriodAs(XPivot &item) bool IsSamePeriodAs(XPivotAnalysis &item)
{ {
// //
bool result = false; bool result = false;
@@ -987,7 +1095,7 @@ struct XPivotAnalysis
* *
* @return ( bool ) * @return ( bool )
*/ */
bool IsSameMarketAs(XPivot &item) bool IsSameMarketAs(XPivotAnalysis &item)
{ {
// //
bool result = false; bool result = false;
@@ -1012,7 +1120,7 @@ struct XPivotAnalysis
*/ */
string GetTag() string GetTag()
{ {
return GetToken(this); return name + GetToken(this);
} }
/** /**