Apply Refactoring Side Affects Resolving in Experts and Indicators ...
This commit is contained in:
@@ -240,8 +240,8 @@ class XCPOIDrawer : public XCBase
|
|||||||
ulong chartId = ChartIdentification();
|
ulong chartId = ChartIdentification();
|
||||||
int window = SubWindowIdentification();
|
int window = SubWindowIdentification();
|
||||||
to = IsSpecifiedValid(to)
|
to = IsSpecifiedValid(to)
|
||||||
? to
|
? to
|
||||||
: ((datetime)((int)bar.time) + (PeriodSeconds(bar.period) - 1));
|
: ((datetime)((int)bar.time) + (PeriodSeconds(bar.period) - 1));
|
||||||
object = new XCOHCLObject();
|
object = new XCOHCLObject();
|
||||||
result = object.Create(
|
result = object.Create(
|
||||||
chartId,
|
chartId,
|
||||||
@@ -262,6 +262,82 @@ class XCPOIDrawer : public XCBase
|
|||||||
//
|
//
|
||||||
return result;
|
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 ...
|
* Dar Specified Pivot ...
|
||||||
@@ -943,7 +1019,131 @@ class XCPOIDrawer : public XCBase
|
|||||||
/**
|
/**
|
||||||
* Apply Specified Style to Specified Object ...
|
* 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 ...
|
* @param forDir: ENUM_X_DIRECTION, Specified Direction ...
|
||||||
*/
|
*/
|
||||||
void ApplyTrendLineStyle(
|
void ApplyTrendLineStyle(
|
||||||
|
|||||||
@@ -2213,7 +2213,7 @@ void DoProcess(
|
|||||||
|
|
||||||
//
|
//
|
||||||
XCBarArrowObject *iObj;
|
XCBarArrowObject *iObj;
|
||||||
has = mDrawer.CreateBarArrow(
|
has = mDrawer.DrawBarArrow(
|
||||||
iBar,
|
iBar,
|
||||||
iObj,
|
iObj,
|
||||||
arrowPriceType,
|
arrowPriceType,
|
||||||
|
|||||||
@@ -2920,7 +2920,7 @@ bool DrawTriggerBlock(
|
|||||||
|
|
||||||
//
|
//
|
||||||
XCBarArrowObject *swingObj;
|
XCBarArrowObject *swingObj;
|
||||||
result = drawer.CreateBarArrow(
|
result = drawer.DrawBarArrow(
|
||||||
_trigger.swingBar,
|
_trigger.swingBar,
|
||||||
swingObj,
|
swingObj,
|
||||||
swingPType,
|
swingPType,
|
||||||
|
|||||||
@@ -123,7 +123,7 @@ class XCXOM1POIDrawer : public XCBase
|
|||||||
if (has)
|
if (has)
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
mDrawer.ApplyStyle(
|
mDrawer.ApplyTrendLineStyle(
|
||||||
mLineObj,
|
mLineObj,
|
||||||
zone.dir //
|
zone.dir //
|
||||||
);
|
);
|
||||||
@@ -154,7 +154,7 @@ class XCXOM1POIDrawer : public XCBase
|
|||||||
if (has)
|
if (has)
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
mDrawer.ApplyStyle(
|
mDrawer.ApplyTrendLineStyle(
|
||||||
mLineObj,
|
mLineObj,
|
||||||
zone.dir //
|
zone.dir //
|
||||||
);
|
);
|
||||||
@@ -181,7 +181,7 @@ class XCXOM1POIDrawer : public XCBase
|
|||||||
if (has)
|
if (has)
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
mDrawer.ApplyStyle(
|
mDrawer.ApplyLineStyle(
|
||||||
mLineObj,
|
mLineObj,
|
||||||
zone.dir //
|
zone.dir //
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user