Issue #35: Implemented function TerminalInfoDouble in MtApi MT4

This commit is contained in:
vdemydiuk
2016-11-15 11:06:43 +02:00
parent 8e5dcbd2ee
commit 8e3f206c76
8 changed files with 58 additions and 2 deletions
+8
View File
@@ -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
}
}
+1
View File
@@ -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
View File
@@ -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.
+1 -1
View File
@@ -63,7 +63,7 @@ namespace MtApi
TerminalPath = 70,
TerminalInfoString = 153,
TerminalInfoInteger = 204,
//TerminalInfoDouble = 205,
TerminalInfoDouble = 205,
//Account Information
AccountBalance = 40,
+25
View File
@@ -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;
}
}
+11
View File
@@ -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}");
}
}
}
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.