MtApi5: updated some function for working with new core

This commit is contained in:
Viacheslav Demydiuk
2024-02-03 20:59:59 +02:00
parent df95872029
commit ad822af2f2
2 changed files with 154 additions and 194 deletions
+138 -189
View File
@@ -5,6 +5,7 @@ using MtClient;
using MtApi5.MtProtocol; using MtApi5.MtProtocol;
using System.Linq; using System.Linq;
using System.Net.Http.Headers; using System.Net.Http.Headers;
using Newtonsoft.Json.Linq;
namespace MtApi5 namespace MtApi5
{ {
@@ -131,12 +132,9 @@ namespace MtApi5
return false; return false;
} }
var response = SendRequest<OrderSendResult>(new OrderSendRequest Dictionary<string, object> commandParameters = new() { { "TradeRequest", request } };
{ var response = SendCommand<FuncResult<MqlTradeResult>>(ExecutorHandle, Mt5CommandType.OrderSend, commandParameters);
TradeRequest = request result = response?.Result;
});
result = response?.TradeResult;
return response != null && response.RetVal; return response != null && response.RetVal;
} }
@@ -163,12 +161,9 @@ namespace MtApi5
return false; return false;
} }
var response = SendRequest<OrderSendResult>(new OrderSendAsyncRequest Dictionary<string, object> commandParameters = new() { { "TradeRequest", request } };
{ var response = SendCommand<FuncResult<MqlTradeResult>>(ExecutorHandle, Mt5CommandType.OrderSendAsync, commandParameters);
TradeRequest = request result = response?.Result;
});
result = response?.TradeResult;
return response != null && response.RetVal; return response != null && response.RetVal;
} }
@@ -244,12 +239,9 @@ namespace MtApi5
return false; return false;
} }
var response = SendRequest<OrderCheckResult>(new OrderCheckRequest Dictionary<string, object> commandParameters = new() { { "TradeRequest", request } };
{ var response = SendCommand<FuncResult<MqlTradeCheckResult>>(ExecutorHandle, Mt5CommandType.OrderCheck, commandParameters);
TradeRequest = request result = response?.Result;
});
result = response?.TradeCheckResult;
return response != null && response.RetVal; return response != null && response.RetVal;
} }
@@ -610,13 +602,10 @@ namespace MtApi5
{ {
Log?.Debug($"PositionClose: ticket = {ticket}, deviation = {deviation}"); Log?.Debug($"PositionClose: ticket = {ticket}, deviation = {deviation}");
var response = SendRequest<PositionCloseResult>(new PositionCloseRequest Dictionary<string, object> cmdParams = new() { { "Ticket", ticket }, { "Deviation", deviation } };
{ var response = SendCommand<FuncResult<MqlTradeResult>>(ExecutorHandle, Mt5CommandType.PositionClose, cmdParams);
Ticket = ticket,
Deviation = deviation
});
result = response?.TradeResult; result = response?.Result;
return response != null && response.RetVal; return response != null && response.RetVal;
} }
@@ -643,9 +632,10 @@ namespace MtApi5
/// <returns>true - successful check of the basic structures, otherwise - false.</returns> /// <returns>true - successful check of the basic structures, otherwise - false.</returns>
public bool PositionOpen(string symbol, ENUM_ORDER_TYPE orderType, double volume, double price, double sl, double tp, string comment = "") public bool PositionOpen(string symbol, ENUM_ORDER_TYPE orderType, double volume, double price, double sl, double tp, string comment = "")
{ {
var commandParameters = new ArrayList { symbol, (int) orderType, volume, price, sl, tp, comment }; Dictionary<string, object> cmdParams = new() { { "Symbol", symbol }, { "OrderType", (int)orderType },
{ "Volume", volume }, { "Price", price }, { "Sl", sl }, { "Tp", tp }, { "Comment", comment } };
return SendCommand<bool>(Mt5CommandType.PositionOpen, commandParameters); var response = SendCommand<bool>(ExecutorHandle, Mt5CommandType.PositionOpen, cmdParams);
return response;
} }
/// <summary> /// <summary>
@@ -660,22 +650,17 @@ namespace MtApi5
/// <param name="comment">comment</param> /// <param name="comment">comment</param>
/// <param name="result">output result</param> /// <param name="result">output result</param>
/// <returns>true - successful check of the basic structures, otherwise - false.</returns> /// <returns>true - successful check of the basic structures, otherwise - false.</returns>
public bool PositionOpen(string symbol, ENUM_ORDER_TYPE orderType, double volume, double price, double sl, double tp, string comment, out MqlTradeResult? result) public bool PositionOpen(string symbol, ENUM_ORDER_TYPE orderType, double volume, double price, double sl, double tp, string? comment, out MqlTradeResult? result)
{ {
Log?.Debug($"PositionOpen: symbol = {symbol}, orderType = {orderType}, volume = {volume}, price = {price}, sl = {sl}, tp = {tp}, comment = {comment}"); Log?.Debug($"PositionOpen: symbol = {symbol}, orderType = {orderType}, volume = {volume}, price = {price}, sl = {sl}, tp = {tp}, comment = {comment}");
var response = SendRequest<OrderSendResult>(new PositionOpenRequest Dictionary<string, object> cmdParams = new() { { "Symbol", symbol }, { "OrderType", (int)orderType },
{ { "Volume", volume }, { "Price", price }, { "Sl", sl }, { "Tp", tp } };
Symbol = symbol, if (comment != null)
OrderType = orderType, cmdParams["Comment"] = comment;
Volume = volume, var response = SendCommand<FuncResult<MqlTradeResult>>(ExecutorHandle, Mt5CommandType.PositionOpen2, cmdParams);
Price = price,
Sl = sl,
Tp = tp,
Comment = comment
});
result = response?.TradeResult; result = response?.Result;
return response != null && response.RetVal; return response != null && response.RetVal;
} }
@@ -738,17 +723,15 @@ namespace MtApi5
{ {
Log?.Debug($"Buy: volume = {volume}, symbol = {symbol}, sl = {sl}, tp = {tp}, comment = {comment}"); Log?.Debug($"Buy: volume = {volume}, symbol = {symbol}, sl = {sl}, tp = {tp}, comment = {comment}");
var response = SendRequest<OrderSendResult>(new BuyRequest Dictionary<string, object> cmdParams = new() { { "Volume", volume }, { "Price", price }, { "Sl", sl }, { "Tp", tp } };
{ if (symbol != null)
Volume = volume, cmdParams["Symbol"] = symbol;
Symbol = symbol, if (comment != null)
Price = price, cmdParams["Comment"] = comment;
Sl = sl,
Tp = tp,
Comment = comment
});
result = response?.TradeResult; var response = SendCommand<FuncResult<MqlTradeResult>>(ExecutorHandle, Mt5CommandType.Buy, cmdParams);
result = response?.Result;
return response != null && response.RetVal; return response != null && response.RetVal;
} }
@@ -767,17 +750,15 @@ namespace MtApi5
{ {
Log?.Debug($"Sell: volume = {volume}, symbol = {symbol}, sl = {sl}, tp = {tp}, comment = {comment}"); Log?.Debug($"Sell: volume = {volume}, symbol = {symbol}, sl = {sl}, tp = {tp}, comment = {comment}");
var response = SendRequest<OrderSendResult>(new SellRequest Dictionary<string, object> cmdParams = new() { { "Volume", volume }, { "Price", price }, { "Sl", sl }, { "Tp", tp } };
{ if (symbol != null)
Volume = volume, cmdParams["Symbol"] = symbol;
Symbol = symbol, if (comment != null)
Price = price, cmdParams["Comment"] = comment;
Sl = sl,
Tp = tp,
Comment = comment
});
result = response?.TradeResult; var response = SendCommand<FuncResult<MqlTradeResult>>(ExecutorHandle, Mt5CommandType.Sell, cmdParams);
result = response?.Result;
return response != null && response.RetVal; return response != null && response.RetVal;
} }
#endregion #endregion
@@ -1465,15 +1446,11 @@ namespace MtApi5
///<param name="from">The date from which you want to request ticks. In milliseconds since 1970.01.01. If from=0, the last count ticks will be returned.</param> ///<param name="from">The date from which you want to request ticks. In milliseconds since 1970.01.01. If from=0, the last count ticks will be returned.</param>
///<param name="count">The number of ticks that you want to receive. If the 'from' and 'count' parameters are not specified, all available recent ticks (but not more than 2000) will be written to result.</param> ///<param name="count">The number of ticks that you want to receive. If the 'from' and 'count' parameters are not specified, all available recent ticks (but not more than 2000) will be written to result.</param>
///<see href="https://www.mql5.com/en/docs/series/copyticks"/> ///<see href="https://www.mql5.com/en/docs/series/copyticks"/>
public List<MqlTick> CopyTicks(string symbolName, CopyTicksFlag flags = CopyTicksFlag.All, ulong from = 0, uint count = 0) public List<MqlTick>? CopyTicks(string symbolName, CopyTicksFlag flags = CopyTicksFlag.All, ulong from = 0, uint count = 0)
{ {
var response = SendRequest<List<MqlTick>>(new CopyTicksRequest Dictionary<string, object> cmdParams = new() { { "Symbol", symbolName }, { "Flags", flags },
{ { "From", from }, { "Count", count } };
SymbolName = symbolName, var response = SendCommand<List<MqlTick>>(ExecutorHandle, Mt5CommandType.CopyTicks, cmdParams);
Flags = (int)flags,
From = from,
Count = count
});
return response; return response;
} }
@@ -1484,15 +1461,14 @@ namespace MtApi5
///<param name="period">The value of the timeframe can be one of values of the ENUM_TIMEFRAMES enumeration, 0 means the current timeframe.</param> ///<param name="period">The value of the timeframe can be one of values of the ENUM_TIMEFRAMES enumeration, 0 means the current timeframe.</param>
///<param name="indicatorType">Indicator type, can be one of values of the ENUM_INDICATOR enumeration.</param> ///<param name="indicatorType">Indicator type, can be one of values of the ENUM_INDICATOR enumeration.</param>
///<param name="parameters">An array of MqlParam type, whose elements contain the type and value of each input parameter of a technical indicator.</param> ///<param name="parameters">An array of MqlParam type, whose elements contain the type and value of each input parameter of a technical indicator.</param>
public int IndicatorCreate(string symbol, ENUM_TIMEFRAMES period, ENUM_INDICATOR indicatorType, List<MqlParam>? parameters = null) public int IndicatorCreate(string? symbol, ENUM_TIMEFRAMES period, ENUM_INDICATOR indicatorType, List<MqlParam>? parameters = null)
{ {
var response = SendRequest<int>(new IndicatorCreateRequest Dictionary<string, object> cmdParams = new() { { "Period", (int)period }, { "IndicatorType", (int)indicatorType } };
{ if (symbol != null)
Symbol = symbol, cmdParams["Symbol"] = symbol;
Period = period, if (parameters != null)
IndicatorType = indicatorType, cmdParams["Parameters"] = parameters;
Parameters = parameters var response = SendCommand<int>(ExecutorHandle, Mt5CommandType.IndicatorCreate, cmdParams);
});
return response; return response;
} }
@@ -1581,11 +1557,11 @@ namespace MtApi5
///</summary> ///</summary>
///<param name="symbolName">Symbol name.</param> ///<param name="symbolName">Symbol name.</param>
///<param name="propId">Identifier of a symbol property.</param> ///<param name="propId">Identifier of a symbol property.</param>
public string SymbolInfoString(string symbolName, ENUM_SYMBOL_INFO_STRING propId) public string? SymbolInfoString(string symbolName, ENUM_SYMBOL_INFO_STRING propId)
{ {
var commandParameters = new ArrayList { symbolName, (int)propId }; Dictionary<string, object> cmdParams = new() { { "Symbol", symbolName }, { "PropId", (int)propId } };
var response = SendCommand<string>(ExecutorHandle, Mt5CommandType.SymbolInfoString, cmdParams);
return SendCommand<string>(Mt5CommandType.SymbolInfoString, commandParameters); return response;
} }
///<summary> ///<summary>
@@ -1596,13 +1572,9 @@ namespace MtApi5
///<param name="value">Variable of the string type receiving the value of the requested property.</param> ///<param name="value">Variable of the string type receiving the value of the requested property.</param>
public bool SymbolInfoString(string symbolName, ENUM_SYMBOL_INFO_STRING propId, out string? value) public bool SymbolInfoString(string symbolName, ENUM_SYMBOL_INFO_STRING propId, out string? value)
{ {
var response = SendRequest<SymbolInfoStringResult>(new SymbolInfoStringRequest Dictionary<string, object> cmdParams = new() { { "Symbol", symbolName }, { "PropId", (int)propId } };
{ var response = SendCommand<FuncResult<string>>(ExecutorHandle, Mt5CommandType.SymbolInfoString2, cmdParams);
SymbolName = symbolName, value = response?.Result;
PropId = propId
});
value = response?.StringVar;
return response?.RetVal ?? false; return response?.RetVal ?? false;
} }
@@ -1612,28 +1584,23 @@ namespace MtApi5
///</summary> ///</summary>
///<param name="symbol">Symbol name.</param> ///<param name="symbol">Symbol name.</param>
///<param name="tick"> Link to the structure of the MqlTick type, to which the current prices and time of the last price update will be placed.</param> ///<param name="tick"> Link to the structure of the MqlTick type, to which the current prices and time of the last price update will be placed.</param>
public bool SymbolInfoTick(string symbol, out MqlTick tick) public bool SymbolInfoTick(string symbol, out MqlTick? tick)
{ {
tick = SendRequest<MqlTick>(new SymbolInfoTickRequest Dictionary<string, object> cmdParams = new() { { "Symbol", symbol } };
{ var response = SendCommand<FuncResult<MqlTick>>(ExecutorHandle, Mt5CommandType.SymbolInfoTick, cmdParams);
SymbolName = symbol tick = response?.Result;
}); return response?.RetVal ?? false;
return tick != null;
} }
///<summary> ///<summary>
///The function returns current prices of a specified symbol in a variable of the MqlTick type. ///The function returns current prices of a specified symbol in a variable of the MqlTick type.
///</summary> ///</summary>
///<param name="symbol">Symbol name.</param> ///<param name="symbol">Symbol name.</param>
public MqlTick SymbolInfoTick(string symbol) public MqlTick? SymbolInfoTick(string symbol)
{ {
var tick = SendRequest<MqlTick>(new SymbolInfoTickRequest if (SymbolInfoTick(symbol, out MqlTick? tick))
{ return tick;
SymbolName = symbol return null;
});
return tick;
} }
///<summary> ///<summary>
@@ -1699,11 +1666,8 @@ namespace MtApi5
///<param name="book">Reference to an array of Depth of Market records.</param> ///<param name="book">Reference to an array of Depth of Market records.</param>
public bool MarketBookGet(string symbol, out MqlBookInfo[]? book) public bool MarketBookGet(string symbol, out MqlBookInfo[]? book)
{ {
var response = SendRequest<List<MqlBookInfo>>(new MarketBookGetRequest Dictionary<string, object> cmdParams = new() { { "Symbol", symbol } };
{ var response = SendCommand<List<MqlBookInfo>>(ExecutorHandle, Mt5CommandType.MarketBookGet, cmdParams);
Symbol = symbol
});
book = response?.ToArray(); book = response?.ToArray();
return response != null; return response != null;
} }
@@ -1801,17 +1765,17 @@ namespace MtApi5
///</returns> ///</returns>
public bool ChartTimePriceToXY(long chartId, int subWindow, DateTime? time, double price, out int x, out int y) public bool ChartTimePriceToXY(long chartId, int subWindow, DateTime? time, double price, out int x, out int y)
{ {
var result = SendRequest<ChartTimePriceToXyResult>(new ChartTimePriceToXyRequest Dictionary<string, object> cmdParams = new() { { "ChartId", chartId }, { "SubWindow", subWindow },
{ { "Time", Mt5TimeConverter.ConvertToMtTime(time) }, { "Price", price } };
ChartId = chartId,
SubWindow = subWindow,
Time = time,
Price = price
});
x = result?.X ?? 0; Dictionary<string, int> XY = [];
y = result?.Y ?? 0; var response = SendCommand<FuncResult<Dictionary<string, int>>>(ExecutorHandle, Mt5CommandType.ChartTimePriceToXY, cmdParams);
return result?.RetVal ?? false; if (response != null && response.Result != null
&& response.Result.TryGetValue("X", out x)
&& response.Result.TryGetValue("Y", out y))
return response.RetVal;
x = 0; y = 0;
return false;
} }
///<summary> ///<summary>
@@ -1828,17 +1792,22 @@ namespace MtApi5
///</returns> ///</returns>
public bool ChartXYToTimePrice(long chartId, int x, int y, out int subWindow, out DateTime? time, out double price) public bool ChartXYToTimePrice(long chartId, int x, int y, out int subWindow, out DateTime? time, out double price)
{ {
var result = SendRequest<ChartXyToTimePriceResult>(new ChartXyToTimePriceRequest Dictionary<string, object> cmdParams = new() { { "ChartId", chartId }, { "X", x }, { "Y", y } };
var response = SendCommand<FuncResult<Dictionary<string, object>>>(ExecutorHandle, Mt5CommandType.ChartXYToTimePrice, cmdParams);
if (response != null && response.Result != null
&& response.Result.TryGetValue("SubWindow", out object? mtSubWindow)
&& response.Result.TryGetValue("Time", out object? mtTime)
&& response.Result.TryGetValue("Price", out object? mtPrice))
{ {
ChartId = chartId, subWindow = Convert.ToInt32(mtSubWindow);
X = x, time = Mt5TimeConverter.ConvertFromMtTime(Convert.ToInt32(mtTime));
Y = y price = Convert.ToDouble(mtPrice);
}); return response.RetVal;
}
subWindow = result?.SubWindow ?? 0; subWindow = 0;
time = result?.Time; time = null;
price = result?.Price ?? double.NaN; price = double.NaN;
return result?.RetVal ?? false; return false;
} }
///<summary> ///<summary>
@@ -2987,16 +2956,11 @@ namespace MtApi5
///<param name="parameters">input-parameters of a custom indicator. If there is no parameters specified, then default values will be used.</param> ///<param name="parameters">input-parameters of a custom indicator. If there is no parameters specified, then default values will be used.</param>
public int iCustom(string symbol, ENUM_TIMEFRAMES period, string name, double[] parameters) public int iCustom(string symbol, ENUM_TIMEFRAMES period, string name, double[] parameters)
{ {
Log?.Debug("iCustom: called."); Dictionary<string, object> cmdParams = new() { { "Symbol", symbol }, { "Period", (int)period },
var response = SendRequest<int>(new ICustomRequest { "Name", name }, { "Parameters", parameters } };
{ cmdParams["ParamsType"] = ICustomRequest.ParametersType.Double;
Symbol = symbol,
Timeframe = (int)period, var response = SendCommand<int>(ExecutorHandle, Mt5CommandType.iCustom, cmdParams);
Name = name,
Params = new ArrayList(parameters),
ParamsType = ICustomRequest.ParametersType.Double
});
Log?.Debug($"iCustom: response = {response}.");
return response; return response;
} }
@@ -3009,16 +2973,11 @@ namespace MtApi5
///<param name="parameters">input-parameters of a custom indicator. If there is no parameters specified, then default values will be used.</param> ///<param name="parameters">input-parameters of a custom indicator. If there is no parameters specified, then default values will be used.</param>
public int iCustom(string symbol, ENUM_TIMEFRAMES period, string name, int[] parameters) public int iCustom(string symbol, ENUM_TIMEFRAMES period, string name, int[] parameters)
{ {
Log?.Debug("iCustom: called."); Dictionary<string, object> cmdParams = new() { { "Symbol", symbol }, { "Period", (int)period },
var response = SendRequest<int>(new ICustomRequest { "Name", name }, { "Parameters", parameters } };
{ cmdParams["ParamsType"] = ICustomRequest.ParametersType.Int;
Symbol = symbol,
Timeframe = (int)period, var response = SendCommand<int>(ExecutorHandle, Mt5CommandType.iCustom, cmdParams);
Name = name,
Params = new ArrayList(parameters),
ParamsType = ICustomRequest.ParametersType.Int
});
Log?.Debug($"iCustom: response = {response}.");
return response; return response;
} }
@@ -3031,16 +2990,11 @@ namespace MtApi5
///<param name="parameters">input-parameters of a custom indicator. If there is no parameters specified, then default values will be used.</param> ///<param name="parameters">input-parameters of a custom indicator. If there is no parameters specified, then default values will be used.</param>
public int iCustom(string symbol, ENUM_TIMEFRAMES period, string name, string[] parameters) public int iCustom(string symbol, ENUM_TIMEFRAMES period, string name, string[] parameters)
{ {
Log?.Debug("iCustom: called."); Dictionary<string, object> cmdParams = new() { { "Symbol", symbol }, { "Period", (int)period },
var response = SendRequest<int>(new ICustomRequest { "Name", name }, { "Parameters", parameters } };
{ cmdParams["ParamsType"] = ICustomRequest.ParametersType.String;
Symbol = symbol,
Timeframe = (int)period, var response = SendCommand<int>(ExecutorHandle, Mt5CommandType.iCustom, cmdParams);
Name = name,
Params = new ArrayList(parameters),
ParamsType = ICustomRequest.ParametersType.Int
});
Log?.Debug($"iCustom: response = {response}.");
return response; return response;
} }
@@ -3053,16 +3007,11 @@ namespace MtApi5
///<param name="parameters">input-parameters of a custom indicator. If there is no parameters specified, then default values will be used.</param> ///<param name="parameters">input-parameters of a custom indicator. If there is no parameters specified, then default values will be used.</param>
public int iCustom(string symbol, ENUM_TIMEFRAMES period, string name, bool[] parameters) public int iCustom(string symbol, ENUM_TIMEFRAMES period, string name, bool[] parameters)
{ {
Log?.Debug("iCustom: called."); Dictionary<string, object> cmdParams = new() { { "Symbol", symbol }, { "Period", (int)period },
var response = SendRequest<int>(new ICustomRequest { "Name", name }, { "Parameters", parameters } };
{ cmdParams["ParamsType"] = ICustomRequest.ParametersType.Boolean;
Symbol = symbol,
Timeframe = (int)period, var response = SendCommand<int>(ExecutorHandle, Mt5CommandType.iCustom, cmdParams);
Name = name,
Params = new ArrayList(parameters),
ParamsType = ICustomRequest.ParametersType.Int
});
Log?.Debug($"iCustom: response = {response}.");
return response; return response;
} }
@@ -3682,35 +3631,35 @@ namespace MtApi5
return default(T); return default(T);
} }
private T SendRequest<T>(RequestBase request) //private T SendRequest<T>(RequestBase request)
{ //{
if (request == null) // if (request == null)
return default(T); // return default(T);
var serializer = JsonConvert.SerializeObject(request, Formatting.None, // var serializer = JsonConvert.SerializeObject(request, Formatting.None,
new JsonSerializerSettings // new JsonSerializerSettings
{ // {
NullValueHandling = NullValueHandling.Ignore // NullValueHandling = NullValueHandling.Ignore
}); // });
var commandParameters = new ArrayList { serializer }; // var commandParameters = new ArrayList { serializer };
var res = SendCommand<string>(Mt5CommandType.MtRequest, commandParameters); // var res = SendCommand<string>(Mt5CommandType.MtRequest, commandParameters);
if (res == null) // if (res == null)
{ // {
Log?.Warn("SendRequest: Response from MetaTrader is null"); // Log?.Warn("SendRequest: Response from MetaTrader is null");
throw new ExecutionException(ErrorCode.ErrCustom, "Response from MetaTrader is null"); // throw new ExecutionException(ErrorCode.ErrCustom, "Response from MetaTrader is null");
} // }
var response = JsonConvert.DeserializeObject<Response<T>>(res) ?? throw new Exception("Failed to deserialize response"); // var response = JsonConvert.DeserializeObject<Response<T>>(res) ?? throw new Exception("Failed to deserialize response");
if (response.ErrorCode != 0) // if (response.ErrorCode != 0)
{ // {
Log?.Warn($"SendRequest: ErrorCode = {response.ErrorCode}. {response}"); // Log?.Warn($"SendRequest: ErrorCode = {response.ErrorCode}. {response}");
throw new ExecutionException((ErrorCode)response.ErrorCode, response.ErrorMessage); // throw new ExecutionException((ErrorCode)response.ErrorCode, response.ErrorMessage);
} // }
return response.Value; // return response.Value;
} //}
private void OnConnected() private void OnConnected()
{ {
+16 -5
View File
@@ -90,6 +90,7 @@ namespace MtApi5.MtProtocol
SymbolInfoDouble = 54, SymbolInfoDouble = 54,
SymbolInfoInteger = 55, SymbolInfoInteger = 55,
SymbolInfoString = 56, SymbolInfoString = 56,
SymbolInfoString2 = 1056,
SymbolInfoTick = 57, SymbolInfoTick = 57,
SymbolInfoSessionQuote = 58, SymbolInfoSessionQuote = 58,
SymbolInfoSessionTrade = 59, SymbolInfoSessionTrade = 59,
@@ -101,6 +102,7 @@ namespace MtApi5.MtProtocol
//CTrade //CTrade
PositionClose = 64, PositionClose = 64,
PositionOpen = 65, PositionOpen = 65,
PositionOpen2 = 1065,
PositionModify = 6066, PositionModify = 6066,
PositionClosePartial_bySymbol = 6067, PositionClosePartial_bySymbol = 6067,
PositionClosePartial_byTicket = 6068, PositionClosePartial_byTicket = 6068,
@@ -111,7 +113,7 @@ namespace MtApi5.MtProtocol
IsTesting = 67, IsTesting = 67,
//Requests //Requests
MtRequest = 155, //MtRequest = 155,
PositionSelectByTicket = 69, PositionSelectByTicket = 69,
@@ -147,7 +149,7 @@ namespace MtApi5.MtProtocol
iBullsPower = 98, iBullsPower = 98,
iCCI = 99, iCCI = 99,
iChaikin = 100, iChaikin = 100,
//iCustom = 101, iCustom = 101,
iDEMA = 102, iDEMA = 102,
iDeMarker = 103, iDeMarker = 103,
iEnvelopes = 104, iEnvelopes = 104,
@@ -188,8 +190,8 @@ namespace MtApi5.MtProtocol
ChartApplyTemplate = 236, ChartApplyTemplate = 236,
ChartSaveTemplate = 237, ChartSaveTemplate = 237,
ChartWindowFind = 238, ChartWindowFind = 238,
//ChartTimePriceToXY = 239, ChartTimePriceToXY = 239,
//ChartXYToTimePrice = 240, ChartXYToTimePrice = 240,
ChartOpen = 241, ChartOpen = 241,
ChartFirst = 242, ChartFirst = 242,
ChartNext = 243, ChartNext = 243,
@@ -255,6 +257,15 @@ namespace MtApi5.MtProtocol
UnlockTicks = 159, UnlockTicks = 159,
PositionCloseAll = 160, PositionCloseAll = 160,
TesterStop = 161 TesterStop = 161,
CopyTicks = 300,
OrderSend = 301,
OrderSendAsync = 302,
OrderCheck = 303,
MarketBookGet = 304,
IndicatorCreate = 305,
Buy = 306,
Sell = 307
} }
} }