mirror of
https://github.com/vdemydiuk/mtapi.git
synced 2026-08-20 22:28:17 +00:00
Implemented functions ChartIndicatorAdd and ChartIndicatorGet
This commit is contained in:
@@ -179,8 +179,6 @@ namespace MtApi5
|
||||
|
||||
IndicatorRelease = 131,
|
||||
|
||||
|
||||
|
||||
//Chart Operations
|
||||
ChartId = 206,
|
||||
ChartRedraw = 207,
|
||||
@@ -212,7 +210,9 @@ namespace MtApi5
|
||||
ChartYOnDropped = 261,
|
||||
ChartSetSymbolPeriod = 262,
|
||||
ChartScreenShot = 263,
|
||||
|
||||
ChartIndicatorAdd = 280,
|
||||
ChartIndicatorGet = 281,
|
||||
|
||||
// Windows Operations
|
||||
WindowBarsPerChart = 264,
|
||||
WindowExpertName = 265,
|
||||
|
||||
@@ -1797,6 +1797,21 @@ namespace MtApi5
|
||||
return SendCommand<bool>(Mt5CommandType.ChartNavigate, commandParameters);
|
||||
}
|
||||
|
||||
///<summary>
|
||||
///Adds an indicator with the specified handle into a specified chart window. Indicator and chart should be generated on the same symbol and time frame.
|
||||
///</summary>
|
||||
///<param name="chartId">Chart ID. 0 means the current chart.</param>
|
||||
///<param name="subWindow">Number of the chart subwindow. 0 denotes the main chart subwindow.</param>
|
||||
///<param name="indicatorHandle">The handle of the indicator.</param>
|
||||
///<returns>
|
||||
///The function returns true in case of success, otherwise it returns false.
|
||||
///</returns>
|
||||
public bool ChartIndicatorAdd(long chartId, int subWindow, int indicatorHandle)
|
||||
{
|
||||
var commandParameters = new ArrayList { chartId, subWindow, indicatorHandle };
|
||||
return SendCommand<bool>(Mt5CommandType.ChartIndicatorAdd, commandParameters);
|
||||
}
|
||||
|
||||
///<summary>
|
||||
///Removes an indicator with a specified name from the specified chart window.
|
||||
///</summary>
|
||||
@@ -1812,6 +1827,21 @@ namespace MtApi5
|
||||
return SendCommand<bool>(Mt5CommandType.ChartIndicatorDelete, commandParameters);
|
||||
}
|
||||
|
||||
///<summary>
|
||||
///Returns the handle of the indicator with the specified short name in the specified chart window.
|
||||
///</summary>
|
||||
///<param name="chartId">Chart ID. 0 means the current chart.</param>
|
||||
///<param name="subWindow">Number of the chart subwindow. 0 denotes the main chart subwindow.</param>
|
||||
///<param name="indicatorShortname">The short name of the indicator which is set in the INDICATOR_SHORTNAME property with the IndicatorSetString() function. To get the short name of an indicator use the ChartIndicatorName() function.</param>
|
||||
///<returns>
|
||||
///Returns an indicator handle if successful, otherwise returns INVALID_HANDLE.
|
||||
///</returns>
|
||||
public int ChartIndicatorGet(long chartId, int subWindow, string indicatorShortname)
|
||||
{
|
||||
var commandParameters = new ArrayList { chartId, subWindow, indicatorShortname };
|
||||
return SendCommand<int>(Mt5CommandType.ChartIndicatorGet, commandParameters);
|
||||
}
|
||||
|
||||
///<summary>
|
||||
///Returns the short name of the indicator by the number in the indicators list on the specified chart window.
|
||||
///</summary>
|
||||
|
||||
Reference in New Issue
Block a user