fix trending draw issues ...

This commit is contained in:
2025-09-24 16:25:07 +03:30
parent e2b05b6455
commit 7d00ab69cb
6 changed files with 563 additions and 82 deletions
+30 -11
View File
@@ -256,7 +256,8 @@ class XCPOIDrawer : public XCBase
color clr = clrYellow,
int width = 3,
ENUM_ARROW_ANCHOR anchor = ANCHOR_BOTTOM,
string name = NULL //
string name = NULL,
bool ignoreBarTag = true //
)
{
//
@@ -285,7 +286,10 @@ class XCPOIDrawer : public XCBase
(IsValid(prefix)
? prefix + "_"
: prefix) +
ToMD5(barTag);
(IsSpecifiedValid(name)
? name
: "") +
(ignoreBarTag ? "" : ToMD5(barTag));
//
object = new XCBarArrowObject();
@@ -404,13 +408,13 @@ class XCPOIDrawer : public XCBase
/**
* 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(
@@ -787,7 +791,7 @@ class XCPOIDrawer : public XCBase
//
// Prepare ...
object = NULL;
//
int count = ArraySize(swings);
result = HasChild(swings) &&
@@ -801,19 +805,31 @@ class XCPOIDrawer : public XCBase
//
bool isBullish = IsSpecifiedBullish(dir);
//
XOHCL _swings[];
Copy(
swings,
_swings //
);
SortBar(
_swings,
X_SORT_BY_DATE,
X_DIRECTION_BULLISH //
);
//
double price1 =
isBullish
? swings[0].low
: swings[0].high;
datetime time1 = swings[0].time;
? _swings[0].low
: _swings[0].high;
datetime time1 = _swings[0].time;
//
double price2 =
isBullish
? swings[count - 1].low
: swings[count - 1].high;
datetime time2 = swings[count - 1].time;
? _swings[count - 1].low
: _swings[count - 1].high;
datetime time2 = _swings[count - 1].time;
//
ulong chartId = ChartIdentification();
@@ -844,6 +860,9 @@ class XCPOIDrawer : public XCBase
object.RayRight(rayRight);
}
//
SpecifiedClean(_swings);
//
return result;
}