mirror of
https://github.com/vdemydiuk/mtapi.git
synced 2026-08-12 18:28:07 +00:00
Added function SymbolInfoInteger into MtApi (MT4). Added function sendLongResponse into library MTConnector
This commit is contained in:
@@ -659,23 +659,60 @@ namespace MtApi
|
||||
#endregion
|
||||
|
||||
#region Symbols
|
||||
///<summary>
|
||||
///Returns the number of available (selected in Market Watch or all) symbols.
|
||||
///</summary>
|
||||
///<param name="selected">Request mode. Can be true or false.</param>
|
||||
///<returns>
|
||||
///If the 'selected' parameter is true, the function returns the number of symbols selected in MarketWatch. If the value is false, it returns the total number of all symbols.
|
||||
///</returns>
|
||||
public int SymbolsTotal(bool selected)
|
||||
{
|
||||
var commandParameters = new ArrayList { selected };
|
||||
return SendCommand<int>(MtCommandType.SymbolsTotal, commandParameters);
|
||||
}
|
||||
|
||||
///<summary>
|
||||
///Returns the name of a symbol.
|
||||
///</summary>
|
||||
///<param name="pos">Order number of a symbol.</param>
|
||||
///<param name="selected">Request mode. If the value is true, the symbol is taken from the list of symbols selected in MarketWatch. If the value is false, the symbol is taken from the general list.</param>
|
||||
///<returns>
|
||||
///Value of string type with the symbol name.
|
||||
///</returns>
|
||||
public string SymbolName(int pos, bool selected)
|
||||
{
|
||||
var commandParameters = new ArrayList { pos, selected };
|
||||
return SendCommand<string>(MtCommandType.SymbolName, commandParameters);
|
||||
}
|
||||
|
||||
///<summary>
|
||||
///Selects a symbol in the Market Watch window or removes a symbol from the window.
|
||||
///</summary>
|
||||
///<param name="name">Symbol name</param>
|
||||
///<param name="select">Switch. If the value is false, a symbol should be removed from MarketWatch, otherwise a symbol should be selected in this window. A symbol can't be removed if the symbol chart is open, or there are open orders for this symbol.</param>
|
||||
///<returns>
|
||||
///In case of failure returns false.
|
||||
///</returns>
|
||||
public bool SymbolSelect(string name, bool select)
|
||||
{
|
||||
var commandParameters = new ArrayList { name, select };
|
||||
return SendCommand<bool>(MtCommandType.SymbolSelect, commandParameters);
|
||||
}
|
||||
|
||||
///<summary>
|
||||
///Returns the corresponding property of a specified symbol.
|
||||
///</summary>
|
||||
///<param name="name">Symbol name</param>
|
||||
///<param name="propId">Identifier of a symbol property. The value can be one of the values of the EnumSymbolInfoInteger enumeration</param>
|
||||
///<returns>
|
||||
///The value of long type.
|
||||
///</returns>
|
||||
public long SymbolInfoInteger(string name, EnumSymbolInfoInteger propId)
|
||||
{
|
||||
var commandParameters = new ArrayList { name, (int)propId };
|
||||
return SendCommand<long>(MtCommandType.SymbolInfoInteger, commandParameters);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Common Function
|
||||
|
||||
Reference in New Issue
Block a user