Issue #81: Added function TimeGMT into MtApi (MT4)

This commit is contained in:
vdemydiuk
2018-02-13 19:02:08 +02:00
parent a238e5eb36
commit 5c96aeb2fd
6 changed files with 51 additions and 21 deletions
+6
View File
@@ -994,6 +994,12 @@ namespace MtApi
return MtApiTimeConverter.ConvertFromMtTime(commandResponse); return MtApiTimeConverter.ConvertFromMtTime(commandResponse);
} }
public DateTime TimeGMT()
{
var commandResponse = SendCommand<int>(MtCommandType.TimeGMT, null);
return MtApiTimeConverter.ConvertFromMtTime(commandResponse);
}
public int TimeDay(DateTime date) public int TimeDay(DateTime date)
{ {
var commandParameters = new ArrayList { MtApiTimeConverter.ConvertToMtTime(date) }; var commandParameters = new ArrayList { MtApiTimeConverter.ConvertToMtTime(date) };
+1
View File
@@ -111,6 +111,7 @@
TimeSeconds = 86, TimeSeconds = 86,
TimeYear = 87, TimeYear = 87,
Year = 88, Year = 88,
TimeGMT = 281,
//Global Variables //Global Variables
GlobalVariableCheck = 89, GlobalVariableCheck = 89,
+34 -21
View File
@@ -143,6 +143,8 @@
this.label23 = new System.Windows.Forms.Label(); this.label23 = new System.Windows.Forms.Label();
this.textBoxAccountInfoSymbol = new System.Windows.Forms.TextBox(); this.textBoxAccountInfoSymbol = new System.Windows.Forms.TextBox();
this.tabPage4 = new System.Windows.Forms.TabPage(); this.tabPage4 = new System.Windows.Forms.TabPage();
this.comboBox12 = new System.Windows.Forms.ComboBox();
this.button72 = new System.Windows.Forms.Button();
this.button36 = new System.Windows.Forms.Button(); this.button36 = new System.Windows.Forms.Button();
this.comboBox10 = new System.Windows.Forms.ComboBox(); this.comboBox10 = new System.Windows.Forms.ComboBox();
this.comboBox9 = new System.Windows.Forms.ComboBox(); this.comboBox9 = new System.Windows.Forms.ComboBox();
@@ -210,8 +212,7 @@
this.button4 = new System.Windows.Forms.Button(); this.button4 = new System.Windows.Forms.Button();
this.tabPage11 = new System.Windows.Forms.TabPage(); this.tabPage11 = new System.Windows.Forms.TabPage();
this.button69 = new System.Windows.Forms.Button(); this.button69 = new System.Windows.Forms.Button();
this.button72 = new System.Windows.Forms.Button(); this.button73 = new System.Windows.Forms.Button();
this.comboBox12 = new System.Windows.Forms.ComboBox();
this.groupBox1.SuspendLayout(); this.groupBox1.SuspendLayout();
this.statusStrip1.SuspendLayout(); this.statusStrip1.SuspendLayout();
this.groupBox2.SuspendLayout(); this.groupBox2.SuspendLayout();
@@ -1454,6 +1455,25 @@
this.tabPage4.Text = "MarketInfo"; this.tabPage4.Text = "MarketInfo";
this.tabPage4.UseVisualStyleBackColor = true; this.tabPage4.UseVisualStyleBackColor = true;
// //
// comboBox12
//
this.comboBox12.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.comboBox12.FormattingEnabled = true;
this.comboBox12.Location = new System.Drawing.Point(13, 188);
this.comboBox12.Name = "comboBox12";
this.comboBox12.Size = new System.Drawing.Size(186, 21);
this.comboBox12.TabIndex = 38;
//
// button72
//
this.button72.Location = new System.Drawing.Point(208, 186);
this.button72.Name = "button72";
this.button72.Size = new System.Drawing.Size(111, 23);
this.button72.TabIndex = 37;
this.button72.Text = "TerminalInfoString";
this.button72.UseVisualStyleBackColor = true;
this.button72.Click += new System.EventHandler(this.button72_Click);
//
// button36 // button36
// //
this.button36.Location = new System.Drawing.Point(208, 157); this.button36.Location = new System.Drawing.Point(208, 157);
@@ -1848,6 +1868,7 @@
// //
// tabPage6 // tabPage6
// //
this.tabPage6.Controls.Add(this.button73);
this.tabPage6.Controls.Add(this.textBoxPrint); this.tabPage6.Controls.Add(this.textBoxPrint);
this.tabPage6.Controls.Add(this.button27); this.tabPage6.Controls.Add(this.button27);
this.tabPage6.Controls.Add(this.button14); this.tabPage6.Controls.Add(this.button14);
@@ -1862,14 +1883,14 @@
// //
// textBoxPrint // textBoxPrint
// //
this.textBoxPrint.Location = new System.Drawing.Point(13, 86); this.textBoxPrint.Location = new System.Drawing.Point(13, 108);
this.textBoxPrint.Name = "textBoxPrint"; this.textBoxPrint.Name = "textBoxPrint";
this.textBoxPrint.Size = new System.Drawing.Size(386, 20); this.textBoxPrint.Size = new System.Drawing.Size(386, 20);
this.textBoxPrint.TabIndex = 3; this.textBoxPrint.TabIndex = 3;
// //
// button27 // button27
// //
this.button27.Location = new System.Drawing.Point(405, 84); this.button27.Location = new System.Drawing.Point(405, 106);
this.button27.Name = "button27"; this.button27.Name = "button27";
this.button27.Size = new System.Drawing.Size(75, 23); this.button27.Size = new System.Drawing.Size(75, 23);
this.button27.TabIndex = 2; this.button27.TabIndex = 2;
@@ -2150,24 +2171,15 @@
this.button69.UseVisualStyleBackColor = true; this.button69.UseVisualStyleBackColor = true;
this.button69.Click += new System.EventHandler(this.button69_Click); this.button69.Click += new System.EventHandler(this.button69_Click);
// //
// button72 // button73
// //
this.button72.Location = new System.Drawing.Point(208, 186); this.button73.Location = new System.Drawing.Point(13, 74);
this.button72.Name = "button72"; this.button73.Name = "button73";
this.button72.Size = new System.Drawing.Size(111, 23); this.button73.Size = new System.Drawing.Size(75, 23);
this.button72.TabIndex = 37; this.button73.TabIndex = 4;
this.button72.Text = "TerminalInfoString"; this.button73.Text = "TimeGMT";
this.button72.UseVisualStyleBackColor = true; this.button73.UseVisualStyleBackColor = true;
this.button72.Click += new System.EventHandler(this.button72_Click); this.button73.Click += new System.EventHandler(this.button73_Click);
//
// comboBox12
//
this.comboBox12.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.comboBox12.FormattingEnabled = true;
this.comboBox12.Location = new System.Drawing.Point(13, 188);
this.comboBox12.Name = "comboBox12";
this.comboBox12.Size = new System.Drawing.Size(186, 21);
this.comboBox12.TabIndex = 38;
// //
// Form1 // Form1
// //
@@ -2404,6 +2416,7 @@
private System.Windows.Forms.Button button71; private System.Windows.Forms.Button button71;
private System.Windows.Forms.ComboBox comboBox12; private System.Windows.Forms.ComboBox comboBox12;
private System.Windows.Forms.Button button72; private System.Windows.Forms.Button button72;
private System.Windows.Forms.Button button73;
} }
} }
+10
View File
@@ -616,18 +616,28 @@ namespace TestApiClientUI
listBoxProceHistory.DataSource = items; listBoxProceHistory.DataSource = items;
} }
//TimeCurrent
private void button13_Click(object sender, EventArgs e) private void button13_Click(object sender, EventArgs e)
{ {
var retVal = _apiClient.TimeCurrent(); var retVal = _apiClient.TimeCurrent();
PrintLog($"TimeCurrent result: {retVal}"); PrintLog($"TimeCurrent result: {retVal}");
} }
//TimeLocal
private void button14_Click(object sender, EventArgs e) private void button14_Click(object sender, EventArgs e)
{ {
var retVal = _apiClient.TimeLocal(); var retVal = _apiClient.TimeLocal();
PrintLog($"TimeLocal result: {retVal}"); PrintLog($"TimeLocal result: {retVal}");
} }
//TimeGMT
private void button73_Click(object sender, EventArgs e)
{
var retVal = _apiClient.TimeGMT();
PrintLog($"TimeGMT result: {retVal}");
}
//RefreshRates
private void buttonRefreshRates_Click(object sender, EventArgs e) private void buttonRefreshRates_Click(object sender, EventArgs e)
{ {
var retVal = _apiClient.RefreshRates(); var retVal = _apiClient.RefreshRates();
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.