Issue #209: [MT5] Added function ChartId to get chart id by expert handle.

This commit is contained in:
Viacheslav Demydiuk
2020-10-25 19:20:44 +02:00
parent 60c8a646ff
commit 318bae3852
3 changed files with 33 additions and 2 deletions
+14 -2
View File
@@ -1717,6 +1717,18 @@ namespace MtApi5
return SendCommand<long>(Mt5CommandType.ChartId, null);
}
///<summary>
///Returns the ID of the chart.
///</summary>
///<param name="expertHandle">Handle of expert linked to the chart.</param>
///<returns>
/// Value of long type.
///</returns>
public long ChartId(int expertHandle)
{
return SendCommand<long>(Mt5CommandType.ChartId, null, null, expertHandle);
}
///<summary>
///This function calls a forced redrawing of a specified chart.
///</summary>
@@ -3468,7 +3480,7 @@ namespace MtApi5
ConnectionStateChanged?.Invoke(this, new Mt5ConnectionEventArgs(state, message));
}
private T SendCommand<T>(Mt5CommandType commandType, ArrayList commandParameters, Dictionary<string, object> namedParams = null)
private T SendCommand<T>(Mt5CommandType commandType, ArrayList commandParameters, Dictionary<string, object> namedParams = null, int? executor = null)
{
MtResponse response;
@@ -3480,7 +3492,7 @@ namespace MtApi5
try
{
response = client.SendCommand((int)commandType, commandParameters, namedParams, ExecutorHandle);
response = client.SendCommand((int)commandType, commandParameters, namedParams, executor ?? ExecutorHandle);
}
catch (CommunicationException ex)
{