/////////////////////////////////////////////////////// // // 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 "../Libraries/x-saherelm.common.lib.mq5" // #include #include // // Definitions ... enum ENUM_XCHARTOBJECTS { X_TRADE_DAY, }; enum ENUM_X_TRADE_DAY_IDS { X_TRADE_DAY_FROM, X_TRADE_DAY_TO }; // // Extensions ... /** * Convert ENUM_X_TRADE_DAY_IDS membr to String ... * * @param value: ENUM_X_TRADE_DAY_IDS member ... * * @return ( string ) */ string ToString(ENUM_X_TRADE_DAY_IDS value) { // string result = NULL; // switch (value) { // case X_TRADE_DAY_FROM: result = "XFROM"; break; // case X_TRADE_DAY_TO: result = "XTO"; break; } // return result; } // // Implementation ... class XCTardeDayObject : public CChartObject { // public: // // // Constructors ... void XCTardeDayObject() { } // // Deconstructors ... void ~XCTardeDayObject() { } /** * Create XTradeDayChartObject ... * * @param chart_id: Long ... * @param name: String ... * @param window: Integer ... * @param time1: DateTime ... * @param time2: DateTime ... * * @return ( bool ) */ bool Create( long chart_id, const string name, const int window, const datetime from, const datetime to // ) { // bool result = false; // string mFromVLineName = ToString(X_TRADE_DAY_FROM) + "_" + name; result = mFromVLine.Create(chart_id, mFromVLineName, window, from); if (!result) { return result; } // string mToVLineName = ToString(X_TRADE_DAY_TO) + "_" + name; result = mToVLine.Create(chart_id, mToVLineName, window, to); if (!result) { return result; } // // result = Attach(chart_id, name, window, 2); // if (!result) // { // return result; // } // return result; } /** * Retrieve Object Type ... * * @return ( ENUM_XCHARTOBJECTS ) */ virtual ENUM_XCHARTOBJECTS Type() { return X_TRADE_DAY; } /** * Set From Date Line Color ... * * @param value: Color ... * * @return ( bool ) */ bool FromColor(color value) { return mFromVLine.Color(value); } /** * Set From Date Line Style ... * * @param value: ENUM_LINE_STYLE ... * * @return ( bool ) */ bool FromStyle(ENUM_LINE_STYLE value) { return mFromVLine.Style(value); } /** * Set To Date Line Color ... * * @param value: Color ... * * @return ( bool ) */ bool ToColor(color value) { return mToVLine.Color(value); } /** * Set To Date Line Style ... * * @param value: ENUM_LINE_STYLE ... * * @return ( bool ) */ bool ToStyle(ENUM_LINE_STYLE value) { return mToVLine.Style(value); } // protected: // // private: // CChartObjectVLine mFromVLine; CChartObjectVLine mToVLine; // }; //