mirror of
https://github.com/vdemydiuk/mtapi.git
synced 2026-08-17 04:38:10 +00:00
Merge branch 'mt5_1_0_18' into master
This commit is contained in:
@@ -10,13 +10,16 @@ namespace MtApi5
|
||||
this.volume = volume;
|
||||
}
|
||||
|
||||
public ENUM_BOOK_TYPE type { get; } // Order type from ENUM_BOOK_TYPE enumeration
|
||||
public double price { get; } // Price
|
||||
public long volume { get; } // Volume
|
||||
public MqlBookInfo()
|
||||
{ }
|
||||
|
||||
public ENUM_BOOK_TYPE type { get; set; } // Order type from ENUM_BOOK_TYPE enumeration
|
||||
public double price { get; set; } // Price
|
||||
public long volume { get; set; } // Volume
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return $"{type}|{price}|{volume}";
|
||||
return $"type = {type}; price = {price}; volume = {volume}";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,14 +4,14 @@ namespace MtApi5
|
||||
{
|
||||
public class MqlTradeCheckResult
|
||||
{
|
||||
public uint Retcode { get; } // Reply code
|
||||
public double Balance { get; } // Balance after the execution of the deal
|
||||
public double Equity { get; } // Equity after the execution of the deal
|
||||
public double Profit { get; } // Floating profit
|
||||
public double Margin { get; } // Margin requirements
|
||||
public double Margin_free { get; } // Free margin
|
||||
public double Margin_level { get; } // Margin level
|
||||
public string Comment { get; } // Comment to the reply code (description of the error)
|
||||
public uint Retcode { get; set; } // Reply code
|
||||
public double Balance { get; set; } // Balance after the execution of the deal
|
||||
public double Equity { get; set; } // Equity after the execution of the deal
|
||||
public double Profit { get; set; } // Floating profit
|
||||
public double Margin { get; set; } // Margin requirements
|
||||
public double Margin_free { get; set; } // Free margin
|
||||
public double Margin_level { get; set; } // Margin level
|
||||
public string Comment { get; set; } // Comment to the reply code (description of the error)
|
||||
|
||||
public MqlTradeCheckResult(uint retcode
|
||||
, double balance
|
||||
@@ -32,6 +32,9 @@ namespace MtApi5
|
||||
Comment = comment;
|
||||
}
|
||||
|
||||
public MqlTradeCheckResult()
|
||||
{ }
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return $"Retcode={Retcode}; Comment={Comment}; Balance={Balance}; Equity={Equity}; Profit={Profit}; Margin={Margin}; Margin_free={Margin_free}; Margin_level={Margin_level}";
|
||||
|
||||
@@ -9,7 +9,6 @@ namespace MtApi5
|
||||
//OrderSend = 1,
|
||||
OrderCalcMargin = 2,
|
||||
OrderCalcProfit = 3,
|
||||
//OrderCheck = 4,
|
||||
//OrderSendAsync = 5,
|
||||
PositionsTotal = 6,
|
||||
PositionGetSymbol = 7,
|
||||
@@ -17,6 +16,7 @@ namespace MtApi5
|
||||
PositionGetDouble = 9,
|
||||
PositionGetInteger = 10,
|
||||
PositionGetString = 11,
|
||||
PositionGetTicket = 4,
|
||||
OrdersTotal = 12,
|
||||
OrderGetTicket = 13,
|
||||
OrderSelect = 14,
|
||||
@@ -107,8 +107,6 @@ namespace MtApi5
|
||||
BacktestingReady = 66,
|
||||
IsTesting = 67,
|
||||
|
||||
Print = 68,
|
||||
|
||||
//Requests
|
||||
MtRequest = 155,
|
||||
|
||||
@@ -237,9 +235,24 @@ namespace MtApi5
|
||||
TerminalCompany = 68,
|
||||
TerminalName = 69,
|
||||
TerminalPath = 70,
|
||||
TerminalInfoString = 153,
|
||||
TerminalInfoInteger = 204,
|
||||
TerminalInfoDouble = 205,
|
||||
|
||||
//Checkup
|
||||
GetLastError = 132,
|
||||
TerminalInfoString = 153, //TODO
|
||||
TerminalInfoInteger = 204, //TODO
|
||||
TerminalInfoDouble = 205, //TODO
|
||||
|
||||
//Common Functions
|
||||
Alert = 136, //TODO
|
||||
Comment = 137, //TODO
|
||||
GetTickCount = 138, //TODO
|
||||
GetMicrosecondCount = 139, //TODO
|
||||
MessageBox = 140, //TODO
|
||||
PeriodSeconds = 141, //TODO
|
||||
PlaySound = 142, //TODO
|
||||
Print = 68,
|
||||
ResetLastError = 143,
|
||||
SendNotification = 144, //TODO
|
||||
SendMail = 145 //TODO
|
||||
}
|
||||
}
|
||||
|
||||
+33
-2
@@ -280,6 +280,17 @@ namespace MtApi5
|
||||
return SendCommand<string>(Mt5CommandType.PositionGetString, commandParameters);
|
||||
}
|
||||
|
||||
///<summary>
|
||||
///The function returns the ticket of a position with the specified index in the list of open positions and automatically selects the position to work with using functions PositionGetDouble, PositionGetInteger, PositionGetString.
|
||||
///</summary>
|
||||
///<param name="index">Identifier of a position property.</param>
|
||||
public ulong PositionGetTicket(int index)
|
||||
{
|
||||
var commandParameters = new ArrayList { index };
|
||||
|
||||
return SendCommand<ulong>(Mt5CommandType.PositionGetTicket, commandParameters);
|
||||
}
|
||||
|
||||
///<summary>
|
||||
///Returns the number of current orders.
|
||||
///</summary>
|
||||
@@ -611,11 +622,11 @@ namespace MtApi5
|
||||
///<param name="symbolName">Symbol name.</param>
|
||||
///<param name="timeframe"> Period.</param>
|
||||
///<param name="propId">Identifier of the requested property, value of the ENUM_SERIES_INFO_INTEGER enumeration.</param>
|
||||
public int SeriesInfoInteger(string symbolName, ENUM_TIMEFRAMES timeframe, ENUM_SERIES_INFO_INTEGER propId)
|
||||
public long SeriesInfoInteger(string symbolName, ENUM_TIMEFRAMES timeframe, ENUM_SERIES_INFO_INTEGER propId)
|
||||
{
|
||||
var commandParameters = new ArrayList { symbolName, (int)timeframe, (int)propId };
|
||||
|
||||
return SendCommand<int>(Mt5CommandType.SeriesInfoInteger, commandParameters);
|
||||
return SendCommand<long>(Mt5CommandType.SeriesInfoInteger, commandParameters);
|
||||
}
|
||||
|
||||
///<summary>
|
||||
@@ -3006,6 +3017,26 @@ namespace MtApi5
|
||||
|
||||
#endregion //Date and Time
|
||||
|
||||
#region Checkup
|
||||
|
||||
///<summary>
|
||||
///Returns the value of the last error that occurred during the execution of an mql5 program.
|
||||
///</summary>
|
||||
public int GetLastError()
|
||||
{
|
||||
return SendCommand<int>(Mt5CommandType.GetLastError, null);
|
||||
}
|
||||
|
||||
///<summary>
|
||||
///Sets the value of the predefined variable _LastError into zero.
|
||||
///</summary>
|
||||
public void ResetLastError()
|
||||
{
|
||||
SendCommand<object>(Mt5CommandType.ResetLastError, null);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#endregion // Public Methods
|
||||
|
||||
#region Properties
|
||||
|
||||
@@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.17")]
|
||||
[assembly: AssemblyFileVersion("1.0.17")]
|
||||
[assembly: AssemblyVersion("1.0.18")]
|
||||
[assembly: AssemblyFileVersion("1.0.18")]
|
||||
|
||||
Reference in New Issue
Block a user