Excessive Requests

This commit is contained in:
HojouFotytu 2019-07-06 10:49:28 +09:00
parent 2935142137
commit fdd971e515
4 changed files with 20 additions and 3 deletions

View File

@ -363,8 +363,19 @@ namespace Core.MarketAnalyzer
log.DoLogDebug("Binance - Getting ticks for '" + markets.Count + "' markets"); log.DoLogDebug("Binance - Getting ticks for '" + markets.Count + "' markets");
ConcurrentDictionary<string, List<MarketTick>> marketTicks = new ConcurrentDictionary<string, List<MarketTick>>(); ConcurrentDictionary<string, List<MarketTick>> marketTicks = new ConcurrentDictionary<string, List<MarketTick>>();
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, Parallel.ForEach(markets.Keys,
new ParallelOptions { MaxDegreeOfParallelism = 5 }, new ParallelOptions { MaxDegreeOfParallelism = ParallelThrottle},
(key) => (key) =>
{ {
if (!marketTicks.TryAdd(key, GetMarketTicks(key, totalTicks, systemConfiguration, log))) if (!marketTicks.TryAdd(key, GetMarketTicks(key, totalTicks, systemConfiguration, log)))

View File

@ -375,6 +375,12 @@ namespace Core.ProfitTrailer
case "buy value below dust": case "buy value below dust":
result = String.Concat(strategyLetter, "DUST"); result = String.Concat(strategyLetter, "DUST");
break; break;
case "sell wall detected":
result = String.Concat(strategyLetter, "WALL");
break;
case "ignoring buy trigger":
result = String.Concat(strategyLetter, "TRIG");
break;
default: default:
break; break;
} }

View File

@ -96,7 +96,7 @@
<tr> <tr>
<th>Market</th> <th>Market</th>
<th class="text-left" data-toggle="tooltip" data-placement="top" title="Market trend last 24 hours">24H Trend</th> <th class="text-left" data-toggle="tooltip" data-placement="top" title="Market trend last 24 hours">24H Trend</th>
<th class="text-left" data-toggle="tooltip" data-placement="top" title="Total Bag Value">Value</th> <th class="text-left" data-toggle="tooltip" data-placement="top" title="Total Buy Value">Value</th>
<th></th> <th></th>
<th class="text-left" data-toggle="tooltip" data-placement="top" title="Active buy strategies">DCA Buy Strats</th> <th class="text-left" data-toggle="tooltip" data-placement="top" title="Active buy strategies">DCA Buy Strats</th>
<th class="text-left" data-toggle="tooltip" data-placement="top" title="Active sell strategies">Sell Strats</th> <th class="text-left" data-toggle="tooltip" data-placement="top" title="Active sell strategies">Sell Strats</th>

View File

@ -7,7 +7,7 @@ using Core.Helper;
using Core.Main.DataObjects.PTMagicData; using Core.Main.DataObjects.PTMagicData;
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
[assembly: AssemblyVersion("2.2.5")] [assembly: AssemblyVersion("2.2.6")]
[assembly: AssemblyProduct("PT Magic")] [assembly: AssemblyProduct("PT Magic")]
namespace PTMagic namespace PTMagic