mirror of
https://github.com/vdemydiuk/mtapi.git
synced 2026-08-19 13:48:11 +00:00
Issue #31: Implemented function TerminalInfoInteger in MtApi MT4
This commit is contained in:
Executable
+27
@@ -0,0 +1,27 @@
|
|||||||
|
namespace MtApi
|
||||||
|
{
|
||||||
|
// https://docs.mql4.com/constants/environment_state/terminalstatus#enum_terminal_info_integer
|
||||||
|
public enum EnumTerminalInfoInteger
|
||||||
|
{
|
||||||
|
TERMINAL_BUILD = 5, // The client terminal build number
|
||||||
|
TERMINAL_COMMUNITY_ACCOUNT = 23, // The flag indicates the presence of MQL5.community authorization data in the terminal
|
||||||
|
TERMINAL_COMMUNITY_CONNECTION = 24, // Connection to MQL5.community
|
||||||
|
TERMINAL_CONNECTED = 6, // Connection to a trade server
|
||||||
|
TERMINAL_DLLS_ALLOWED = 7, // Permission to use DLL
|
||||||
|
TERMINAL_TRADE_ALLOWED = 8, // Permission to trade
|
||||||
|
TERMINAL_EMAIL_ENABLED = 9, // Permission to send e-mails using SMTP-server and login, specified in the terminal settings
|
||||||
|
TERMINAL_FTP_ENABLED = 10, // Permission to send reports using FTP-server and login, specified in the terminal settings
|
||||||
|
TERMINAL_NOTIFICATIONS_ENABLED = 26, // Permission to send notifications to smartphone
|
||||||
|
TERMINAL_MAXBARS = 11, // The maximal bars count on the chart
|
||||||
|
TERMINAL_MQID = 22, // The flag indicates the presence of MetaQuotes ID data to send Push notifications
|
||||||
|
TERMINAL_CODEPAGE = 12, // Number of the code page of the language installed in the client terminal
|
||||||
|
TERMINAL_CPU_CORES = 21, // The number of CPU cores in the system
|
||||||
|
TERMINAL_DISK_SPACE = 20, // Free disk space for the MQL4\Files folder of the terminal, Mb
|
||||||
|
TERMINAL_MEMORY_PHYSICAL = 14, // Physical memory in the system, Mb
|
||||||
|
TERMINAL_MEMORY_TOTAL = 15, // Memory available to the process of the terminal , Mb
|
||||||
|
TERMINAL_MEMORY_AVAILABLE = 16, // Free memory of the terminal process, Mb
|
||||||
|
TERMINAL_MEMORY_USED = 17, // Memory used by the terminal , Mb
|
||||||
|
TERMINAL_SCREEN_DPI = 27, // The resolution of information display on the screen is measured as number of Dots in a line per Inch (DPI). Knowing the parameter value, you can set the size of graphical objects so that they look the same on monitors with different resolution characteristics.
|
||||||
|
TERMINAL_PING_LAST = 28 // The last known value of a ping to a trade server in microseconds. One second comprises of one million microseconds
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -62,6 +62,7 @@
|
|||||||
<Compile Include="EnumSeriesInfoInteger.cs" />
|
<Compile Include="EnumSeriesInfoInteger.cs" />
|
||||||
<Compile Include="EnumSymbolInfoDouble.cs" />
|
<Compile Include="EnumSymbolInfoDouble.cs" />
|
||||||
<Compile Include="EnumSymbolInfoInteger.cs" />
|
<Compile Include="EnumSymbolInfoInteger.cs" />
|
||||||
|
<Compile Include="EnumTerminalInfoInteger.cs" />
|
||||||
<Compile Include="ExtensionMethods.cs" />
|
<Compile Include="ExtensionMethods.cs" />
|
||||||
<Compile Include="Monitors\AvailabilityOrdersEventArgs.cs" />
|
<Compile Include="Monitors\AvailabilityOrdersEventArgs.cs" />
|
||||||
<Compile Include="MqlRates.cs" />
|
<Compile Include="MqlRates.cs" />
|
||||||
|
|||||||
+157
-29
@@ -498,79 +498,226 @@ namespace MtApi
|
|||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Check Status
|
#region Checkup
|
||||||
|
|
||||||
|
///<summary>
|
||||||
|
///Returns the contents of the system variable _LastError.
|
||||||
|
///After the function call, the contents of _LastError are reset.
|
||||||
|
///</summary>
|
||||||
|
///<returns>
|
||||||
|
///Returns the value of the last error that occurred during the execution of an mql4 program.
|
||||||
|
///</returns>
|
||||||
public int GetLastError()
|
public int GetLastError()
|
||||||
{
|
{
|
||||||
return SendCommand<int>(MtCommandType.GetLastError, null);
|
return SendCommand<int>(MtCommandType.GetLastError, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
///<summary>
|
||||||
|
///Checks connection between client terminal and server.
|
||||||
|
///</summary>
|
||||||
|
///<returns>
|
||||||
|
///It returns true if connection to the server was successfully established, otherwise, it returns false.
|
||||||
|
///</returns>
|
||||||
public bool IsConnected()
|
public bool IsConnected()
|
||||||
{
|
{
|
||||||
return SendCommand<bool>(MtCommandType.IsConnected, null);
|
return SendCommand<bool>(MtCommandType.IsConnected, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
///<summary>
|
||||||
|
///Checks if the Expert Advisor runs on a demo account.
|
||||||
|
///</summary>
|
||||||
|
///<returns>
|
||||||
|
///Returns true if the Expert Advisor runs on a demo account, otherwise returns false.
|
||||||
|
///</returns>
|
||||||
public bool IsDemo()
|
public bool IsDemo()
|
||||||
{
|
{
|
||||||
return SendCommand<bool>(MtCommandType.IsDemo, null);
|
return SendCommand<bool>(MtCommandType.IsDemo, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
///<summary>
|
||||||
|
///Checks if the DLL function call is allowed for the Expert Advisor.
|
||||||
|
///</summary>
|
||||||
|
///<returns>
|
||||||
|
///Returns true if the DLL function call is allowed for the Expert Advisor, otherwise returns false.
|
||||||
|
///</returns>
|
||||||
public bool IsDllsAllowed()
|
public bool IsDllsAllowed()
|
||||||
{
|
{
|
||||||
return SendCommand<bool>(MtCommandType.IsDllsAllowed, null);
|
return SendCommand<bool>(MtCommandType.IsDllsAllowed, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
///<summary>
|
||||||
|
///Checks if Expert Advisors are enabled for running.
|
||||||
|
///</summary>
|
||||||
|
///<returns>
|
||||||
|
///Returns true if Expert Advisors are enabled for running, otherwise returns false.
|
||||||
|
///</returns>
|
||||||
public bool IsExpertEnabled()
|
public bool IsExpertEnabled()
|
||||||
{
|
{
|
||||||
return SendCommand<bool>(MtCommandType.IsExpertEnabled, null);
|
return SendCommand<bool>(MtCommandType.IsExpertEnabled, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
///<summary>
|
||||||
|
///Checks if the Expert Advisor can call library function.
|
||||||
|
///</summary>
|
||||||
|
///<returns>
|
||||||
|
///Returns true if the Expert Advisor can call library function, otherwise returns false.
|
||||||
|
///</returns>
|
||||||
public bool IsLibrariesAllowed()
|
public bool IsLibrariesAllowed()
|
||||||
{
|
{
|
||||||
return SendCommand<bool>(MtCommandType.IsLibrariesAllowed, null);
|
return SendCommand<bool>(MtCommandType.IsLibrariesAllowed, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
///<summary>
|
||||||
|
///Checks if Expert Advisor runs in the Strategy Tester optimization mode.
|
||||||
|
///</summary>
|
||||||
|
///<returns>
|
||||||
|
///Returns true if Expert Advisor runs in the Strategy Tester optimization mode, otherwise returns false.
|
||||||
|
///</returns>
|
||||||
public bool IsOptimization()
|
public bool IsOptimization()
|
||||||
{
|
{
|
||||||
return SendCommand<bool>(MtCommandType.IsOptimization, null);
|
return SendCommand<bool>(MtCommandType.IsOptimization, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
///<summary>
|
||||||
|
///Checks the forced shutdown of an mql4 program.
|
||||||
|
///</summary>
|
||||||
|
///<returns>
|
||||||
|
///Returns true, if the _StopFlag system variable contains a value other than 0.
|
||||||
|
///A nonzero value is written into _StopFlag, if a mql4 program has been commanded to complete its operation.
|
||||||
|
///In this case, you must immediately terminate the program, otherwise the program will be completed
|
||||||
|
///forcibly from the outside after 3 seconds.
|
||||||
|
///</returns>
|
||||||
public bool IsStopped()
|
public bool IsStopped()
|
||||||
{
|
{
|
||||||
return SendCommand<bool>(MtCommandType.IsStopped, null);
|
return SendCommand<bool>(MtCommandType.IsStopped, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
///<summary>
|
||||||
|
///Checks if the Expert Advisor runs in the testing mode.
|
||||||
|
///</summary>
|
||||||
|
///<returns>
|
||||||
|
///Returns true if the Expert Advisor runs in the testing mode, otherwise returns false.
|
||||||
|
///</returns>
|
||||||
public bool IsTesting()
|
public bool IsTesting()
|
||||||
{
|
{
|
||||||
return SendCommand<bool>(MtCommandType.IsTesting, null);
|
return SendCommand<bool>(MtCommandType.IsTesting, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
///<summary>
|
||||||
|
///Checks if the Expert Advisor is allowed to trade and trading context is not busy.
|
||||||
|
///</summary>
|
||||||
|
///<returns>
|
||||||
|
///Returns true if the Expert Advisor is allowed to trade and trading context is not busy, otherwise returns false.
|
||||||
|
///</returns>
|
||||||
public bool IsTradeAllowed()
|
public bool IsTradeAllowed()
|
||||||
{
|
{
|
||||||
return SendCommand<bool>(MtCommandType.IsTradeAllowed, null);
|
return SendCommand<bool>(MtCommandType.IsTradeAllowed, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
///<summary>
|
||||||
|
///Returns the information about trade context.
|
||||||
|
///</summary>
|
||||||
|
///<returns>
|
||||||
|
///Returns true if a thread for trading is occupied by another Expert Advisor, otherwise returns false.
|
||||||
|
///</returns>
|
||||||
public bool IsTradeContextBusy()
|
public bool IsTradeContextBusy()
|
||||||
{
|
{
|
||||||
return SendCommand<bool>(MtCommandType.IsTradeContextBusy, null);
|
return SendCommand<bool>(MtCommandType.IsTradeContextBusy, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
///<summary>
|
||||||
|
///Checks if the Expert Advisor is tested in visual mode.
|
||||||
|
///</summary>
|
||||||
|
///<returns>
|
||||||
|
///Returns true if the Expert Advisor is tested with checked "Visual Mode" button, otherwise returns false.
|
||||||
|
///</returns>
|
||||||
public bool IsVisualMode()
|
public bool IsVisualMode()
|
||||||
{
|
{
|
||||||
return SendCommand<bool>(MtCommandType.IsVisualMode, null);
|
return SendCommand<bool>(MtCommandType.IsVisualMode, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
///<summary>
|
||||||
|
///Returns the code of a reason for deinitialization.
|
||||||
|
///</summary>
|
||||||
|
///<returns>
|
||||||
|
///Returns the value of _UninitReason which is formed before OnDeinit() is called.
|
||||||
|
///Value depends on the reasons that led to deinitialization.
|
||||||
|
///</returns>
|
||||||
public int UninitializeReason()
|
public int UninitializeReason()
|
||||||
{
|
{
|
||||||
return SendCommand<int>(MtCommandType.UninitializeReason, null);
|
return SendCommand<int>(MtCommandType.UninitializeReason, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
///<summary>
|
||||||
|
///Print the error description.
|
||||||
|
///</summary>
|
||||||
public string ErrorDescription(int errorCode)
|
public string ErrorDescription(int errorCode)
|
||||||
{
|
{
|
||||||
var commandParameters = new ArrayList { errorCode };
|
var commandParameters = new ArrayList { errorCode };
|
||||||
return SendCommand<string>(MtCommandType.ErrorDescription, commandParameters);
|
return SendCommand<string>(MtCommandType.ErrorDescription, commandParameters);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
///<summary>
|
||||||
|
///Returns the value of a corresponding property of the mql4 program environment.
|
||||||
|
///</summary>
|
||||||
|
///<param name="propertyId">Identifier of a property. Can be one of the values of the ENUM_TERMINAL_INFO_STRING enumeration.</param>
|
||||||
|
///<returns>
|
||||||
|
///Value of string type.
|
||||||
|
///</returns>
|
||||||
|
public string TerminalInfoString(ENUM_TERMINAL_INFO_STRING propertyId)
|
||||||
|
{
|
||||||
|
var commandParameters = new ArrayList { (int)propertyId };
|
||||||
|
return SendCommand<string>(MtCommandType.TerminalInfoString, commandParameters);
|
||||||
|
}
|
||||||
|
|
||||||
|
///<summary>
|
||||||
|
///Returns the value of a corresponding property of the mql4 program environment.
|
||||||
|
///</summary>
|
||||||
|
///<param name="propertyId">Identifier of a property. Can be one of the values of the ENUM_TERMINAL_INFO_INTEGER enumeration.</param>
|
||||||
|
///<returns>
|
||||||
|
///Value of int type.
|
||||||
|
///</returns>
|
||||||
|
public int TerminalInfoInteger(EnumTerminalInfoInteger propertyId)
|
||||||
|
{
|
||||||
|
var commandParameters = new ArrayList { (int)propertyId };
|
||||||
|
return SendCommand<int>(MtCommandType.TerminalInfoInteger, commandParameters);
|
||||||
|
}
|
||||||
|
|
||||||
|
//TODO: TerminalInfoDouble
|
||||||
|
|
||||||
|
///<summary>
|
||||||
|
///Returns the name of company owning the client terminal.
|
||||||
|
///</summary>
|
||||||
|
///<returns>
|
||||||
|
///The name of company owning the client terminal.
|
||||||
|
///</returns>
|
||||||
|
public string TerminalCompany()
|
||||||
|
{
|
||||||
|
return SendCommand<string>(MtCommandType.TerminalCompany, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
///<summary>
|
||||||
|
///Returns client terminal name.
|
||||||
|
///</summary>
|
||||||
|
///<returns>
|
||||||
|
///Client terminal name.
|
||||||
|
///</returns>
|
||||||
|
public string TerminalName()
|
||||||
|
{
|
||||||
|
return SendCommand<string>(MtCommandType.TerminalName, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
///<summary>
|
||||||
|
///Returns the directory, from which the client terminal was launched.
|
||||||
|
///</summary>
|
||||||
|
///<returns>
|
||||||
|
///The directory, from which the client terminal was launched.
|
||||||
|
///</returns>
|
||||||
|
public string TerminalPath()
|
||||||
|
{
|
||||||
|
return SendCommand<string>(MtCommandType.TerminalPath, null);
|
||||||
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Account Information
|
#region Account Information
|
||||||
@@ -732,25 +879,6 @@ namespace MtApi
|
|||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Client Terminal Functions
|
|
||||||
|
|
||||||
public string TerminalCompany()
|
|
||||||
{
|
|
||||||
return SendCommand<string>(MtCommandType.TerminalCompany, null);
|
|
||||||
}
|
|
||||||
|
|
||||||
public string TerminalName()
|
|
||||||
{
|
|
||||||
return SendCommand<string>(MtCommandType.TerminalName, null);
|
|
||||||
}
|
|
||||||
|
|
||||||
public string TerminalPath()
|
|
||||||
{
|
|
||||||
return SendCommand<string>(MtCommandType.TerminalPath, null);
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#region Date and Time Functions
|
#region Date and Time Functions
|
||||||
|
|
||||||
public int Day()
|
public int Day()
|
||||||
@@ -1403,6 +1531,15 @@ namespace MtApi
|
|||||||
return response?.Rates;
|
return response?.Rates;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
///<summary>
|
||||||
|
///Returns information about the state of historical data.
|
||||||
|
///</summary>
|
||||||
|
///<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>
|
||||||
|
///<returns>
|
||||||
|
///Returns value of the long type.
|
||||||
|
///</returns>
|
||||||
public long SeriesInfoInteger(string symbolName, ENUM_TIMEFRAMES timeframe, EnumSeriesInfoInteger propId)
|
public long SeriesInfoInteger(string symbolName, ENUM_TIMEFRAMES timeframe, EnumSeriesInfoInteger propId)
|
||||||
{
|
{
|
||||||
var response = SendRequest<SeriesInfoIntegerResponse>(new SeriesInfoIntegerRequest
|
var response = SendRequest<SeriesInfoIntegerResponse>(new SeriesInfoIntegerRequest
|
||||||
@@ -1417,15 +1554,6 @@ namespace MtApi
|
|||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Checkup
|
|
||||||
public string TerminalInfoString(ENUM_TERMINAL_INFO_STRING propertyId)
|
|
||||||
{
|
|
||||||
var commandParameters = new ArrayList { (int)propertyId };
|
|
||||||
return SendCommand<string>(MtCommandType.TerminalInfoString, commandParameters);
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#region Market Info
|
#region Market Info
|
||||||
|
|
||||||
///<summary>
|
///<summary>
|
||||||
|
|||||||
@@ -58,9 +58,15 @@ namespace MtApi
|
|||||||
IsVisualMode = 37,
|
IsVisualMode = 37,
|
||||||
UninitializeReason = 38,
|
UninitializeReason = 38,
|
||||||
ErrorDescription = 39,
|
ErrorDescription = 39,
|
||||||
|
TerminalCompany = 68,
|
||||||
|
TerminalName = 69,
|
||||||
|
TerminalPath = 70,
|
||||||
|
TerminalInfoString = 153,
|
||||||
|
TerminalInfoInteger = 204,
|
||||||
|
//TerminalInfoDouble = 205,
|
||||||
|
|
||||||
//Account Information
|
//Account Information
|
||||||
AccountBalance = 40,
|
AccountBalance = 40,
|
||||||
AccountCredit = 41,
|
AccountCredit = 41,
|
||||||
AccountCompany = 42,
|
AccountCompany = 42,
|
||||||
AccountCurrency = 43,
|
AccountCurrency = 43,
|
||||||
@@ -91,11 +97,6 @@ namespace MtApi
|
|||||||
SendMail = 66,
|
SendMail = 66,
|
||||||
Sleep = 67,
|
Sleep = 67,
|
||||||
|
|
||||||
//Client Terminal
|
|
||||||
TerminalCompany = 68,
|
|
||||||
TerminalName = 69,
|
|
||||||
TerminalPath = 70,
|
|
||||||
|
|
||||||
//Date and Time
|
//Date and Time
|
||||||
Day = 71,
|
Day = 71,
|
||||||
DayOfWeek = 72,
|
DayOfWeek = 72,
|
||||||
@@ -188,8 +189,6 @@ namespace MtApi
|
|||||||
//
|
//
|
||||||
RefreshRates = 150,
|
RefreshRates = 150,
|
||||||
//
|
//
|
||||||
TerminalInfoString = 153,
|
|
||||||
SymbolInfoString = 154,
|
|
||||||
|
|
||||||
//Requests
|
//Requests
|
||||||
MtRequest = 155,
|
MtRequest = 155,
|
||||||
@@ -197,7 +196,8 @@ namespace MtApi
|
|||||||
//Backtesting
|
//Backtesting
|
||||||
BacktestingReady = 156,
|
BacktestingReady = 156,
|
||||||
|
|
||||||
//Symbols
|
//Market Info
|
||||||
|
SymbolInfoString = 154,
|
||||||
SymbolsTotal = 200,
|
SymbolsTotal = 200,
|
||||||
SymbolName = 201,
|
SymbolName = 201,
|
||||||
SymbolSelect = 202,
|
SymbolSelect = 202,
|
||||||
|
|||||||
Regular → Executable
+85
-84
@@ -1,5 +1,6 @@
|
|||||||
namespace MtApi
|
namespace MtApi
|
||||||
{
|
{
|
||||||
|
// https://docs.mql4.com/constants/errorswarnings/errorcodes
|
||||||
public enum MtErrorCode
|
public enum MtErrorCode
|
||||||
{
|
{
|
||||||
MtApiCustomError = -1, // Error occurred in MtApi.
|
MtApiCustomError = -1, // Error occurred in MtApi.
|
||||||
@@ -10,91 +11,91 @@
|
|||||||
ServerBusy = 4, // Trade server is busy.
|
ServerBusy = 4, // Trade server is busy.
|
||||||
OldVersion = 5, // Old version of the client terminal.
|
OldVersion = 5, // Old version of the client terminal.
|
||||||
NoConnection = 6, // No connection with trade server.
|
NoConnection = 6, // No connection with trade server.
|
||||||
NotEnoughRights = 7, // Not enough rights.
|
NotEnoughRights = 7, // Not enough rights.
|
||||||
TooFrequentRequests = 8, // Too frequent requests.
|
TooFrequentRequests = 8, // Too frequent requests.
|
||||||
MalfunctionalTrade = 9, // Malfunctional trade operation.
|
MalfunctionalTrade = 9, // Malfunctional trade operation.
|
||||||
AccountDisabled = 64, // Account disabled.
|
AccountDisabled = 64, // Account disabled.
|
||||||
InvalidAccount = 65, // Invalid account.
|
InvalidAccount = 65, // Invalid account.
|
||||||
TradeTimeout = 128, // Trade timeout.
|
TradeTimeout = 128, // Trade timeout.
|
||||||
InvalidPrice = 129, // Invalid price.
|
InvalidPrice = 129, // Invalid price.
|
||||||
InvalidStops = 130, // Invalid stops.
|
InvalidStops = 130, // Invalid stops.
|
||||||
InvalidTradeVolume = 131, // Invalid trade volume.
|
InvalidTradeVolume = 131, // Invalid trade volume.
|
||||||
MarketClosed = 132, // Market is closed.
|
MarketClosed = 132, // Market is closed.
|
||||||
TradeDisabled = 133, // Trade is disabled.
|
TradeDisabled = 133, // Trade is disabled.
|
||||||
NotEnoughMoney = 134, // Not enough money.
|
NotEnoughMoney = 134, // Not enough money.
|
||||||
PriceChanged = 135, // Price changed.
|
PriceChanged = 135, // Price changed.
|
||||||
OffQuotes = 136, // Off quotes.
|
OffQuotes = 136, // Off quotes.
|
||||||
BrokerBusy = 137, // Broker is busy.
|
BrokerBusy = 137, // Broker is busy.
|
||||||
Requote = 138, // Requote.
|
Requote = 138, // Requote.
|
||||||
OrderLocked = 139, // Order is locked.
|
OrderLocked = 139, // Order is locked.
|
||||||
LongPositionsOnlyAllowed = 140, // Long positions only allowed.
|
LongPositionsOnlyAllowed = 140, // Long positions only allowed.
|
||||||
TooManyRequests = 141, // Too many requests.
|
TooManyRequests = 141, // Too many requests.
|
||||||
TradeModifyDenied = 145, // Modification denied because an order is too close to market.
|
TradeModifyDenied = 145, // Modification denied because an order is too close to market.
|
||||||
TradeContextBusy = 146, // Trade context is busy.
|
TradeContextBusy = 146, // Trade context is busy.
|
||||||
TradeExpirationDenied = 147, // Expirations are denied by broker.
|
TradeExpirationDenied = 147, // Expirations are denied by broker.
|
||||||
TradeTooManyOrders = 148, // The amount of opened and pending orders has reached the limit set by a broker.
|
TradeTooManyOrders = 148, // The amount of opened and pending orders has reached the limit set by a broker.
|
||||||
|
|
||||||
NoMqlerror = 4000, // No error.
|
NoMqlerror = 4000, // No error.
|
||||||
WrongFunctionPointer = 4001, // Wrong function pointer.
|
WrongFunctionPointer = 4001, // Wrong function pointer.
|
||||||
ArrayIndexOutOfRange = 4002, // Array index is out of range.
|
ArrayIndexOutOfRange = 4002, // Array index is out of range.
|
||||||
NoMemoryForFunctionCallStack = 4003, // No memory for function call stack.
|
NoMemoryForFunctionCallStack = 4003, // No memory for function call stack.
|
||||||
RecursiveStackOverflow = 4004, // Recursive stack overflow.
|
RecursiveStackOverflow = 4004, // Recursive stack overflow.
|
||||||
NotEnoughStackForParameter = 4005, // Not enough stack for parameter.
|
NotEnoughStackForParameter = 4005, // Not enough stack for parameter.
|
||||||
NoMemoryForParameterString = 4006, // No memory for parameter string.
|
NoMemoryForParameterString = 4006, // No memory for parameter string.
|
||||||
NoMemoryForTempString = 4007, // No memory for temp string.
|
NoMemoryForTempString = 4007, // No memory for temp string.
|
||||||
NotInitializedString = 4008, // Not initialized string.
|
NotInitializedString = 4008, // Not initialized string.
|
||||||
NotInitializedArraystring = 4009, // Not initialized string in an array.
|
NotInitializedArraystring = 4009, // Not initialized string in an array.
|
||||||
NoMemoryForArraystring = 4010, // No memory for an array string.
|
NoMemoryForArraystring = 4010, // No memory for an array string.
|
||||||
TooLongString = 4011, // Too long string.
|
TooLongString = 4011, // Too long string.
|
||||||
RemainderFromZeroDivide = 4012, // Remainder from zero divide.
|
RemainderFromZeroDivide = 4012, // Remainder from zero divide.
|
||||||
ZeroDivide = 4013, // Zero divide.
|
ZeroDivide = 4013, // Zero divide.
|
||||||
UnknownCommand = 4014, // Unknown command.
|
UnknownCommand = 4014, // Unknown command.
|
||||||
WrongJump = 4015, // Wrong jump.
|
WrongJump = 4015, // Wrong jump.
|
||||||
NotInitializedArray = 4016, // Not initialized array.
|
NotInitializedArray = 4016, // Not initialized array.
|
||||||
DllCallsNotAllowed = 4017, // DLL calls are not allowed.
|
DllCallsNotAllowed = 4017, // DLL calls are not allowed.
|
||||||
CannotLoadLibrary = 4018, // Cannot load library.
|
CannotLoadLibrary = 4018, // Cannot load library.
|
||||||
CannotCallFunction = 4019, // Cannot call function.
|
CannotCallFunction = 4019, // Cannot call function.
|
||||||
ExternalExpertCallsNotAllowed = 4020, // EA function calls are not allowed.
|
ExternalExpertCallsNotAllowed = 4020, // EA function calls are not allowed.
|
||||||
NotEnoughMemoryForReturnedString = 4021, // Not enough memory for a string returned from a function.
|
NotEnoughMemoryForReturnedString = 4021, // Not enough memory for a string returned from a function.
|
||||||
SystemBusy = 4022, // System is busy.
|
SystemBusy = 4022, // System is busy.
|
||||||
InvalidFunctionParametersCount = 4050, // Invalid function parameters count.
|
InvalidFunctionParametersCount = 4050, // Invalid function parameters count.
|
||||||
InvalidFunctionParameterValue = 4051, // Invalid function parameter value.
|
InvalidFunctionParameterValue = 4051, // Invalid function parameter value.
|
||||||
StringFunctionInternalError = 4052, // String function internal error.
|
StringFunctionInternalError = 4052, // String function internal error.
|
||||||
SomeArrayError = 4053, // Some array error.
|
SomeArrayError = 4053, // Some array error.
|
||||||
IncorrectSeriesArrayUsing = 4054, // Incorrect series array using.
|
IncorrectSeriesArrayUsing = 4054, // Incorrect series array using.
|
||||||
CustomIndicatorError = 4055, // Custom indicator error.
|
CustomIndicatorError = 4055, // Custom indicator error.
|
||||||
IncompatibleArrays = 4056, // Arrays are incompatible.
|
IncompatibleArrays = 4056, // Arrays are incompatible.
|
||||||
GlobalVariablesProcessingError = 4057, // Global variables processing error.
|
GlobalVariablesProcessingError = 4057, // Global variables processing error.
|
||||||
GlobalVariableNotFound = 4058, // Global variable not found.
|
GlobalVariableNotFound = 4058, // Global variable not found.
|
||||||
FunctionNotAllowedInTestingMode = 4059, // Function is not allowed in testing mode.
|
FunctionNotAllowedInTestingMode = 4059, // Function is not allowed in testing mode.
|
||||||
FunctionNotConfirmed = 4060, // Function is not confirmed.
|
FunctionNotConfirmed = 4060, // Function is not confirmed.
|
||||||
SendMailError = 4061, // Mail sending error.
|
SendMailError = 4061, // Mail sending error.
|
||||||
StringParameterExpected = 4062, // String parameter expected.
|
StringParameterExpected = 4062, // String parameter expected.
|
||||||
IntegerParameterExpected = 4063, // Integer parameter expected.
|
IntegerParameterExpected = 4063, // Integer parameter expected.
|
||||||
DoubleParameterExpected = 4064, // Double parameter expected.
|
DoubleParameterExpected = 4064, // Double parameter expected.
|
||||||
ArrayAsParameterExpected = 4065, // Array as parameter expected.
|
ArrayAsParameterExpected = 4065, // Array as parameter expected.
|
||||||
HistoryWillUpdated = 4066, // Requested history data in updating state.
|
HistoryWillUpdated = 4066, // Requested history data in updating state.
|
||||||
TradeError = 4067, // Some error in trade operation execution.
|
TradeError = 4067, // Some error in trade operation execution.
|
||||||
EndOfFile = 4099, // End of a file.
|
EndOfFile = 4099, // End of a file.
|
||||||
SomeFileError = 4100, // Some file error.
|
SomeFileError = 4100, // Some file error.
|
||||||
WrongFileName = 4101, // Wrong file name.
|
WrongFileName = 4101, // Wrong file name.
|
||||||
TooManyOpenedFiles = 4102, // Too many opened files.
|
TooManyOpenedFiles = 4102, // Too many opened files.
|
||||||
CannotOpenFile = 4103, // Cannot open file.
|
CannotOpenFile = 4103, // Cannot open file.
|
||||||
IncompatibleAccessToFile = 4104, // Incompatible access to a file.
|
IncompatibleAccessToFile = 4104, // Incompatible access to a file.
|
||||||
NoOrderSelected = 4105, // No order selected.
|
NoOrderSelected = 4105, // No order selected.
|
||||||
UnknownSymbol = 4106, // Unknown symbol.
|
UnknownSymbol = 4106, // Unknown symbol.
|
||||||
InvalidPriceParam = 4107, // Invalid price.
|
InvalidPriceParam = 4107, // Invalid price.
|
||||||
InvalidTicket = 4108, // Invalid ticket.
|
InvalidTicket = 4108, // Invalid ticket.
|
||||||
TradeNotAllowed = 4109, // Trade is not allowed.
|
TradeNotAllowed = 4109, // Trade is not allowed.
|
||||||
LongsNotAllowed = 4110, // Longs are not allowed.
|
LongsNotAllowed = 4110, // Longs are not allowed.
|
||||||
ShortsNotAllowed = 4111, // Shorts are not allowed.
|
ShortsNotAllowed = 4111, // Shorts are not allowed.
|
||||||
ObjectAlreadyExists = 4200, // Object already exists.
|
ObjectAlreadyExists = 4200, // Object already exists.
|
||||||
UnknownObjectProperty = 4201, // Unknown object property.
|
UnknownObjectProperty = 4201, // Unknown object property.
|
||||||
ObjectDoesNotExist = 4202, // Object does not exist.
|
ObjectDoesNotExist = 4202, // Object does not exist.
|
||||||
UnknownObjectType = 4203, // Unknown object type.
|
UnknownObjectType = 4203, // Unknown object type.
|
||||||
NoObjectName = 4204, // No object name.
|
NoObjectName = 4204, // No object name.
|
||||||
ObjectCoordinatesError = 4205, // Object coordinates error.
|
ObjectCoordinatesError = 4205, // Object coordinates error.
|
||||||
NoSpecifiedSubwindow = 4206, // No specified subwindow.
|
NoSpecifiedSubwindow = 4206, // No specified subwindow.
|
||||||
SomeObjectError = 4207 // Some error in object operation.
|
SomeObjectError = 4207 // Some error in object operation.
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+25
@@ -162,6 +162,8 @@
|
|||||||
this.label30 = new System.Windows.Forms.Label();
|
this.label30 = new System.Windows.Forms.Label();
|
||||||
this.comboBox8 = new System.Windows.Forms.ComboBox();
|
this.comboBox8 = new System.Windows.Forms.ComboBox();
|
||||||
this.button34 = new System.Windows.Forms.Button();
|
this.button34 = new System.Windows.Forms.Button();
|
||||||
|
this.button35 = new System.Windows.Forms.Button();
|
||||||
|
this.comboBox9 = new System.Windows.Forms.ComboBox();
|
||||||
this.groupBox1.SuspendLayout();
|
this.groupBox1.SuspendLayout();
|
||||||
this.statusStrip1.SuspendLayout();
|
this.statusStrip1.SuspendLayout();
|
||||||
this.groupBox2.SuspendLayout();
|
this.groupBox2.SuspendLayout();
|
||||||
@@ -1044,6 +1046,8 @@
|
|||||||
//
|
//
|
||||||
// tabPage4
|
// tabPage4
|
||||||
//
|
//
|
||||||
|
this.tabPage4.Controls.Add(this.comboBox9);
|
||||||
|
this.tabPage4.Controls.Add(this.button35);
|
||||||
this.tabPage4.Controls.Add(this.button34);
|
this.tabPage4.Controls.Add(this.button34);
|
||||||
this.tabPage4.Controls.Add(this.comboBox8);
|
this.tabPage4.Controls.Add(this.comboBox8);
|
||||||
this.tabPage4.Controls.Add(this.label30);
|
this.tabPage4.Controls.Add(this.label30);
|
||||||
@@ -1608,6 +1612,25 @@
|
|||||||
this.button34.UseVisualStyleBackColor = true;
|
this.button34.UseVisualStyleBackColor = true;
|
||||||
this.button34.Click += new System.EventHandler(this.button34_Click);
|
this.button34.Click += new System.EventHandler(this.button34_Click);
|
||||||
//
|
//
|
||||||
|
// button35
|
||||||
|
//
|
||||||
|
this.button35.Location = new System.Drawing.Point(208, 128);
|
||||||
|
this.button35.Name = "button35";
|
||||||
|
this.button35.Size = new System.Drawing.Size(111, 23);
|
||||||
|
this.button35.TabIndex = 33;
|
||||||
|
this.button35.Text = "TerminalInfoInteger";
|
||||||
|
this.button35.UseVisualStyleBackColor = true;
|
||||||
|
this.button35.Click += new System.EventHandler(this.button35_Click);
|
||||||
|
//
|
||||||
|
// comboBox9
|
||||||
|
//
|
||||||
|
this.comboBox9.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||||
|
this.comboBox9.FormattingEnabled = true;
|
||||||
|
this.comboBox9.Location = new System.Drawing.Point(13, 130);
|
||||||
|
this.comboBox9.Name = "comboBox9";
|
||||||
|
this.comboBox9.Size = new System.Drawing.Size(186, 21);
|
||||||
|
this.comboBox9.TabIndex = 34;
|
||||||
|
//
|
||||||
// Form1
|
// Form1
|
||||||
//
|
//
|
||||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||||
@@ -1788,6 +1811,8 @@
|
|||||||
private System.Windows.Forms.Label label30;
|
private System.Windows.Forms.Label label30;
|
||||||
private System.Windows.Forms.ComboBox comboBox8;
|
private System.Windows.Forms.ComboBox comboBox8;
|
||||||
private System.Windows.Forms.Button button34;
|
private System.Windows.Forms.Button button34;
|
||||||
|
private System.Windows.Forms.Button button35;
|
||||||
|
private System.Windows.Forms.ComboBox comboBox9;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ namespace TestApiClientUI
|
|||||||
comboBox6.DataSource = Enum.GetNames(typeof(ENUM_TIMEFRAMES));
|
comboBox6.DataSource = Enum.GetNames(typeof(ENUM_TIMEFRAMES));
|
||||||
comboBox7.DataSource = Enum.GetNames(typeof(EnumSymbolInfoDouble));
|
comboBox7.DataSource = Enum.GetNames(typeof(EnumSymbolInfoDouble));
|
||||||
comboBox8.DataSource = Enum.GetNames(typeof(MarketInfoModeType));
|
comboBox8.DataSource = Enum.GetNames(typeof(MarketInfoModeType));
|
||||||
|
comboBox9.DataSource = Enum.GetNames(typeof(EnumTerminalInfoInteger));
|
||||||
|
|
||||||
_apiClient.QuoteUpdated += apiClient_QuoteUpdated;
|
_apiClient.QuoteUpdated += apiClient_QuoteUpdated;
|
||||||
_apiClient.QuoteAdded += apiClient_QuoteAdded;
|
_apiClient.QuoteAdded += apiClient_QuoteAdded;
|
||||||
@@ -1264,5 +1265,15 @@ namespace TestApiClientUI
|
|||||||
PrintLog($"SymbolInfoTick: Tick - time = {result.Time}, Bid = {result.Bid}, Ask = {result.Ask}, Last = {result.Last}, Volume = {result.Volume}");
|
PrintLog($"SymbolInfoTick: Tick - time = {result.Time}, Bid = {result.Bid}, Ask = {result.Ask}, Last = {result.Last}, Volume = {result.Volume}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//TerminalInfoInteger
|
||||||
|
private async void button35_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
EnumTerminalInfoInteger propId;
|
||||||
|
Enum.TryParse(comboBox9.Text, out propId);
|
||||||
|
|
||||||
|
var result = await Execute(() => _apiClient.TerminalInfoInteger(propId));
|
||||||
|
PrintLog($"TerminalInfoInteger: result = {result}");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user