From fdd971e515f0932318e20b03afd7de15f0edb372 Mon Sep 17 00:00:00 2001 From: HojouFotytu <36724681+HojouFotytu@users.noreply.github.com> Date: Sat, 6 Jul 2019 10:49:28 +0900 Subject: [PATCH] Excessive Requests --- Core/MarketAnalyzer/Binance.cs | 13 ++++++++++++- Core/ProfitTrailer/StrategyHelper.cs | 6 ++++++ Monitor/Pages/_get/DashboardTop.cshtml | 2 +- PTMagic/Program.cs | 2 +- 4 files changed, 20 insertions(+), 3 deletions(-) diff --git a/Core/MarketAnalyzer/Binance.cs b/Core/MarketAnalyzer/Binance.cs index d8a212b..1475824 100644 --- a/Core/MarketAnalyzer/Binance.cs +++ b/Core/MarketAnalyzer/Binance.cs @@ -363,8 +363,19 @@ namespace Core.MarketAnalyzer log.DoLogDebug("Binance - Getting ticks for '" + markets.Count + "' markets"); ConcurrentDictionary> marketTicks = new ConcurrentDictionary>(); + int ParallelThrottle = 4; + if (systemConfiguration.AnalyzerSettings.MarketAnalyzer.StoreDataMaxHours > 200) + { + ParallelThrottle = 2; + log.DoLogInfo("----------------------------------------------------------------------------"); + log.DoLogInfo("StoreDataMaxHours is greater than 200. Historical data requests will be"); + log.DoLogInfo("throttled to avoid exceeding exchange data request limits. This initial "); + log.DoLogInfo("run could take more than 30 minutes. Please go outside for a walk..."); + log.DoLogInfo("----------------------------------------------------------------------------"); + } + Parallel.ForEach(markets.Keys, - new ParallelOptions { MaxDegreeOfParallelism = 5 }, + new ParallelOptions { MaxDegreeOfParallelism = ParallelThrottle}, (key) => { if (!marketTicks.TryAdd(key, GetMarketTicks(key, totalTicks, systemConfiguration, log))) diff --git a/Core/ProfitTrailer/StrategyHelper.cs b/Core/ProfitTrailer/StrategyHelper.cs index aea9009..ff30efe 100644 --- a/Core/ProfitTrailer/StrategyHelper.cs +++ b/Core/ProfitTrailer/StrategyHelper.cs @@ -375,6 +375,12 @@ namespace Core.ProfitTrailer case "buy value below dust": result = String.Concat(strategyLetter, "DUST"); break; + case "sell wall detected": + result = String.Concat(strategyLetter, "WALL"); + break; + case "ignoring buy trigger": + result = String.Concat(strategyLetter, "TRIG"); + break; default: break; } diff --git a/Monitor/Pages/_get/DashboardTop.cshtml b/Monitor/Pages/_get/DashboardTop.cshtml index b559b89..5b2f611 100644 --- a/Monitor/Pages/_get/DashboardTop.cshtml +++ b/Monitor/Pages/_get/DashboardTop.cshtml @@ -96,7 +96,7 @@ Market 24H Trend - Value + Value DCA Buy Strats Sell Strats diff --git a/PTMagic/Program.cs b/PTMagic/Program.cs index 9e0e05d..ffa8652 100644 --- a/PTMagic/Program.cs +++ b/PTMagic/Program.cs @@ -7,7 +7,7 @@ using Core.Helper; using Core.Main.DataObjects.PTMagicData; using Microsoft.Extensions.DependencyInjection; -[assembly: AssemblyVersion("2.2.5")] +[assembly: AssemblyVersion("2.2.6")] [assembly: AssemblyProduct("PT Magic")] namespace PTMagic