mirror of
https://github.com/vdemydiuk/mtapi.git
synced 2026-07-27 18:47:55 +00:00
Issue #35: Implemented function TerminalInfoDouble in MtApi MT4
This commit is contained in:
Executable
+8
@@ -0,0 +1,8 @@
|
||||
namespace MtApi
|
||||
{
|
||||
// https://docs.mql4.com/constants/environment_state/terminalstatus#enum_terminal_info_double
|
||||
public enum EnumTerminalInfoDouble
|
||||
{
|
||||
TERMINAL_COMMUNITY_BALANCE = 25 // Balance in MQL5.community
|
||||
}
|
||||
}
|
||||
@@ -62,6 +62,7 @@
|
||||
<Compile Include="EnumSeriesInfoInteger.cs" />
|
||||
<Compile Include="EnumSymbolInfoDouble.cs" />
|
||||
<Compile Include="EnumSymbolInfoInteger.cs" />
|
||||
<Compile Include="EnumTerminalInfoDouble.cs" />
|
||||
<Compile Include="EnumTerminalInfoInteger.cs" />
|
||||
<Compile Include="ExtensionMethods.cs" />
|
||||
<Compile Include="Monitors\AvailabilityOrdersEventArgs.cs" />
|
||||
|
||||
+12
-1
@@ -683,7 +683,18 @@ namespace MtApi
|
||||
return SendCommand<int>(MtCommandType.TerminalInfoInteger, commandParameters);
|
||||
}
|
||||
|
||||
//TODO: TerminalInfoDouble
|
||||
///<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_DOUBLE enumeration.</param>
|
||||
///<returns>
|
||||
///Value of double type.
|
||||
///</returns>
|
||||
public double TerminalInfoDouble(EnumTerminalInfoDouble propertyId)
|
||||
{
|
||||
var commandParameters = new ArrayList { (int)propertyId };
|
||||
return SendCommand<double>(MtCommandType.TerminalInfoDouble, commandParameters);
|
||||
}
|
||||
|
||||
///<summary>
|
||||
///Returns the name of company owning the client terminal.
|
||||
|
||||
@@ -63,7 +63,7 @@ namespace MtApi
|
||||
TerminalPath = 70,
|
||||
TerminalInfoString = 153,
|
||||
TerminalInfoInteger = 204,
|
||||
//TerminalInfoDouble = 205,
|
||||
TerminalInfoDouble = 205,
|
||||
|
||||
//Account Information
|
||||
AccountBalance = 40,
|
||||
|
||||
+25
@@ -164,6 +164,8 @@
|
||||
this.button34 = new System.Windows.Forms.Button();
|
||||
this.button35 = new System.Windows.Forms.Button();
|
||||
this.comboBox9 = new System.Windows.Forms.ComboBox();
|
||||
this.comboBox10 = new System.Windows.Forms.ComboBox();
|
||||
this.button36 = new System.Windows.Forms.Button();
|
||||
this.groupBox1.SuspendLayout();
|
||||
this.statusStrip1.SuspendLayout();
|
||||
this.groupBox2.SuspendLayout();
|
||||
@@ -1046,6 +1048,8 @@
|
||||
//
|
||||
// tabPage4
|
||||
//
|
||||
this.tabPage4.Controls.Add(this.button36);
|
||||
this.tabPage4.Controls.Add(this.comboBox10);
|
||||
this.tabPage4.Controls.Add(this.comboBox9);
|
||||
this.tabPage4.Controls.Add(this.button35);
|
||||
this.tabPage4.Controls.Add(this.button34);
|
||||
@@ -1631,6 +1635,25 @@
|
||||
this.comboBox9.Size = new System.Drawing.Size(186, 21);
|
||||
this.comboBox9.TabIndex = 34;
|
||||
//
|
||||
// comboBox10
|
||||
//
|
||||
this.comboBox10.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.comboBox10.FormattingEnabled = true;
|
||||
this.comboBox10.Location = new System.Drawing.Point(13, 157);
|
||||
this.comboBox10.Name = "comboBox10";
|
||||
this.comboBox10.Size = new System.Drawing.Size(186, 21);
|
||||
this.comboBox10.TabIndex = 35;
|
||||
//
|
||||
// button36
|
||||
//
|
||||
this.button36.Location = new System.Drawing.Point(208, 157);
|
||||
this.button36.Name = "button36";
|
||||
this.button36.Size = new System.Drawing.Size(111, 23);
|
||||
this.button36.TabIndex = 36;
|
||||
this.button36.Text = "TerminalInfoDouble";
|
||||
this.button36.UseVisualStyleBackColor = true;
|
||||
this.button36.Click += new System.EventHandler(this.button36_Click);
|
||||
//
|
||||
// Form1
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
@@ -1813,6 +1836,8 @@
|
||||
private System.Windows.Forms.Button button34;
|
||||
private System.Windows.Forms.Button button35;
|
||||
private System.Windows.Forms.ComboBox comboBox9;
|
||||
private System.Windows.Forms.Button button36;
|
||||
private System.Windows.Forms.ComboBox comboBox10;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -32,6 +32,7 @@ namespace TestApiClientUI
|
||||
comboBox7.DataSource = Enum.GetNames(typeof(EnumSymbolInfoDouble));
|
||||
comboBox8.DataSource = Enum.GetNames(typeof(MarketInfoModeType));
|
||||
comboBox9.DataSource = Enum.GetNames(typeof(EnumTerminalInfoInteger));
|
||||
comboBox10.DataSource = Enum.GetNames(typeof(EnumTerminalInfoDouble));
|
||||
|
||||
_apiClient.QuoteUpdated += apiClient_QuoteUpdated;
|
||||
_apiClient.QuoteAdded += apiClient_QuoteAdded;
|
||||
@@ -1275,5 +1276,15 @@ namespace TestApiClientUI
|
||||
var result = await Execute(() => _apiClient.TerminalInfoInteger(propId));
|
||||
PrintLog($"TerminalInfoInteger: result = {result}");
|
||||
}
|
||||
|
||||
//TerminalInfoDouble
|
||||
private async void button36_Click(object sender, EventArgs e)
|
||||
{
|
||||
EnumTerminalInfoDouble propId;
|
||||
Enum.TryParse(comboBox10.Text, out propId);
|
||||
|
||||
var result = await Execute(() => _apiClient.TerminalInfoDouble(propId));
|
||||
PrintLog($"TerminalInfoDouble: result = {result}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user