Added stub for logging in MtApi5. Implemented function SendCommand. Get quotes after connection

This commit is contained in:
Viacheslav Demydiuk
2024-01-11 22:54:56 +02:00
parent af5dd93056
commit cd7648b320
9 changed files with 266 additions and 232 deletions
+2 -18
View File
@@ -4,14 +4,10 @@ namespace MtApi5
{
internal static class MtConverters
{
private static readonly MtLog Log = LogConfigurator.GetLogger(typeof(MtConverters));
#region Values Converters
public static bool ParseResult(this string inputString, char separator, out double result)
{
Log.Debug($"ParseResult: inputString = {inputString}, separator = {separator}");
var retVal = false;
result = 0;
@@ -26,25 +22,18 @@ namespace MtApi5
result = double.Parse(values[1]);
}
catch (Exception ex)
catch (Exception)
{
retVal = false;
Log.Error($"ParseResult: {ex.Message}");
}
}
}
else
{
Log.Warn("ParseResult: input srting is null or empty!");
}
return retVal;
}
public static bool ParseResult(this string inputString, char separator, out DateTime from, out DateTime to)
{
Log.Debug($"ParseResult: inputString = {inputString}, separator = {separator}");
var retVal = false;
from = new DateTime();
@@ -65,17 +54,12 @@ namespace MtApi5
var iTo= int.Parse(values[2]);
to = Mt5TimeConverter.ConvertFromMtTime(iTo);
}
catch (Exception ex)
catch (Exception)
{
retVal = false;
Log.Error($"ParseResult: {ex.Message}");
}
}
}
else
{
Log.Warn("ParseResult: input srting is null or empty!");
}
return retVal;
}