diff --git a/Classes/x-saherelm.x-poi.drawer.class.mq5 b/Classes/x-saherelm.x-poi.drawer.class.mq5 index f1185c31..5e59d887 100644 --- a/Classes/x-saherelm.x-poi.drawer.class.mq5 +++ b/Classes/x-saherelm.x-poi.drawer.class.mq5 @@ -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( diff --git a/Indicators/x-saherelm.x121.xma.mq5 b/Indicators/x-saherelm.x121.xma.mq5 index 0e71ed37..5e72fb8f 100644 --- a/Indicators/x-saherelm.x121.xma.mq5 +++ b/Indicators/x-saherelm.x121.xma.mq5 @@ -2213,7 +2213,7 @@ void DoProcess( // XCBarArrowObject *iObj; - has = mDrawer.CreateBarArrow( + has = mDrawer.DrawBarArrow( iBar, iObj, arrowPriceType, diff --git a/XCATBEA/Libraries/xcatbea.lib.mq5 b/XCATBEA/Libraries/xcatbea.lib.mq5 index 992ab893..c3c1442f 100644 --- a/XCATBEA/Libraries/xcatbea.lib.mq5 +++ b/XCATBEA/Libraries/xcatbea.lib.mq5 @@ -2920,7 +2920,7 @@ bool DrawTriggerBlock( // XCBarArrowObject *swingObj; - result = drawer.CreateBarArrow( + result = drawer.DrawBarArrow( _trigger.swingBar, swingObj, swingPType, diff --git a/XOM1EA/Classes/xom1ea.x-poi.drawer.class.mq5 b/XOM1EA/Classes/xom1ea.x-poi.drawer.class.mq5 index 9f378416..52807c93 100644 --- a/XOM1EA/Classes/xom1ea.x-poi.drawer.class.mq5 +++ b/XOM1EA/Classes/xom1ea.x-poi.drawer.class.mq5 @@ -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 // );