last works on Detecting Pivots ...

- Pivots Detection works Fine;
- Analyse Pivots Has some issues and i have to Fix them ...
This commit is contained in:
2025-09-23 16:36:53 +03:30
parent 1a948307f2
commit 3812246e5c
9 changed files with 1934 additions and 143 deletions
+99 -6
View File
@@ -262,7 +262,7 @@ class XCPOIDrawer : public XCBase
//
return result;
}
/**
* Draw Bar Arrow Object ...
*
@@ -397,8 +397,8 @@ class XCPOIDrawer : public XCBase
? X_PRICE_HIGH
: X_PRICE_LOW;
XPOIStyle style = pivot.IsPeak()
? defaultBullishStyle
: defaultBearishStyle;
? defaultBearishStyle
: defaultBullishStyle;
ENUM_ARROW_ANCHOR anchor = pivot.IsPeak()
? ANCHOR_BOTTOM
: ANCHOR_TOP;
@@ -431,6 +431,72 @@ class XCPOIDrawer : public XCBase
return result;
}
/**
* Draw Specified Pivot Collection ...
*
* @param pivots: XPivot, reference Collection to Draw ...
* @param draws: CArrayObj, pointer reference to Hold Drawn Objects ...
* @param peakArrow: int, Specified Arrow Code for Peak Pivots ...
* @param valeArrow: int, Specified Arrow Code for Vale Pivots ...
* @param threshold: int, distance between price and arrow in Point ...
*
* @return ( int )
*/
int DrawPivots(
XPivot &pivots[],
CArrayObj *&draws,
int peakArrow = 159,
int valeArrow = 159,
int threshold = 5 //
)
{
//
int result = 0;
//
// Prepare ...
draws.Clear();
//
// Validate ...
if (!HasChild(pivots))
{
return result;
}
//
bool has = false;
XCBarArrowObject *iObj;
int count = ArraySize(pivots);
for (int i = 0; i < count; i++)
{
//
// Draw Indexed Pivot ...
has = DrawPivot(
pivots[i],
iObj,
peakArrow,
valeArrow,
threshold //
);
//
if (has)
{
draws.Add(iObj);
}
//
ZeroMemory(iObj);
}
//
result = draws.Total();
//
return result;
}
/**
* Draw Specified Box ...
*
@@ -811,12 +877,21 @@ class XCPOIDrawer : public XCBase
* Draw Pivot Analysis ...
*
* @param analysis: XPivotAnalysis, referece Specified Pivot Analysis ...
* @param object: XCPivotAnalysisObject, pointer reference for Drawn Object ...
* @param drawPivots: Specified to Draw Pivots or not ...
* @param peakArrow: int, Specified Arrow Code for Peak Pivots ...
* @param valeArrow: int, Specified Arrow Code for Vale Pivots ...
* @param threshold: int, distance between price and arrow in Point ...
*
* @return ( bool )
*/
bool DrawXPivotAnalysis(
bool DrawPivotAnalysis(
XPivotAnalysis &analysis,
XCPivotAnalysisObject *&object //
XCPivotAnalysisObject *&object,
bool drawPivots = true,
int peakArrow = 159,
int valeArrow = 159,
int threshold = 5 //
)
{
//
@@ -843,7 +918,11 @@ class XCPOIDrawer : public XCBase
result = object.Create(
ChartIdentification(),
SubWindowIdentification(),
analysis //
analysis,
drawPivots,
peakArrow,
valeArrow,
threshold //
);
if (result)
{
@@ -1263,6 +1342,20 @@ class XCPOIDrawer : public XCBase
object.LowerRayRight(true);
}
//
// Peak Pivots ...
style = defaultBearishStyle;
object.PeaksColor(style.clr);
object.PeaksWidth(style.width);
object.PeaksAnchor(ANCHOR_BOTTOM);
//
// Vale Pivots ...
style = defaultBullishStyle;
object.ValesColor(style.clr);
object.ValesWidth(style.width);
object.ValesAnchor(ANCHOR_TOP);
//
style.Clean();
}