Issue #32: Added function ChartId

This commit is contained in:
vdemydiuk
2016-11-28 16:03:40 +02:00
parent e333164552
commit 5abfeebc90
6 changed files with 69 additions and 24 deletions
+14
View File
@@ -1710,6 +1710,20 @@ namespace MtApi
}
#endregion
#region Chart Operations
///<summary>
///Returns the ID of the current chart.
///</summary>
///<returns>
/// Value of long type.
///</returns>
public long ChartId()
{
return SendCommand<long>(MtCommandType.ChartId, null);
}
#endregion
#region Private Methods
private MtClient Client
{
+3 -7
View File
@@ -1,9 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace MtApi
namespace MtApi
{
enum MtCommandType
{
@@ -201,6 +196,7 @@ namespace MtApi
SymbolsTotal = 200,
SymbolName = 201,
SymbolSelect = 202,
SymbolInfoInteger = 203
SymbolInfoInteger = 203,
ChartId = 206
}
}
+45 -17
View File
@@ -39,6 +39,7 @@
this.statusStrip1 = new System.Windows.Forms.StatusStrip();
this.toolStripStatusConnection = new System.Windows.Forms.ToolStripStatusLabel();
this.groupBox2 = new System.Windows.Forms.GroupBox();
this.checkBox2 = new System.Windows.Forms.CheckBox();
this.listViewQuotes = new System.Windows.Forms.ListView();
this.colSymbol = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.colBid = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
@@ -166,7 +167,8 @@
this.button28 = new System.Windows.Forms.Button();
this.label28 = new System.Windows.Forms.Label();
this.textBox1 = new System.Windows.Forms.TextBox();
this.checkBox2 = new System.Windows.Forms.CheckBox();
this.tabPage9 = new System.Windows.Forms.TabPage();
this.button37 = new System.Windows.Forms.Button();
this.groupBox1.SuspendLayout();
this.statusStrip1.SuspendLayout();
this.groupBox2.SuspendLayout();
@@ -183,6 +185,7 @@
this.tabPage6.SuspendLayout();
this.tabPage7.SuspendLayout();
this.tabPage8.SuspendLayout();
this.tabPage9.SuspendLayout();
this.SuspendLayout();
//
// textBoxServerName
@@ -281,6 +284,17 @@
this.groupBox2.TabStop = false;
this.groupBox2.Text = "Quotes:";
//
// checkBox2
//
this.checkBox2.AutoSize = true;
this.checkBox2.Location = new System.Drawing.Point(6, 296);
this.checkBox2.Name = "checkBox2";
this.checkBox2.Size = new System.Drawing.Size(281, 17);
this.checkBox2.TabIndex = 16;
this.checkBox2.Text = "Use selected ExpertHandle (chart) as default executor";
this.checkBox2.UseVisualStyleBackColor = true;
this.checkBox2.CheckedChanged += new System.EventHandler(this.checkBox2_CheckedChanged);
//
// listViewQuotes
//
this.listViewQuotes.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
@@ -292,6 +306,7 @@
this.colAsk,
this.colExpertHandle});
this.listViewQuotes.FullRowSelect = true;
this.listViewQuotes.HideSelection = false;
this.listViewQuotes.Location = new System.Drawing.Point(6, 19);
this.listViewQuotes.MultiSelect = false;
this.listViewQuotes.Name = "listViewQuotes";
@@ -351,6 +366,7 @@
this.tabControl1.Controls.Add(this.tabPage6);
this.tabControl1.Controls.Add(this.tabPage7);
this.tabControl1.Controls.Add(this.tabPage8);
this.tabControl1.Controls.Add(this.tabPage9);
this.tabControl1.Location = new System.Drawing.Point(324, 12);
this.tabControl1.Multiline = true;
this.tabControl1.Name = "tabControl1";
@@ -872,7 +888,7 @@
this.tabPage1.Location = new System.Drawing.Point(4, 22);
this.tabPage1.Name = "tabPage1";
this.tabPage1.Padding = new System.Windows.Forms.Padding(3);
this.tabPage1.Size = new System.Drawing.Size(638, 377);
this.tabPage1.Size = new System.Drawing.Size(638, 401);
this.tabPage1.TabIndex = 2;
this.tabPage1.Text = "Check Status";
this.tabPage1.UseVisualStyleBackColor = true;
@@ -950,7 +966,7 @@
this.tabPage3.Location = new System.Drawing.Point(4, 22);
this.tabPage3.Name = "tabPage3";
this.tabPage3.Padding = new System.Windows.Forms.Padding(3);
this.tabPage3.Size = new System.Drawing.Size(638, 377);
this.tabPage3.Size = new System.Drawing.Size(638, 401);
this.tabPage3.TabIndex = 3;
this.tabPage3.Text = "Account Information";
this.tabPage3.UseVisualStyleBackColor = true;
@@ -1073,7 +1089,7 @@
this.tabPage4.Location = new System.Drawing.Point(4, 22);
this.tabPage4.Name = "tabPage4";
this.tabPage4.Padding = new System.Windows.Forms.Padding(3);
this.tabPage4.Size = new System.Drawing.Size(638, 377);
this.tabPage4.Size = new System.Drawing.Size(638, 401);
this.tabPage4.TabIndex = 4;
this.tabPage4.Text = "MarketInfo";
this.tabPage4.UseVisualStyleBackColor = true;
@@ -1251,7 +1267,7 @@
this.tabPage5.Location = new System.Drawing.Point(4, 22);
this.tabPage5.Name = "tabPage5";
this.tabPage5.Padding = new System.Windows.Forms.Padding(3);
this.tabPage5.Size = new System.Drawing.Size(638, 377);
this.tabPage5.Size = new System.Drawing.Size(638, 401);
this.tabPage5.TabIndex = 5;
this.tabPage5.Text = "Timeframes";
this.tabPage5.UseVisualStyleBackColor = true;
@@ -1479,7 +1495,7 @@
this.tabPage6.Location = new System.Drawing.Point(4, 22);
this.tabPage6.Name = "tabPage6";
this.tabPage6.Padding = new System.Windows.Forms.Padding(3);
this.tabPage6.Size = new System.Drawing.Size(638, 377);
this.tabPage6.Size = new System.Drawing.Size(638, 401);
this.tabPage6.TabIndex = 6;
this.tabPage6.Text = "Client Terminal";
this.tabPage6.UseVisualStyleBackColor = true;
@@ -1528,7 +1544,7 @@
this.tabPage7.Location = new System.Drawing.Point(4, 22);
this.tabPage7.Name = "tabPage7";
this.tabPage7.Padding = new System.Windows.Forms.Padding(3);
this.tabPage7.Size = new System.Drawing.Size(638, 377);
this.tabPage7.Size = new System.Drawing.Size(638, 401);
this.tabPage7.TabIndex = 7;
this.tabPage7.Text = "Technical Indicators";
this.tabPage7.UseVisualStyleBackColor = true;
@@ -1565,7 +1581,7 @@
this.tabPage8.Location = new System.Drawing.Point(4, 40);
this.tabPage8.Name = "tabPage8";
this.tabPage8.Padding = new System.Windows.Forms.Padding(3);
this.tabPage8.Size = new System.Drawing.Size(638, 359);
this.tabPage8.Size = new System.Drawing.Size(638, 383);
this.tabPage8.TabIndex = 8;
this.tabPage8.Text = "Symbols";
this.tabPage8.UseVisualStyleBackColor = true;
@@ -1661,16 +1677,25 @@
this.textBox1.TabIndex = 0;
this.textBox1.Text = "EURUSD";
//
// checkBox2
// tabPage9
//
this.checkBox2.AutoSize = true;
this.checkBox2.Location = new System.Drawing.Point(6, 296);
this.checkBox2.Name = "checkBox2";
this.checkBox2.Size = new System.Drawing.Size(281, 17);
this.checkBox2.TabIndex = 16;
this.checkBox2.Text = "Use selected ExpertHandle (chart) as default executor";
this.checkBox2.UseVisualStyleBackColor = true;
this.checkBox2.CheckedChanged += new System.EventHandler(this.checkBox2_CheckedChanged);
this.tabPage9.Controls.Add(this.button37);
this.tabPage9.Location = new System.Drawing.Point(4, 40);
this.tabPage9.Name = "tabPage9";
this.tabPage9.Size = new System.Drawing.Size(638, 383);
this.tabPage9.TabIndex = 9;
this.tabPage9.Text = "Chart Operations";
this.tabPage9.UseVisualStyleBackColor = true;
//
// button37
//
this.button37.Location = new System.Drawing.Point(12, 8);
this.button37.Name = "button37";
this.button37.Size = new System.Drawing.Size(75, 23);
this.button37.TabIndex = 0;
this.button37.Text = "ChartID";
this.button37.UseVisualStyleBackColor = true;
this.button37.Click += new System.EventHandler(this.button37_Click);
//
// Form1
//
@@ -1713,6 +1738,7 @@
this.tabPage7.ResumeLayout(false);
this.tabPage8.ResumeLayout(false);
this.tabPage8.PerformLayout();
this.tabPage9.ResumeLayout(false);
this.ResumeLayout(false);
this.PerformLayout();
@@ -1858,6 +1884,8 @@
private System.Windows.Forms.Button button36;
private System.Windows.Forms.ComboBox comboBox10;
private System.Windows.Forms.CheckBox checkBox2;
private System.Windows.Forms.TabPage tabPage9;
private System.Windows.Forms.Button button37;
}
}
+7
View File
@@ -1296,5 +1296,12 @@ namespace TestApiClientUI
_apiClient.ExecutorHandle = expertHandle;
}
//CharID
private async void button37_Click(object sender, EventArgs e)
{
var result = await Execute(() => _apiClient.ChartId());
PrintLog($"CharID: result = {result}");
}
}
}
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.