diff --git a/MtApi/MtApiClient.cs b/MtApi/MtApiClient.cs index bb10cb80..a55dbcc6 100755 --- a/MtApi/MtApiClient.cs +++ b/MtApi/MtApiClient.cs @@ -1710,6 +1710,20 @@ namespace MtApi } #endregion + #region Chart Operations + + /// + ///Returns the ID of the current chart. + /// + /// + /// Value of long type. + /// + public long ChartId() + { + return SendCommand(MtCommandType.ChartId, null); + } + #endregion + #region Private Methods private MtClient Client { diff --git a/MtApi/MtCommandType.cs b/MtApi/MtCommandType.cs index 34370772..c54a0689 100755 --- a/MtApi/MtCommandType.cs +++ b/MtApi/MtCommandType.cs @@ -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 } } diff --git a/TestClients/TestApiClientUI/Form1.Designer.cs b/TestClients/TestApiClientUI/Form1.Designer.cs index 3323cd3d..d0a126e5 100644 --- a/TestClients/TestApiClientUI/Form1.Designer.cs +++ b/TestClients/TestApiClientUI/Form1.Designer.cs @@ -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; } } diff --git a/TestClients/TestApiClientUI/Form1.cs b/TestClients/TestApiClientUI/Form1.cs index 67406aa5..424e1a73 100644 --- a/TestClients/TestApiClientUI/Form1.cs +++ b/TestClients/TestApiClientUI/Form1.cs @@ -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}"); + } } } diff --git a/mq4/MtApi.ex4 b/mq4/MtApi.ex4 index a4c15638..8209da16 100755 Binary files a/mq4/MtApi.ex4 and b/mq4/MtApi.ex4 differ diff --git a/mq4/MtApi.mq4 b/mq4/MtApi.mq4 index d1364806..6a6054a2 100755 Binary files a/mq4/MtApi.mq4 and b/mq4/MtApi.mq4 differ