Updated MtApi5

This commit is contained in:
Viacheslav Demydiuk
2024-06-16 13:27:00 +03:00
parent 78e28dc176
commit e7cf0dddd0
3 changed files with 53 additions and 82 deletions
+2 -6
View File
@@ -19,9 +19,6 @@ namespace MtApi5
#endregion
private const char ParamSeparator = ';';
private const string LogProfileName = "MtApi5Client";
public delegate void QuoteHandler(object sender, string symbol, double bid, double ask);
@@ -1776,7 +1773,6 @@ namespace MtApi5
Dictionary<string, object> cmdParams = new() { { "ChartId", chartId }, { "SubWindow", subWindow },
{ "Time", Mt5TimeConverter.ConvertToMtTime(time) }, { "Price", price } };
Dictionary<string, int> XY = [];
var response = SendCommand<FuncResult<Dictionary<string,int>>>(ExecutorHandle, Mt5CommandType.ChartTimePriceToXY, cmdParams);
if (response != null && response.Result != null
&& response.Result.TryGetValue("X", out x)
@@ -2247,9 +2243,9 @@ namespace MtApi5
public bool ObjectCreate(long chartId, string name, ENUM_OBJECT type, int nwin, DateTime time, double price, List<Tuple<DateTime, double>>? listOfCoordinates = null)
{
//Count the additional coordinates
int iAdditionalCoordinates = (listOfCoordinates != null) ? listOfCoordinates.Count() : 0;
int iAdditionalCoordinates = (listOfCoordinates != null) ? listOfCoordinates.Count : 0;
if(iAdditionalCoordinates > 29)
throw new ArgumentOutOfRangeException("listOfCoordinates", "The maximum amount of coordinates in 30.");
throw new ArgumentOutOfRangeException(nameof(listOfCoordinates), "The maximum amount of coordinates in 30.");
Dictionary<string, object> cmdParams = new() { { "ChartId", chartId }, { "Name", name ?? string.Empty },
{ "Type", (int)type }, { "Nwin", nwin } };