From 6b327e017a1c53b1545be1bfd37c8c8795149c1d Mon Sep 17 00:00:00 2001 From: vdemydiuk Date: Tue, 27 Mar 2018 11:11:33 +0300 Subject: [PATCH] Removed unnecessary Windows Operations from MtApi5 code (MT5) --- MtApi5/Mt5CommandType.cs | 18 ---- MtApi5/MtApi5Client.cs | 195 --------------------------------------- 2 files changed, 213 deletions(-) diff --git a/MtApi5/Mt5CommandType.cs b/MtApi5/Mt5CommandType.cs index 7232feb0..6174e005 100755 --- a/MtApi5/Mt5CommandType.cs +++ b/MtApi5/Mt5CommandType.cs @@ -213,24 +213,6 @@ namespace MtApi5 ChartIndicatorAdd = 280, ChartIndicatorGet = 281, - // Windows Operations - WindowBarsPerChart = 264, - WindowExpertName = 265, - WindowFind = 266, - WindowFirstVisibleBar = 267, - WindowHandle = 268, - WindowIsVisible = 269, - WindowOnDropped = 270, - WindowPriceMax = 271, - WindowPriceMin = 272, - WindowPriceOnDropped = 273, - WindowRedraw = 274, - WindowScreenShot = 275, - WindowTimeOnDropped = 276, - WindowsTotal = 277, - WindowXOnDropped = 278, - WindowYOnDropped = 279, - // Terminal Operations TerminalCompany = 68, TerminalName = 69, diff --git a/MtApi5/MtApi5Client.cs b/MtApi5/MtApi5Client.cs index 36c1cf66..72d48e3c 100755 --- a/MtApi5/MtApi5Client.cs +++ b/MtApi5/MtApi5Client.cs @@ -1943,201 +1943,6 @@ namespace MtApi5 var commandParameters = new ArrayList { chartId, filename, width, height, (int)alignMode }; return SendCommand(Mt5CommandType.ChartScreenShot, commandParameters); } - - /// - ///Returns the amount of bars visible on the chart. - /// - /// - ///The amount of bars visible on the chart. - /// - public int WindowBarsPerChart() - { - return SendCommand(Mt5CommandType.WindowBarsPerChart, null); - } - - /// - ///Returns the name of the executed Expert Advisor, script, custom indicator, or library. - /// - /// - ///The name of the executed Expert Advisor, script, custom indicator, or library, depending on the MQL4 program, from which this function has been called. - /// - public string WindowExpertName() - { - return SendCommand(Mt5CommandType.WindowExpertName, null); - } - - /// - ///Returns the window index containing this specified indicator. - /// - ///Indicator short name. - /// - ///If indicator with name was found, the function returns the window index containing this specified indicator, otherwise it returns -1. - /// - public int WindowFind(string name) - { - var commandParameters = new ArrayList { name }; - return SendCommand(Mt5CommandType.WindowFind, commandParameters); - } - - /// - ///Returns index of the first visible bar in the current chart window. - /// - /// - ///Index of the first visible bar number in the current chart window. - /// - public int WindowFirstVisibleBar() - { - return SendCommand(Mt5CommandType.WindowFirstVisibleBar, null); - } - - /// - ///Returns the system handle of the chart window. - /// - ///Symbol. - ///Timeframe. It can be any of Timeframe enumeration values. 0 means the current chart timeframe. - /// - ///Returns the system handle of the chart window. If the chart of symbol and timeframe has not been opened by the moment of function calling, 0 will be returned. - /// - public int WindowHandle(string symbol, int timeframe) - { - var commandParameters = new ArrayList { symbol, timeframe }; - return SendCommand(Mt5CommandType.WindowHandle, commandParameters); - } - - /// - ///Returns the visibility flag of the chart subwindow. - /// - ///Subwindow index. - /// - ///Returns true if the chart subwindow is visible, otherwise returns false. The chart subwindow can be hidden due to the visibility properties of the indicator placed in it. - /// - public bool WindowIsVisible(int index) - { - var commandParameters = new ArrayList { index }; - return SendCommand(Mt5CommandType.WindowIsVisible, commandParameters); - } - - /// - ///Returns the window index where Expert Advisor, custom indicator or script was dropped. - /// - /// - ///The window index where Expert Advisor, custom indicator or script was dropped. This value is valid if the Expert Advisor, custom indicator or script was dropped by mouse. - /// - public int WindowOnDropped() - { - return SendCommand(Mt5CommandType.WindowOnDropped, null); - } - - /// - ///Returns the maximal value of the vertical scale of the specified subwindow of the current chart. - /// - ///Chart subwindow index (0 - main chart window). - /// - ///The maximal value of the vertical scale of the specified subwindow of the current chart. - /// - public int WindowPriceMax(int index = 0) - { - var commandParameters = new ArrayList { index }; - return SendCommand(Mt5CommandType.WindowPriceMax, commandParameters); - } - - /// - ///Returns the minimal value of the vertical scale of the specified subwindow of the current chart. - /// - ///Chart subwindow index (0 - main chart window). - /// - ///The minimal value of the vertical scale of the specified subwindow of the current chart. - /// - public int WindowPriceMin(int index = 0) - { - var commandParameters = new ArrayList { index }; - return SendCommand(Mt5CommandType.WindowPriceMin, commandParameters); - } - - /// - ///Returns the price of the chart point where Expert Advisor or script was dropped. - /// - /// - ///The price of the chart point where Expert Advisor or script was dropped. This value is only valid if the expert or script was dropped by mouse. - /// - public double WindowPriceOnDropped() - { - return SendCommand(Mt5CommandType.WindowPriceOnDropped, null); - } - - /// - ///Redraws the current chart forcedly. - /// - /// - ///Redraws the current chart forcedly. It is normally used after the objects properties have been changed. - /// - public void WindowRedraw() - { - SendCommand(Mt5CommandType.WindowRedraw, null); - } - - /// - ///Saves current chart screen shot as a GIF file. - /// - ///Screen shot file name. Screenshot is saved to \Files folder. - ///Screen shot width in pixels. - ///Screen shot height in pixels. - ///Index of the first visible bar in the screen shot. If 0 value is set, the current first visible bar will be shot. If no value or negative value has been set, the end-of-chart screen shot will be produced, indent being taken into consideration. - ///Horizontal chart scale for screen shot. Can be in the range from 0 to 5. If no value or negative value has been set, the current chart scale will be used. - /// Chart displaying mode. It can take the following values: CHART_BAR (0 is a sequence of bars), CHART_CANDLE (1 is a sequence of candlesticks), CHART_LINE (2 is a close prices line). If no value or negative value has been set, the chart will be shown in its current mode. - /// - ///Returns true if succeed, otherwise false. - /// - public bool WindowScreenShot(string filename, int sizeX, int sizeY, int startBar = -1, int chartScale = -1, int chartMode = -1) - { - var commandParameters = new ArrayList { filename, sizeX, sizeY, startBar, chartScale, chartMode }; - return SendCommand(Mt5CommandType.WindowScreenShot, commandParameters); - } - - /// - ///Returns the time of the chart point where Expert Advisor or script was dropped. - /// - /// - ///The time value of the chart point where expert or script was dropped. This value is only valid if the expert or script was dropped by mouse. - /// - public DateTime WindowTimeOnDropped() - { - var res = SendCommand(Mt5CommandType.WindowTimeOnDropped, null); - return Mt5TimeConverter.ConvertFromMtTime(res); - } - - /// - ///Returns total number of indicator windows on the chart. - /// - /// - ///Total number of indicator windows on the chart (including main chart). - /// - public int WindowsTotal() - { - return SendCommand(Mt5CommandType.WindowsTotal, null); - } - - /// - ///Returns the value at X axis in pixels for the chart window client area point at which the Expert Advisor or script was dropped. - /// - /// - ///The value at X axis in pixels for the chart window client area point at which the expert or script was dropped. The value will be true only if the expert or script were moved with the mouse ("Drag'n'Drop") technique. - /// - public int WindowXOnDropped() - { - return SendCommand(Mt5CommandType.WindowXOnDropped, null); - } - - /// - ///Returns the value at Y axis in pixels for the chart window client area point at which the Expert Advisor or script was dropped. - /// - /// - ///Returns the value at Y axis in pixels for the chart window client area point at which the Expert Advisor or script was dropped. The value will be true only if the expert or script were moved with the mouse ("Drag'n'Drop") technique. - /// - public int WindowYOnDropped() - { - return SendCommand(Mt5CommandType.WindowYOnDropped, null); - } #endregion #region Commands of Terminal