Apply Refactoring Side Affects Resolving in Experts and Indicators ...

This commit is contained in:
2025-09-23 02:07:01 +03:30
parent 11811624d9
commit 1a948307f2
4 changed files with 208 additions and 8 deletions
+203 -3
View File
@@ -240,8 +240,8 @@ class XCPOIDrawer : public XCBase
ulong chartId = ChartIdentification();
int window = SubWindowIdentification();
to = IsSpecifiedValid(to)
? to
: ((datetime)((int)bar.time) + (PeriodSeconds(bar.period) - 1));
? to
: ((datetime)((int)bar.time) + (PeriodSeconds(bar.period) - 1));
object = new XCOHCLObject();
result = object.Create(
chartId,
@@ -262,6 +262,82 @@ class XCPOIDrawer : public XCBase
//
return result;
}
/**
* Draw Bar Arrow Object ...
*
* @param bar: XOHCL instance Reference ...
* @param object: XCBarArrowObject, pointer reference for Drawn Object ...
* @param priceType: ENUM_X_PRICE member ...
* @param arrow: int, Arrow Code ...
* @param clr: color, Arro Color ...
* @param width: int, Arrow Width ...
* @param anchor: ENUM_ARROW_ANCHOR, anchor of Arrow ...
* @param name: string, name of Arrow ...
*
* @return ( bool )
*/
bool DrawBarArrow(
XOHCL &bar,
XCBarArrowObject *&object,
ENUM_X_PRICE priceType,
int arrow = 159,
color clr = clrYellow,
int width = 3,
ENUM_ARROW_ANCHOR anchor = ANCHOR_BOTTOM,
string name = NULL //
)
{
//
bool result = false;
//
object = NULL;
//
result = bar.IsValid();
if (!result)
{
return result;
}
//
string barTag = bar.GetTag(name);
//
string prefix = Prefix();
long chartID = ChartIdentification();
int window = SubWindowIdentification();
//
prefix =
(IsValid(prefix)
? prefix + "_"
: prefix) +
barTag;
//
object = new XCBarArrowObject();
result = object
.CreateByBar(
chartID,
prefix,
window,
arrow,
bar,
priceType //
);
if (result)
{
//
object.ArrowColor(clr);
object.ArrowWidth(width);
object.ArrowAnchor(anchor);
}
//
return result;
}
/**
* Dar Specified Pivot ...
@@ -943,7 +1019,131 @@ class XCPOIDrawer : public XCBase
/**
* Apply Specified Style to Specified Object ...
*
* @param object: CChartObject, pointer reference of Object ...
* @param object: CChartObjectVLine, pointer reference of Object ...
* @param style: XPOIStyle, Specifed Style to Apply ...
*/
void ApplyLineStyle(
CChartObjectVLine *&object,
XPOIStyle &style //
)
{
//
bool has = object != NULL;
if (!has)
{
return;
}
//
object.Color(style.clr);
object.Style(style.style);
object.Width(style.width);
}
/**
* Apply Specified Style to Specified Object ...
*
* @param object: CChartObjectVLine, pointer reference of Object ...
* @param forDir: ENUM_X_DIRECTION, Specified Direction ...
*/
void ApplyLineStyle(
CChartObjectVLine *&object,
ENUM_X_DIRECTION forDir //
)
{
//
bool has = object != NULL;
if (!has)
{
return;
}
//
has = HasDirection(forDir);
if (!has)
{
return;
}
//
XPOIStyle style;
GetStyle(style, forDir);
//
object.Color(style.clr);
object.Style(style.style);
object.Width(style.width);
//
style.Clean();
}
/**
* Apply Specified Style to Specified Object ...
*
* @param object: CChartObjectHLine, pointer reference of Object ...
* @param style: XPOIStyle, Specifed Style to Apply ...
*/
void ApplyLineStyle(
CChartObjectHLine *&object,
XPOIStyle &style //
)
{
//
bool has = object != NULL;
if (!has)
{
return;
}
//
object.Color(style.clr);
object.Style(style.style);
object.Width(style.width);
}
/**
* Apply Specified Style to Specified Object ...
*
* @param object: CChartObjectHLine, pointer reference of Object ...
* @param forDir: ENUM_X_DIRECTION, Specified Direction ...
*/
void ApplyLineStyle(
CChartObjectHLine *&object,
ENUM_X_DIRECTION forDir //
)
{
//
bool has = object != NULL;
if (!has)
{
return;
}
//
has = HasDirection(forDir);
if (!has)
{
return;
}
//
XPOIStyle style;
GetStyle(style, forDir);
//
object.Color(style.clr);
object.Style(style.style);
object.Width(style.width);
//
style.Clean();
}
/**
* Apply Specified Style to Specified Object ...
*
* @param object: CChartObjectTrend, pointer reference of Object ...
* @param forDir: ENUM_X_DIRECTION, Specified Direction ...
*/
void ApplyTrendLineStyle(
+1 -1
View File
@@ -2213,7 +2213,7 @@ void DoProcess(
//
XCBarArrowObject *iObj;
has = mDrawer.CreateBarArrow(
has = mDrawer.DrawBarArrow(
iBar,
iObj,
arrowPriceType,
+1 -1
View File
@@ -2920,7 +2920,7 @@ bool DrawTriggerBlock(
//
XCBarArrowObject *swingObj;
result = drawer.CreateBarArrow(
result = drawer.DrawBarArrow(
_trigger.swingBar,
swingObj,
swingPType,
+3 -3
View File
@@ -123,7 +123,7 @@ class XCXOM1POIDrawer : public XCBase
if (has)
{
//
mDrawer.ApplyStyle(
mDrawer.ApplyTrendLineStyle(
mLineObj,
zone.dir //
);
@@ -154,7 +154,7 @@ class XCXOM1POIDrawer : public XCBase
if (has)
{
//
mDrawer.ApplyStyle(
mDrawer.ApplyTrendLineStyle(
mLineObj,
zone.dir //
);
@@ -181,7 +181,7 @@ class XCXOM1POIDrawer : public XCBase
if (has)
{
//
mDrawer.ApplyStyle(
mDrawer.ApplyLineStyle(
mLineObj,
zone.dir //
);