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 result = false;
//
bool has = false;
// //
// Validate ... // Validate ...
result = model.IsValid(); result = model.IsValid();
@@ -1489,8 +1492,8 @@ class XCPivotAnalysisObject : public XCBaseObject
// //
// Generate Object ID ... // Generate Object ID ...
string objID = model.GetObjectID(); string objID = model.GetObjectID();
string upperName = "Upper_" + objID; string upperName = model.GetUpperObjectID();
string lowerName = "Lower_" + objID; string lowerName = model.GetLowerObjectID();
// //
// Extract Recent Pivots ... // Extract Recent Pivots ...
@@ -1536,18 +1539,21 @@ class XCPivotAnalysisObject : public XCBaseObject
// Support ... // Support ...
XBoxZone tmpBox; XBoxZone tmpBox;
mSupportBox = NULL; mSupportBox = NULL;
if (model.HasSupportBox(tmpBox)) has = model.HasSupportBox(tmpBox);
if (has)
{ {
// //
datetime to = TimeCurrent();
string name = model.GetSupportBoxObjectID();
mSupportBox = new XCBoxObject(); mSupportBox = new XCBoxObject();
mSupportBox.Create( has = mSupportBox.Create(
chart_id, chart_id,
window, window,
tmpBox.GetTag(), name,
tmpBox.upper, tmpBox.upper,
tmpBox.lower, tmpBox.lower,
tmpBox.from, tmpBox.from,
tmpBox.to // to //
); );
} }
@@ -1555,18 +1561,21 @@ class XCPivotAnalysisObject : public XCBaseObject
// Resistance ... // Resistance ...
tmpBox.Clean(); tmpBox.Clean();
mResistanceBox = NULL; mResistanceBox = NULL;
if (model.HasResistanceBox(tmpBox)) has = model.HasResistanceBox(tmpBox);
if (has)
{ {
// //
datetime to = TimeCurrent();
string name = model.GetResistanceBoxObjectID();
mResistanceBox = new XCBoxObject(); mResistanceBox = new XCBoxObject();
mResistanceBox.Create( has = mResistanceBox.Create(
chart_id, chart_id,
window, window,
tmpBox.GetTag(), name,
tmpBox.upper, tmpBox.upper,
tmpBox.lower, tmpBox.lower,
tmpBox.from, tmpBox.from,
tmpBox.to // to //
); );
} }
@@ -1578,7 +1587,6 @@ class XCPivotAnalysisObject : public XCBaseObject
// //
XOHCL iBar; XOHCL iBar;
int arrow = 0; int arrow = 0;
bool has = false;
string name = NULL; string name = NULL;
XCBarArrowObject *iObj; XCBarArrowObject *iObj;
ENUM_X_PRICE type = X_PRICE_NONE; 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.from = fromTime;
// //
box.upper = minorResistance; box.upper = majorResistance;
box.lower = majorResistance; box.lower = minorResistance;
box.dir = X_DIRECTION_BEARISH; box.dir = X_DIRECTION_BEARISH;
box.type = GetTag() + "_Resistance"; box.type = GetTag() + "_Resistance";
@@ -1146,6 +1146,98 @@ struct XPivotAnalysis
return result; 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 ... * Represent as String ...
* *