/////////////////////////////////////////////////////// // // SaherElm IT Center MQL5 Class Library // -------------------------------------- // Name: XChartObjects // Description: provides all require Chart Objects ... // // // Maintainer: // ------------ // Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) // ////////////////////////////////////////////////////// // // Global Properties ... #property library #property copyright "Copyright 2023, SaherElm IT Center" #property link "https://www.saherelm.ir" #property version "1.00" #property strict // #include "../../Classes/x-saherelm.x-cobject.class.mq5" #include "../Libraries/x-121.smc.lib.mq5" // // Definitions ... enum ENUM_X121SMC_CHARTOBJECTS { X_XPVPIVOT_OBJ, // XPVPivot Object ... }; // // Implementations ... // // XPVPivot Object ... class XCXPVPivotObject : public XCBaseObject { // public: // /** * Creator ... * * @param chart_id: Long, Specified Chart ID ... * @param window: Integer, Specified Chart Window ID ... * @param pivot: XPVPivot instance ... * @param prefix: String ... * * @return ( bool ) */ bool Create( long chart_id, int window, XPVPivot &pivot, string prefix = NULL // ) { // bool result = false; // result = pivot.IsValid(); if (!result) { return result; } // string name = pivot.GetTag(); if (IsValid(prefix)) { name = prefix + "_" + name; } // result = mRect.Create( chart_id, name, window, pivot.from, pivot.upper, pivot.to, pivot.lower // ); // if (result) { ObjName(name); } // string mTrendName = "MID_" + name; double mid = pivot.CalculateMid(); result = mTrend.Create( chart_id, mTrendName, window, pivot.from, mid, pivot.to, mid // ); if (!result) { // mRect.Delete(); mRect.Detach(); } // return result; } // // Getter(s) / Setter(s) ... /** * Set Pivot Width ... * * @param value: Integer ... */ void PivotWidth(int value) { // if (value < 1) { value = 1; } // mRect.Width(value); mTrend.Width(value); } /** * Set Pivot Color ... * * @param value: Color ... */ void PivotColor(color value) { // mRect.Color(value); mTrend.Color(value); } /** * Set Pivot Style ... * * @param value: ENUM_LINE_STYLE member ... */ void PivotStyle(ENUM_LINE_STYLE value) { // mRect.Style(value); mTrend.Style(value); } /** * Set Pivot Fill ... * * @param value: Boolean ... */ void PivotFill(bool value) { mRect.Fill(value); } // // Virtual ... /** * Retrieve Object Type ... * * @return ( ENUM_X121SMC_CHARTOBJECTS ) */ virtual ENUM_X121SMC_CHARTOBJECTS Type() { return X_XPVPIVOT_OBJ; } // private: // // // Props ... CChartObjectRectangle mRect; CChartObjectTrend mTrend; };