last works on Fix and Resolve XPivotAnalysis Calculations and Drawn ...

This commit is contained in:
2025-09-23 21:34:15 +03:30
parent b18bed4a2b
commit 727344d27a
2 changed files with 119 additions and 19 deletions
+25 -17
View File
@@ -1478,6 +1478,9 @@ class XCPivotAnalysisObject : public XCBaseObject
//
bool result = false;
//
bool has = false;
//
// Validate ...
result = model.IsValid();
@@ -1489,8 +1492,8 @@ class XCPivotAnalysisObject : public XCBaseObject
//
// Generate Object ID ...
string objID = model.GetObjectID();
string upperName = "Upper_" + objID;
string lowerName = "Lower_" + objID;
string upperName = model.GetUpperObjectID();
string lowerName = model.GetLowerObjectID();
//
// Extract Recent Pivots ...
@@ -1536,18 +1539,21 @@ class XCPivotAnalysisObject : public XCBaseObject
// Support ...
XBoxZone tmpBox;
mSupportBox = NULL;
if (model.HasSupportBox(tmpBox))
has = model.HasSupportBox(tmpBox);
if (has)
{
//
datetime to = TimeCurrent();
string name = model.GetSupportBoxObjectID();
mSupportBox = new XCBoxObject();
mSupportBox.Create(
has = mSupportBox.Create(
chart_id,
window,
tmpBox.GetTag(),
name,
tmpBox.upper,
tmpBox.lower,
tmpBox.from,
tmpBox.to //
to //
);
}
@@ -1555,18 +1561,21 @@ class XCPivotAnalysisObject : public XCBaseObject
// Resistance ...
tmpBox.Clean();
mResistanceBox = NULL;
if (model.HasResistanceBox(tmpBox))
has = model.HasResistanceBox(tmpBox);
if (has)
{
//
datetime to = TimeCurrent();
string name = model.GetResistanceBoxObjectID();
mResistanceBox = new XCBoxObject();
mResistanceBox.Create(
has = mResistanceBox.Create(
chart_id,
window,
tmpBox.GetTag(),
name,
tmpBox.upper,
tmpBox.lower,
tmpBox.from,
tmpBox.to //
to //
);
}
@@ -1578,7 +1587,6 @@ class XCPivotAnalysisObject : public XCBaseObject
//
XOHCL iBar;
int arrow = 0;
bool has = false;
string name = NULL;
XCBarArrowObject *iObj;
ENUM_X_PRICE type = X_PRICE_NONE;
@@ -1799,7 +1807,7 @@ class XCPivotAnalysisObject : public XCBaseObject
}
//
mSupportBox.Width(value);
mSupportBox.BoxWidth(value);
}
/**
@@ -1816,7 +1824,7 @@ class XCPivotAnalysisObject : public XCBaseObject
}
//
mSupportBox.Color(value);
mSupportBox.BoxColor(value);
}
/**
@@ -1833,7 +1841,7 @@ class XCPivotAnalysisObject : public XCBaseObject
}
//
mSupportBox.Style(value);
mSupportBox.BoxStyle(value);
}
/**
@@ -1856,7 +1864,7 @@ class XCPivotAnalysisObject : public XCBaseObject
}
//
mResistanceBox.Width(value);
mResistanceBox.BoxWidth(value);
}
/**
@@ -1873,7 +1881,7 @@ class XCPivotAnalysisObject : public XCBaseObject
}
//
mResistanceBox.Color(value);
mResistanceBox.BoxColor(value);
}
/**
@@ -1890,7 +1898,7 @@ class XCPivotAnalysisObject : public XCBaseObject
}
//
mResistanceBox.Style(value);
mResistanceBox.BoxStyle(value);
}
/**
+94 -2
View File
@@ -1004,8 +1004,8 @@ struct XPivotAnalysis
box.from = fromTime;
//
box.upper = minorResistance;
box.lower = majorResistance;
box.upper = majorResistance;
box.lower = minorResistance;
box.dir = X_DIRECTION_BEARISH;
box.type = GetTag() + "_Resistance";
@@ -1146,6 +1146,98 @@ struct XPivotAnalysis
return result;
}
/**
* Represent an String Unique Identifier for Upper Trend Chart Objects ...
*
* @return ( string )
*/
string GetUpperObjectID()
{
//
string result = "";
//
if (!IsValid())
{
return result;
}
//
result = GetTag() + "_" + symbol + "_" + ToXString(period) + "_UPPER_" + ToXString(TimeToSeconds(time));
//
return result;
}
/**
* Represent an String Unique Identifier for Lower Trend Chart Objects ...
*
* @return ( string )
*/
string GetLowerObjectID()
{
//
string result = "";
//
if (!IsValid())
{
return result;
}
//
result = GetTag() + "_" + symbol + "_" + ToXString(period) + "_LOWER_" + ToXString(TimeToSeconds(time));
//
return result;
}
/**
* Represent an String Unique Identifier for Support Box Chart Objects ...
*
* @return ( string )
*/
string GetSupportBoxObjectID()
{
//
string result = "";
//
if (!IsValid())
{
return result;
}
//
result = GetTag() + "_" + symbol + "_" + ToXString(period) + "_SUPPORT_" + ToXString(TimeToSeconds(time));
//
return result;
}
/**
* Represent an String Unique Identifier for Resistance BOX Chart Objects ...
*
* @return ( string )
*/
string GetResistanceBoxObjectID()
{
//
string result = "";
//
if (!IsValid())
{
return result;
}
//
result = GetTag() + "_" + symbol + "_" + ToXString(period) + "_RESISTANCE_" + ToXString(TimeToSeconds(time));
//
return result;
}
/**
* Represent as String ...
*