Merge pull request #306 from djbadders/develop
Speed improvements and compatibility update for Telegram
This commit is contained in:
commit
296fa462c3
|
@ -8,19 +8,15 @@ namespace Core.Helper
|
||||||
{
|
{
|
||||||
public static class TelegramHelper
|
public static class TelegramHelper
|
||||||
{
|
{
|
||||||
public static void SendMessage(string botToken, Int64 chatId, string message, bool useSilentMode, LogHelper log)
|
public async static void SendMessage(string botToken, Int64 chatId, string message, bool useSilentMode, LogHelper log)
|
||||||
{
|
{
|
||||||
if (!botToken.Equals("") && chatId != 0)
|
if (!botToken.Equals("") && chatId != 0)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
TelegramBotClient botClient = new TelegramBotClient(botToken);
|
TelegramBotClient botClient = new TelegramBotClient(botToken);
|
||||||
System.Threading.Tasks.Task<Message> sentMessage = botClient.SendTextMessageAsync(chatId, message, ParseMode.Markdown, false, useSilentMode);
|
await botClient.SendTextMessageAsync(chatId: chatId, text: message, parseMode: ParseMode.Markdown,disableNotification: useSilentMode);
|
||||||
|
log.DoLogDebug("Telegram message sent to ChatId " + chatId.ToString() + " on Bot Token '" + botToken + "'");
|
||||||
if (sentMessage.IsCompleted)
|
|
||||||
{
|
|
||||||
log.DoLogDebug("Telegram message sent to ChatId " + chatId.ToString() + " on Bot Token '" + botToken + "'");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Collections.Concurrent;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
@ -52,7 +53,7 @@ namespace Core.Main
|
||||||
private List<string> _indicatorsLines = null;
|
private List<string> _indicatorsLines = null;
|
||||||
private List<string> _exchangeMarketList = null;
|
private List<string> _exchangeMarketList = null;
|
||||||
private List<string> _marketList = new List<string>();
|
private List<string> _marketList = new List<string>();
|
||||||
private Dictionary<string, MarketInfo> _marketInfos = new Dictionary<string, MarketInfo>();
|
private ConcurrentDictionary<string, MarketInfo> _marketInfos = new ConcurrentDictionary<string, MarketInfo>();
|
||||||
private Dictionary<string, double> _averageMarketTrendChanges = new Dictionary<string, double>();
|
private Dictionary<string, double> _averageMarketTrendChanges = new Dictionary<string, double>();
|
||||||
private Dictionary<string, List<MarketTrendChange>> _singleMarketTrendChanges = new Dictionary<string, List<MarketTrendChange>>();
|
private Dictionary<string, List<MarketTrendChange>> _singleMarketTrendChanges = new Dictionary<string, List<MarketTrendChange>>();
|
||||||
private Dictionary<string, List<MarketTrendChange>> _globalMarketTrendChanges = new Dictionary<string, List<MarketTrendChange>>();
|
private Dictionary<string, List<MarketTrendChange>> _globalMarketTrendChanges = new Dictionary<string, List<MarketTrendChange>>();
|
||||||
|
@ -432,7 +433,7 @@ namespace Core.Main
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public Dictionary<string, MarketInfo> MarketInfos
|
public ConcurrentDictionary<string, MarketInfo> MarketInfos
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Collections.Concurrent;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Net;
|
using System.Net;
|
||||||
|
@ -153,16 +154,16 @@ namespace Core.MarketAnalyzer
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Dictionary<string, MarketInfo> GetMarketInfosFromFile(PTMagicConfiguration systemConfiguration, LogHelper log)
|
public static ConcurrentDictionary<string, MarketInfo> GetMarketInfosFromFile(PTMagicConfiguration systemConfiguration, LogHelper log)
|
||||||
{
|
{
|
||||||
Dictionary<string, MarketInfo> result = new Dictionary<string, MarketInfo>();
|
ConcurrentDictionary<string, MarketInfo> result = new ConcurrentDictionary<string, MarketInfo>();
|
||||||
|
|
||||||
string marketInfoFilePath = Directory.GetCurrentDirectory() + Path.DirectorySeparatorChar + Constants.PTMagicPathData + Path.DirectorySeparatorChar + Constants.PTMagicPathExchange + Path.DirectorySeparatorChar + "MarketInfo.json";
|
string marketInfoFilePath = Directory.GetCurrentDirectory() + Path.DirectorySeparatorChar + Constants.PTMagicPathData + Path.DirectorySeparatorChar + Constants.PTMagicPathExchange + Path.DirectorySeparatorChar + "MarketInfo.json";
|
||||||
if (File.Exists(marketInfoFilePath))
|
if (File.Exists(marketInfoFilePath))
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
result = JsonConvert.DeserializeObject<Dictionary<string, MarketInfo>>(System.IO.File.ReadAllText(marketInfoFilePath));
|
result = JsonConvert.DeserializeObject<ConcurrentDictionary<string, MarketInfo>>(System.IO.File.ReadAllText(marketInfoFilePath));
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
|
@ -171,12 +172,12 @@ namespace Core.MarketAnalyzer
|
||||||
}
|
}
|
||||||
if (result == null)
|
if (result == null)
|
||||||
{
|
{
|
||||||
result = new Dictionary<string, MarketInfo>();
|
result = new ConcurrentDictionary<string, MarketInfo>();
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void SaveMarketInfosToFile(Dictionary<string, MarketInfo> marketInfos, PTMagicConfiguration systemConfiguration, LogHelper log)
|
public static void SaveMarketInfosToFile(ConcurrentDictionary<string, MarketInfo> marketInfos, PTMagicConfiguration systemConfiguration, LogHelper log)
|
||||||
{
|
{
|
||||||
FileHelper.WriteTextToFile(Directory.GetCurrentDirectory() + Path.DirectorySeparatorChar + Constants.PTMagicPathData + Path.DirectorySeparatorChar + Constants.PTMagicPathExchange + Path.DirectorySeparatorChar, "MarketInfo.json", JsonConvert.SerializeObject(marketInfos));
|
FileHelper.WriteTextToFile(Directory.GetCurrentDirectory() + Path.DirectorySeparatorChar + Constants.PTMagicPathData + Path.DirectorySeparatorChar + Constants.PTMagicPathExchange + Path.DirectorySeparatorChar, "MarketInfo.json", JsonConvert.SerializeObject(marketInfos));
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,17 +1,14 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Collections.Concurrent;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Text;
|
|
||||||
using Core.Main;
|
using Core.Main;
|
||||||
using Core.Helper;
|
using Core.Helper;
|
||||||
using Core.Main.DataObjects.PTMagicData;
|
using Core.Main.DataObjects.PTMagicData;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using Core.ProfitTrailer;
|
|
||||||
using System.Net;
|
using System.Net;
|
||||||
using System.Threading;
|
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using System.Collections.Concurrent;
|
|
||||||
|
|
||||||
namespace Core.MarketAnalyzer
|
namespace Core.MarketAnalyzer
|
||||||
{
|
{
|
||||||
|
@ -43,7 +40,7 @@ namespace Core.MarketAnalyzer
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static List<string> GetMarketData(string mainMarket, Dictionary<string, MarketInfo> marketInfos, PTMagicConfiguration systemConfiguration, LogHelper log)
|
public static List<string> GetMarketData(string mainMarket, ConcurrentDictionary<string, MarketInfo> marketInfos, PTMagicConfiguration systemConfiguration, LogHelper log)
|
||||||
{
|
{
|
||||||
List<string> result = new List<string>();
|
List<string> result = new List<string>();
|
||||||
|
|
||||||
|
@ -163,7 +160,7 @@ namespace Core.MarketAnalyzer
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void CheckFirstSeenDates(Dictionary<string, Market> markets, ref Dictionary<string, MarketInfo> marketInfos, PTMagicConfiguration systemConfiguration, LogHelper log)
|
public static void CheckFirstSeenDates(Dictionary<string, Market> markets, ref ConcurrentDictionary<string, MarketInfo> marketInfos, PTMagicConfiguration systemConfiguration, LogHelper log)
|
||||||
{
|
{
|
||||||
log.DoLogInfo("Binance - Checking first seen dates for " + markets.Count + " markets. This may take a while...");
|
log.DoLogInfo("Binance - Checking first seen dates for " + markets.Count + " markets. This may take a while...");
|
||||||
|
|
||||||
|
@ -182,7 +179,7 @@ namespace Core.MarketAnalyzer
|
||||||
{
|
{
|
||||||
marketInfo = new MarketInfo();
|
marketInfo = new MarketInfo();
|
||||||
marketInfo.Name = key;
|
marketInfo.Name = key;
|
||||||
marketInfos.Add(key, marketInfo);
|
marketInfos.TryAdd(key, marketInfo);
|
||||||
marketInfo.FirstSeen = Binance.GetFirstSeenDate(key, systemConfiguration, log);
|
marketInfo.FirstSeen = Binance.GetFirstSeenDate(key, systemConfiguration, log);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -375,7 +372,7 @@ namespace Core.MarketAnalyzer
|
||||||
}
|
}
|
||||||
|
|
||||||
Parallel.ForEach(markets.Keys,
|
Parallel.ForEach(markets.Keys,
|
||||||
new ParallelOptions { MaxDegreeOfParallelism = ParallelThrottle},
|
new ParallelOptions { MaxDegreeOfParallelism = ParallelThrottle },
|
||||||
(key) =>
|
(key) =>
|
||||||
{
|
{
|
||||||
if (!marketTicks.TryAdd(key, GetMarketTicks(key, totalTicks, systemConfiguration, log)))
|
if (!marketTicks.TryAdd(key, GetMarketTicks(key, totalTicks, systemConfiguration, log)))
|
||||||
|
@ -413,26 +410,28 @@ namespace Core.MarketAnalyzer
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Dictionary<string, Market> tickMarkets = new Dictionary<string, Market>();
|
ConcurrentDictionary<string, Market> tickMarkets = new ConcurrentDictionary<string, Market>();
|
||||||
foreach (string key in markets.Keys)
|
|
||||||
{
|
|
||||||
List<MarketTick> tickRange = marketTicks[key] != null ? marketTicks[key].FindAll(t => t.Time <= tickTime) : new List<MarketTick>();
|
|
||||||
|
|
||||||
if (tickRange.Count > 0)
|
Parallel.ForEach(markets.Keys,
|
||||||
{
|
(key) =>
|
||||||
MarketTick marketTick = tickRange.OrderByDescending(t => t.Time).First();
|
{
|
||||||
|
List<MarketTick> tickRange = marketTicks[key] != null ? marketTicks[key].FindAll(t => t.Time <= tickTime) : new List<MarketTick>();
|
||||||
|
|
||||||
Market market = new Market();
|
if (tickRange.Count > 0)
|
||||||
market.Position = markets.Count + 1;
|
{
|
||||||
market.Name = key;
|
MarketTick marketTick = tickRange.OrderByDescending(t => t.Time).First();
|
||||||
market.Symbol = key;
|
|
||||||
market.Price = marketTick.Price;
|
|
||||||
//market.Volume24h = marketTick.Volume24h;
|
|
||||||
market.MainCurrencyPriceUSD = mainCurrencyPrice;
|
|
||||||
|
|
||||||
tickMarkets.Add(market.Name, market);
|
Market market = new Market();
|
||||||
}
|
market.Position = markets.Count + 1;
|
||||||
}
|
market.Name = key;
|
||||||
|
market.Symbol = key;
|
||||||
|
market.Price = marketTick.Price;
|
||||||
|
//market.Volume24h = marketTick.Volume24h;
|
||||||
|
market.MainCurrencyPriceUSD = mainCurrencyPrice;
|
||||||
|
|
||||||
|
tickMarkets.TryAdd(market.Name, market);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
DateTime fileDateTime = new DateTime(tickTime.ToLocalTime().Year, tickTime.ToLocalTime().Month, tickTime.ToLocalTime().Day, tickTime.ToLocalTime().Hour, tickTime.ToLocalTime().Minute, 0).ToUniversalTime();
|
DateTime fileDateTime = new DateTime(tickTime.ToLocalTime().Year, tickTime.ToLocalTime().Month, tickTime.ToLocalTime().Day, tickTime.ToLocalTime().Hour, tickTime.ToLocalTime().Minute, 0).ToUniversalTime();
|
||||||
|
|
||||||
|
|
|
@ -1,17 +1,14 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Collections.Concurrent;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Text;
|
|
||||||
using Core.Main;
|
using Core.Main;
|
||||||
using Core.Helper;
|
using Core.Helper;
|
||||||
using Core.Main.DataObjects.PTMagicData;
|
using Core.Main.DataObjects.PTMagicData;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using Core.ProfitTrailer;
|
|
||||||
using System.Net;
|
using System.Net;
|
||||||
using System.Threading;
|
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using System.Collections.Concurrent;
|
|
||||||
|
|
||||||
namespace Core.MarketAnalyzer
|
namespace Core.MarketAnalyzer
|
||||||
{
|
{
|
||||||
|
@ -43,7 +40,7 @@ namespace Core.MarketAnalyzer
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static List<string> GetMarketData(string mainMarket, Dictionary<string, MarketInfo> marketInfos, PTMagicConfiguration systemConfiguration, LogHelper log)
|
public static List<string> GetMarketData(string mainMarket, ConcurrentDictionary<string, MarketInfo> marketInfos, PTMagicConfiguration systemConfiguration, LogHelper log)
|
||||||
{
|
{
|
||||||
List<string> result = new List<string>();
|
List<string> result = new List<string>();
|
||||||
|
|
||||||
|
@ -160,7 +157,7 @@ namespace Core.MarketAnalyzer
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void CheckFirstSeenDates(Dictionary<string, Market> markets, ref Dictionary<string, MarketInfo> marketInfos, PTMagicConfiguration systemConfiguration, LogHelper log)
|
public static void CheckFirstSeenDates(Dictionary<string, Market> markets, ref ConcurrentDictionary<string, MarketInfo> marketInfos, PTMagicConfiguration systemConfiguration, LogHelper log)
|
||||||
{
|
{
|
||||||
log.DoLogInfo("BinanceFutures - Checking first seen dates for " + markets.Count + " markets. This may take a while...");
|
log.DoLogInfo("BinanceFutures - Checking first seen dates for " + markets.Count + " markets. This may take a while...");
|
||||||
|
|
||||||
|
@ -179,7 +176,7 @@ namespace Core.MarketAnalyzer
|
||||||
{
|
{
|
||||||
marketInfo = new MarketInfo();
|
marketInfo = new MarketInfo();
|
||||||
marketInfo.Name = key;
|
marketInfo.Name = key;
|
||||||
marketInfos.Add(key, marketInfo);
|
marketInfos.TryAdd(key, marketInfo);
|
||||||
marketInfo.FirstSeen = BinanceFutures.GetFirstSeenDate(key, systemConfiguration, log);
|
marketInfo.FirstSeen = BinanceFutures.GetFirstSeenDate(key, systemConfiguration, log);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
@ -2,14 +2,11 @@
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Text;
|
|
||||||
using Core.Main;
|
using Core.Main;
|
||||||
using Core.Helper;
|
using Core.Helper;
|
||||||
using Core.Main.DataObjects.PTMagicData;
|
using Core.Main.DataObjects.PTMagicData;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using Core.ProfitTrailer;
|
|
||||||
using System.Net;
|
using System.Net;
|
||||||
using System.Threading;
|
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using System.Collections.Concurrent;
|
using System.Collections.Concurrent;
|
||||||
|
|
||||||
|
@ -48,7 +45,7 @@ namespace Core.MarketAnalyzer
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static List<string> GetMarketData(string mainMarket, Dictionary<string, MarketInfo> marketInfos, PTMagicConfiguration systemConfiguration, LogHelper log)
|
public static List<string> GetMarketData(string mainMarket, ConcurrentDictionary<string, MarketInfo> marketInfos, PTMagicConfiguration systemConfiguration, LogHelper log)
|
||||||
{
|
{
|
||||||
List<string> result = new List<string>();
|
List<string> result = new List<string>();
|
||||||
|
|
||||||
|
@ -168,7 +165,7 @@ namespace Core.MarketAnalyzer
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void CheckFirstSeenDates(Dictionary<string, Market> markets, ref Dictionary<string, MarketInfo> marketInfos, PTMagicConfiguration systemConfiguration, LogHelper log)
|
public static void CheckFirstSeenDates(Dictionary<string, Market> markets, ref ConcurrentDictionary<string, MarketInfo> marketInfos, PTMagicConfiguration systemConfiguration, LogHelper log)
|
||||||
{
|
{
|
||||||
log.DoLogInfo("BinanceUS - Checking first seen dates for " + markets.Count + " markets. This may take a while...");
|
log.DoLogInfo("BinanceUS - Checking first seen dates for " + markets.Count + " markets. This may take a while...");
|
||||||
|
|
||||||
|
@ -187,7 +184,7 @@ namespace Core.MarketAnalyzer
|
||||||
{
|
{
|
||||||
marketInfo = new MarketInfo();
|
marketInfo = new MarketInfo();
|
||||||
marketInfo.Name = key;
|
marketInfo.Name = key;
|
||||||
marketInfos.Add(key, marketInfo);
|
marketInfos.TryAdd(key, marketInfo);
|
||||||
marketInfo.FirstSeen = BinanceUS.GetFirstSeenDate(key, systemConfiguration, log);
|
marketInfo.FirstSeen = BinanceUS.GetFirstSeenDate(key, systemConfiguration, log);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
@ -1,14 +1,12 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Collections.Concurrent;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Text;
|
|
||||||
using Core.Main;
|
using Core.Main;
|
||||||
using Core.Helper;
|
using Core.Helper;
|
||||||
using Core.Main.DataObjects.PTMagicData;
|
using Core.Main.DataObjects.PTMagicData;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using Core.ProfitTrailer;
|
|
||||||
using System.Threading;
|
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace Core.MarketAnalyzer
|
namespace Core.MarketAnalyzer
|
||||||
|
@ -44,7 +42,7 @@ namespace Core.MarketAnalyzer
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static List<string> GetMarketData(string mainMarket, Dictionary<string, MarketInfo> marketInfos, PTMagicConfiguration systemConfiguration, LogHelper log)
|
public static List<string> GetMarketData(string mainMarket, ConcurrentDictionary<string, MarketInfo> marketInfos, PTMagicConfiguration systemConfiguration, LogHelper log)
|
||||||
{
|
{
|
||||||
List<string> result = new List<string>();
|
List<string> result = new List<string>();
|
||||||
|
|
||||||
|
@ -104,7 +102,7 @@ namespace Core.MarketAnalyzer
|
||||||
{
|
{
|
||||||
marketInfo = new MarketInfo();
|
marketInfo = new MarketInfo();
|
||||||
marketInfo.Name = marketName;
|
marketInfo.Name = marketName;
|
||||||
marketInfos.Add(marketName, marketInfo);
|
marketInfos.TryAdd(marketName, marketInfo);
|
||||||
}
|
}
|
||||||
if (currencyTicker["Summary"]["Created"].Type == Newtonsoft.Json.Linq.JTokenType.Date) marketInfo.FirstSeen = (DateTime)currencyTicker["Summary"]["Created"];
|
if (currencyTicker["Summary"]["Created"].Type == Newtonsoft.Json.Linq.JTokenType.Date) marketInfo.FirstSeen = (DateTime)currencyTicker["Summary"]["Created"];
|
||||||
marketInfo.LastSeen = DateTime.UtcNow;
|
marketInfo.LastSeen = DateTime.UtcNow;
|
||||||
|
|
|
@ -1,14 +1,12 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Collections.Concurrent;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Text;
|
|
||||||
using Core.Main;
|
using Core.Main;
|
||||||
using Core.Helper;
|
using Core.Helper;
|
||||||
using Core.Main.DataObjects.PTMagicData;
|
using Core.Main.DataObjects.PTMagicData;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using Core.ProfitTrailer;
|
|
||||||
using System.Threading;
|
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace Core.MarketAnalyzer
|
namespace Core.MarketAnalyzer
|
||||||
|
@ -44,7 +42,7 @@ namespace Core.MarketAnalyzer
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static List<string> GetMarketData(string mainMarket, Dictionary<string, MarketInfo> marketInfos, PTMagicConfiguration systemConfiguration, LogHelper log)
|
public static List<string> GetMarketData(string mainMarket, ConcurrentDictionary<string, MarketInfo> marketInfos, PTMagicConfiguration systemConfiguration, LogHelper log)
|
||||||
{
|
{
|
||||||
List<string> result = new List<string>();
|
List<string> result = new List<string>();
|
||||||
|
|
||||||
|
@ -125,7 +123,7 @@ namespace Core.MarketAnalyzer
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void CheckFirstSeenDates(Dictionary<string, Market> markets, ref Dictionary<string, MarketInfo> marketInfos, PTMagicConfiguration systemConfiguration, LogHelper log)
|
public static void CheckFirstSeenDates(Dictionary<string, Market> markets, ref ConcurrentDictionary<string, MarketInfo> marketInfos, PTMagicConfiguration systemConfiguration, LogHelper log)
|
||||||
{
|
{
|
||||||
log.DoLogInfo("Poloniex - Checking first seen dates for " + markets.Count + " markets. This may take a while...");
|
log.DoLogInfo("Poloniex - Checking first seen dates for " + markets.Count + " markets. This may take a while...");
|
||||||
|
|
||||||
|
@ -142,7 +140,7 @@ namespace Core.MarketAnalyzer
|
||||||
{
|
{
|
||||||
marketInfo = new MarketInfo();
|
marketInfo = new MarketInfo();
|
||||||
marketInfo.Name = key;
|
marketInfo.Name = key;
|
||||||
marketInfos.Add(key, marketInfo);
|
marketInfos.TryAdd(key, marketInfo);
|
||||||
marketInfo.FirstSeen = Poloniex.GetFirstSeenDate(key, systemConfiguration, log);
|
marketInfo.FirstSeen = Poloniex.GetFirstSeenDate(key, systemConfiguration, log);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
@ -103,7 +103,7 @@
|
||||||
<div class="tradingview-widget-container">
|
<div class="tradingview-widget-container">
|
||||||
<div id="tradingview_6aa22" style="height:600px;"></div>
|
<div id="tradingview_6aa22" style="height:600px;"></div>
|
||||||
<div class="tradingview-widget-copyright">
|
<div class="tradingview-widget-copyright">
|
||||||
<a href="@Core.Helper.SystemHelper.GetMarketLink(Model.PTMagicConfiguration.GeneralSettings.Monitor.LinkPlatform,Model.PTMagicConfiguration.GeneralSettings.Application.Exchange, Model.DCAMarket, Model.Summary.MainMarket)" rel="noopener" target="_blank">
|
<a href="@Core.Helper.SystemHelper.GetMarketLink(Model.PTMagicConfiguration.GeneralSettings.Monitor.LinkPlatform, Model.PTMagicConfiguration.GeneralSettings.Application.Exchange, Model.DCAMarket, Model.Summary.MainMarket)" rel="noopener" target="_blank">
|
||||||
<span class="blue-text">@Model.DCAMarket</span> <span class="blue-text">chart</span> by TradingView</a>
|
<span class="blue-text">@Model.DCAMarket</span> <span class="blue-text">chart</span> by TradingView</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in New Issue