Skip to content

Commit

Permalink
Merge pull request AlexWan#4 from AlexWan/master
Browse files Browse the repository at this point in the history
Update repo
  • Loading branch information
Freezstylik authored Feb 25, 2019
2 parents e65d75e + 46b0942 commit 265adb5
Show file tree
Hide file tree
Showing 95 changed files with 7,054 additions and 6,634 deletions.
22 changes: 11 additions & 11 deletions project/OsEngine/Language/MinerLocal.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Your rights to use code governed by this license http://o-s-a.net/doc/license_simple_engine.pdf
* Your rights to use code governed by this license https://github.com/AlexWan/OsEngine/blob/master/LICENSE
* Ваши права на использование кода регулируются данной лицензией http://o-s-a.net/doc/license_simple_engine.pdf
*/

Expand Down Expand Up @@ -123,16 +123,16 @@ public class MinerLocal
"Ru:По паттерну небыло сделок_");

public string Label17 => OsLocalization.ConvertToLocString(
"Eng:Total profit -_" +
"Ru:Общий профит -_");
"Eng:Total profit _" +
"Ru:Общий профит _");

public string Label18 => OsLocalization.ConvertToLocString(
"Eng:Number of deals -_" +
"Ru:Количество входов -_");
"Eng:Number of deals _" +
"Ru:Количество входов _");

public string Label19 => OsLocalization.ConvertToLocString(
"Eng:Profit from deal -_" +
"Ru:Прибыль со сделки -_");
"Eng:Profit from deal _" +
"Ru:Прибыль со сделки _");

public string Label20 => OsLocalization.ConvertToLocString(
"Eng:Pattern search completed. We checked all the data_" +
Expand All @@ -144,7 +144,7 @@ public class MinerLocal

public string Label22 => OsLocalization.ConvertToLocString(
"Eng:Weight can not be zero_" +
"Ru:Вес не может быть нулевым_");
"Ru:Вес не может быть нулевым_");

public string Label23 => OsLocalization.ConvertToLocString(
"Eng:It is impossible to set a pattern for closing positions at that moment when there is not a single pattern for opening!_" +
Expand All @@ -169,7 +169,7 @@ public class MinerLocal
public string Label28 => OsLocalization.ConvertToLocString(
"Eng:Test_" +
"Ru:Пересчитать_");

public string Label29 => OsLocalization.ConvertToLocString(
"Eng:Tests the current configuration of patterns without a pattern in the search tab_" +
"Ru:Тестирует текущую конфигурацию паттернов без учёта паттерна во вкладке поиска_");
Expand Down Expand Up @@ -197,7 +197,7 @@ public class MinerLocal
public string Label35 => OsLocalization.ConvertToLocString(
"Eng:Source_" +
"Ru:Источник_");

public string Label36 => OsLocalization.ConvertToLocString(
"Eng:Folder - data folder. Set - data set downloaded with OsData_" +
"Ru:Folder - папка с данными.Set - сет данных скаченный при помощи OsData_");
Expand Down Expand Up @@ -354,4 +354,4 @@ public class MinerLocal
"Eng:Type_" +
"Ru:Тип_");
}
}
}
13 changes: 7 additions & 6 deletions project/OsEngine/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
/*
*Ваши права на использование кода регулируются данной лицензией http://o-s-a.net/doc/license_simple_engine.pdf
* Your rights to use code governed by this license https://github.com/AlexWan/OsEngine/blob/master/LICENSE
* Ваши права на использование кода регулируются данной лицензией http://o-s-a.net/doc/license_simple_engine.pdf
*/

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Globalization;
using System.IO;
Expand All @@ -23,12 +22,12 @@
using OsEngine.OsOptimizer;
using OsEngine.OsTrader.Gui;
using OsEngine.PrimeSettings;
using Localization = System.Windows.Localization;

namespace OsEngine
{

/// <summary>
/// Application start screen
/// Стартовое окно приложения
/// </summary>
public partial class MainWindow
Expand All @@ -42,6 +41,7 @@ public static Dispatcher GetDispatcher
}

/// <summary>
/// is application running
/// работает ли приложение или закрывается
/// </summary>
public static bool ProccesIsWorked;
Expand Down Expand Up @@ -80,7 +80,6 @@ public MainWindow()
Close();
}

// передаём в менеджер сообщений объект центарльного потока
AlertMessageManager.TextBoxFromStaThread = new TextBox();

ProccesIsWorked = true;
Expand Down Expand Up @@ -115,6 +114,7 @@ private void ChangeText()
}

/// <summary>
/// check the version of dotnet
/// проверить версию дотНет
/// </summary>
private bool CheckDotNetVersion()
Expand Down Expand Up @@ -155,6 +155,7 @@ private bool CheckDotNetVersion()
}

/// <summary>
/// check the permission of the program to create files in the directory
/// проверяем разрешение программы создавать файлы в директории
/// </summary>
private bool CheckWorkWithDirectory()
Expand Down Expand Up @@ -339,7 +340,7 @@ private void ButtonSettings_Click(object sender, RoutedEventArgs e)
{
_settingsUi = new PrimeSettingsMasterUi();
_settingsUi.Show();
_settingsUi.Closing += delegate(object o, CancelEventArgs args) { _settingsUi = null; };
_settingsUi.Closing += delegate { _settingsUi = null; };
}
else
{
Expand Down
20 changes: 10 additions & 10 deletions project/OsEngine/Market/Servers/Binance/BinanceClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -303,11 +303,11 @@ private List<Candle> _deserializeCandles(string jsonCandles)

newCandle = new Candle();
newCandle.TimeStart = new DateTime(1970, 1, 1).AddMilliseconds(Convert.ToDouble(param[0]));
newCandle.Low = Convert.ToDecimal(param[3].Replace(".", CultureInfo.InvariantCulture.NumberFormat.NumberDecimalSeparator).Trim(new char[] { '"', '"' }));
newCandle.High = Convert.ToDecimal(param[2].Replace(".", CultureInfo.InvariantCulture.NumberFormat.NumberDecimalSeparator).Trim(new char[] { '"', '"' }));
newCandle.Open = Convert.ToDecimal(param[1].Replace(".", CultureInfo.InvariantCulture.NumberFormat.NumberDecimalSeparator).Trim(new char[] { '"', '"' }));
newCandle.Close = Convert.ToDecimal(param[4].Replace(".", CultureInfo.InvariantCulture.NumberFormat.NumberDecimalSeparator).Trim(new char[] { '"', '"' }));
newCandle.Volume = Convert.ToDecimal(param[5].Replace(".", CultureInfo.InvariantCulture.NumberFormat.NumberDecimalSeparator).Trim(new char[] { '"', '"' }));
newCandle.Low = Convert.ToDecimal(param[3].Replace(".", CultureInfo.InvariantCulture.NumberFormat.NumberDecimalSeparator).Trim(new char[] { '"', '"' }), CultureInfo.InvariantCulture);
newCandle.High = Convert.ToDecimal(param[2].Replace(".", CultureInfo.InvariantCulture.NumberFormat.NumberDecimalSeparator).Trim(new char[] { '"', '"' }), CultureInfo.InvariantCulture);
newCandle.Open = Convert.ToDecimal(param[1].Replace(".", CultureInfo.InvariantCulture.NumberFormat.NumberDecimalSeparator).Trim(new char[] { '"', '"' }), CultureInfo.InvariantCulture);
newCandle.Close = Convert.ToDecimal(param[4].Replace(".", CultureInfo.InvariantCulture.NumberFormat.NumberDecimalSeparator).Trim(new char[] { '"', '"' }), CultureInfo.InvariantCulture);
newCandle.Volume = Convert.ToDecimal(param[5].Replace(".", CultureInfo.InvariantCulture.NumberFormat.NumberDecimalSeparator).Trim(new char[] { '"', '"' }), CultureInfo.InvariantCulture);

_candles.Add(newCandle);
}
Expand All @@ -317,11 +317,11 @@ private List<Candle> _deserializeCandles(string jsonCandles)

newCandle = new Candle();
newCandle.TimeStart = new DateTime(1970, 1, 1).AddMilliseconds(Convert.ToDouble(param[0]));
newCandle.Low = Convert.ToDecimal(param[3].Replace(".", CultureInfo.InvariantCulture.NumberFormat.NumberDecimalSeparator).Trim(new char[] { '"', '"' }));
newCandle.High = Convert.ToDecimal(param[2].Replace(".", CultureInfo.InvariantCulture.NumberFormat.NumberDecimalSeparator).Trim(new char[] { '"', '"' }));
newCandle.Open = Convert.ToDecimal(param[1].Replace(".", CultureInfo.InvariantCulture.NumberFormat.NumberDecimalSeparator).Trim(new char[] { '"', '"' }));
newCandle.Close = Convert.ToDecimal(param[4].Replace(".", CultureInfo.InvariantCulture.NumberFormat.NumberDecimalSeparator).Trim(new char[] { '"', '"' }));
newCandle.Volume = Convert.ToDecimal(param[5].Replace(".", CultureInfo.InvariantCulture.NumberFormat.NumberDecimalSeparator).Trim(new char[] { '"', '"' }));
newCandle.Low = Convert.ToDecimal(param[3].Replace(".", CultureInfo.InvariantCulture.NumberFormat.NumberDecimalSeparator).Trim(new char[] { '"', '"' }), CultureInfo.InvariantCulture);
newCandle.High = Convert.ToDecimal(param[2].Replace(".", CultureInfo.InvariantCulture.NumberFormat.NumberDecimalSeparator).Trim(new char[] { '"', '"' }), CultureInfo.InvariantCulture);
newCandle.Open = Convert.ToDecimal(param[1].Replace(".", CultureInfo.InvariantCulture.NumberFormat.NumberDecimalSeparator).Trim(new char[] { '"', '"' }), CultureInfo.InvariantCulture);
newCandle.Close = Convert.ToDecimal(param[4].Replace(".", CultureInfo.InvariantCulture.NumberFormat.NumberDecimalSeparator).Trim(new char[] { '"', '"' }), CultureInfo.InvariantCulture);
newCandle.Volume = Convert.ToDecimal(param[5].Replace(".", CultureInfo.InvariantCulture.NumberFormat.NumberDecimalSeparator).Trim(new char[] { '"', '"' }), CultureInfo.InvariantCulture);

_candles.Add(newCandle);
}
Expand Down
29 changes: 23 additions & 6 deletions project/OsEngine/Market/Servers/Quik/QuikDde.cs
Original file line number Diff line number Diff line change
Expand Up @@ -273,15 +273,32 @@ private void TradesUpdated(long id, object[,] table)
{
trades[i] = new Trade();
trades[i].Id = table[i, 0].ToString();

string[] date = DateTime.Parse(table[i, 1].ToString()).ToString("dd.MM.yyyy").Split('.');
string[] time = DateTime.Parse(table[i, 2].ToString()).ToString("HH:mm:ss").Split(':');

trades[i].Time = new DateTime(Convert.ToInt32(date[2]),
Convert.ToInt32(date[1]), Convert.ToInt32(date[0]),
Convert.ToInt32(time[0]), Convert.ToInt32(time[1]),
Convert.ToInt32(time[2])
string[] date = table[i, 1].ToString().Split('.');


if (date.Length == 1)
{
date = table[i, 1].ToString().Split('/');
trades[i].Time = new DateTime(Convert.ToInt32(date[2]),
Convert.ToInt32(date[0]), Convert.ToInt32(date[1]),
Convert.ToInt32(time[0]), Convert.ToInt32(time[1]),
Convert.ToInt32(time[2])
);
}
else
{
trades[i].Time = new DateTime(Convert.ToInt32(date[2]),
Convert.ToInt32(date[1]), Convert.ToInt32(date[0]),
Convert.ToInt32(time[0]), Convert.ToInt32(time[1]),
Convert.ToInt32(time[2])
);
}





trades[i].SecurityNameCode = table[i, 3].ToString();
trades[i].Price = ToDecimal(table[i, 4]);
Expand Down
Loading

0 comments on commit 265adb5

Please sign in to comment.