Minor refactoring to remove code syle warnings

This commit is contained in:
vdemydiuk
2018-02-19 13:37:43 +02:00
parent 3a4f561836
commit c9c188f697
8 changed files with 28 additions and 31 deletions
+2 -1
View File
@@ -1,4 +1,5 @@
using System;
// ReSharper disable InconsistentNaming
using System;
namespace MtApi5
{
+2 -1
View File
@@ -1,4 +1,5 @@
using System;
// ReSharper disable InconsistentNaming
using System;
namespace MtApi5
{
+11 -9
View File
@@ -1,15 +1,17 @@
namespace MtApi5
// ReSharper disable InconsistentNaming
namespace MtApi5
{
public class MqlTradeCheckResult
{
public uint Retcode { get; private set; } // Reply code
public double Balance { get; private set; } // Balance after the execution of the deal
public double Equity { get; private set; } // Equity after the execution of the deal
public double Profit { get; private set; } // Floating profit
public double Margin { get; private set; } // Margin requirements
public double Margin_free { get; private set; } // Free margin
public double Margin_level { get; private set; } // Margin level
public string Comment { get; private set; } // Comment to the reply code (description of the error)
public uint Retcode { get; } // Reply code
public double Balance { get; } // Balance after the execution of the deal
public double Equity { get; } // Equity after the execution of the deal
public double Profit { get; } // Floating profit
public double Margin { get; } // Margin requirements
public double Margin_free { get; } // Free margin
public double Margin_level { get; } // Margin level
public string Comment { get; } // Comment to the reply code (description of the error)
public MqlTradeCheckResult(uint retcode
, double balance
+2 -1
View File
@@ -1,4 +1,5 @@
namespace MtApi5
// ReSharper disable InconsistentNaming
namespace MtApi5
{
internal enum Mt5CommandType
{
+2 -2
View File
@@ -4,8 +4,8 @@ namespace MtApi5
{
public class Mt5ConnectionEventArgs: EventArgs
{
public Mt5ConnectionState Status { get; private set; }
public string ConnectionMessage { get; private set; }
public Mt5ConnectionState Status { get; }
public string ConnectionMessage { get; }
public Mt5ConnectionEventArgs(Mt5ConnectionState status, string message)
{
+1 -4
View File
@@ -1,13 +1,10 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace MtApi5
{
public class Mt5QuoteEventArgs: EventArgs
{
public Mt5Quote Quote { get; private set; }
public Mt5Quote Quote { get; }
public Mt5QuoteEventArgs(Mt5Quote quote)
{
+7 -12
View File
@@ -1,32 +1,27 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace MtApi5
{
class Mt5TimeConverter
internal class Mt5TimeConverter
{
public static DateTime ConvertFromMtTime(int time)
{
DateTime tmpTime = new DateTime(1970, 1, 1);
var tmpTime = new DateTime(1970, 1, 1);
return new DateTime(tmpTime.Ticks + (time * 0x989680L));
}
public static DateTime ConvertFromMtTime(long time)
{
DateTime tmpTime = new DateTime(1970, 1, 1);
var tmpTime = new DateTime(1970, 1, 1);
return new DateTime(tmpTime.Ticks + (time * 0x989680L));
}
public static int ConvertToMtTime(DateTime time)
{
int result = 0;
if (time != DateTime.MinValue)
{
DateTime tmpTime = new DateTime(1970, 1, 1);
result = (int)((time.Ticks - tmpTime.Ticks) / 0x989680L);
}
var result = 0;
if (time == DateTime.MinValue) return result;
var tmpTime = new DateTime(1970, 1, 1);
result = (int)((time.Ticks - tmpTime.Ticks) / 0x989680L);
return result;
}
}
+1 -1
View File
@@ -719,7 +719,7 @@ namespace MtApi5
return ratesArray?.Length ?? 0;
}
///<summary>
///Gets history data of MqlRates structure of a specified symbol-period in specified quantity into the ratesArray array. The elements ordering of the copied data is from present to the past, i.e., starting position of 0 means the current bar.
///</summary>