diff --git a/Core/Main/PTMagic.cs b/Core/Main/PTMagic.cs index 6dcf6e1..9600417 100644 --- a/Core/Main/PTMagic.cs +++ b/Core/Main/PTMagic.cs @@ -716,7 +716,7 @@ namespace Core.Main } else { - this.Log.DoLogInfo("No CoinMarketCap API KEY specified! You can't use CoinMarketCap in your settings.analyzer.json"); + this.Log.DoLogInfo("No CoinMarketCap API KEY specified! That's ok, but you can't use CoinMarketCap in your settings.analyzer.json"); } // Check for CurrencyConverterApi Key @@ -726,7 +726,7 @@ namespace Core.Main } else { - this.Log.DoLogInfo("No FreeCurrencyConverterApi KEY specified, you can only use USD; apply for a key at: https://freecurrencyrates.com/en"); + this.Log.DoLogInfo("No FreeCurrencyConverterApi KEY specified. That's ok! But you can only use USD; apply for a key at: https://freecurrencyrates.com/en"); } } catch (System.NullReferenceException) @@ -1234,7 +1234,7 @@ namespace Core.Main } else { - this.Log.DoLogInfo("No CMC API-Key specified. No CMC Data will be pulled"); + this.Log.DoLogInfo("No CMC API-Key specified. That's OK, but no CMC Data can be pulled."); } if (this.PTMagicConfiguration.GeneralSettings.Application.Exchange.Equals("Bittrex", StringComparison.InvariantCultureIgnoreCase)) @@ -1525,12 +1525,22 @@ namespace Core.Main int marketPairProcess = 1; Dictionary> matchedMarketTriggers = new Dictionary>(); + string mainMarket = this.LastRuntimeSummary.MainMarket; // Loop through markets foreach (string marketPair in this.MarketList) { this.Log.DoLogDebug("'" + marketPair + "' - Checking triggers (" + marketPairProcess.ToString() + "/" + this.MarketList.Count.ToString() + ")..."); - + string market = marketPair.Replace(mainMarket, ""); + switch (this.PTMagicConfiguration.GeneralSettings.Application.Exchange.ToLower()) + { + case "bittrex": + market = market.Replace("-", ""); + break; + case "poloniex": + market = market.Replace("-", ""); + break; + } bool stopTriggers = false; // Loop through single market settings @@ -1539,16 +1549,42 @@ namespace Core.Main List matchedSingleMarketTriggers = new List(); // Check ignore markets - List ignoredMarkets = SystemHelper.ConvertTokenStringToList(marketSetting.IgnoredMarkets, ","); - if (ignoredMarkets.Any(im => marketPair.StartsWith(im, StringComparison.InvariantCultureIgnoreCase))) + + // Strip main markets from list, if exists + string ignored = marketSetting.IgnoredMarkets.ToUpper(); + ignored = ignored.Replace(mainMarket, ""); + switch (this.PTMagicConfiguration.GeneralSettings.Application.Exchange.ToLower()) + { + case "bittrex": + ignored = ignored.Replace("-", ""); + break; + case "poloniex": + ignored = ignored.Replace("_", ""); + break; + } + List ignoredMarkets = SystemHelper.ConvertTokenStringToList(ignored, ","); + if (ignoredMarkets.Contains(market)) { this.Log.DoLogDebug("'" + marketPair + "' - Is ignored in '" + marketSetting.SettingName + "'."); continue; } // Check allowed markets - List allowedMarkets = SystemHelper.ConvertTokenStringToList(marketSetting.AllowedMarkets, ","); - if (allowedMarkets.Count > 0 && !allowedMarkets.Any(am => marketPair.StartsWith(am, StringComparison.InvariantCultureIgnoreCase))) + + // Strip main markets from list, if exists + string allowed = marketSetting.AllowedMarkets.ToUpper(); + allowed = allowed.Replace(mainMarket, ""); + switch (this.PTMagicConfiguration.GeneralSettings.Application.Exchange.ToLower()) + { + case "bittrex": + allowed = allowed.Replace("-", ""); + break; + case "poloniex": + allowed = allowed.Replace("_", ""); + break; + } + List allowedMarkets = SystemHelper.ConvertTokenStringToList(allowed, ","); + if (allowedMarkets.Count > 0 && !allowedMarkets.Contains(market)) { this.Log.DoLogDebug("'" + marketPair + "' - Is not allowed in '" + marketSetting.SettingName + "'."); continue; diff --git a/Core/MarketAnalyzer/BaseAnalyzer.cs b/Core/MarketAnalyzer/BaseAnalyzer.cs index 00d784b..4f0ff6d 100644 --- a/Core/MarketAnalyzer/BaseAnalyzer.cs +++ b/Core/MarketAnalyzer/BaseAnalyzer.cs @@ -308,16 +308,51 @@ namespace Core.MarketAnalyzer } Market recentMarket; + string market = recentMarketPair.Value.Symbol.Replace(mainMarket, ""); + string exchange = systemConfiguration.GeneralSettings.Application.Exchange.ToLower(); + switch (exchange) + { + case "bittrex": + market = market.Replace("-", ""); + break; + case "poloniex": + market = market.Replace("-", ""); + break; + } if (recentMarkets.TryGetValue(recentMarketPair.Key, out recentMarket)) { - List ignoredMarkets = SystemHelper.ConvertTokenStringToList(marketTrend.IgnoredMarkets, ","); - if (ignoredMarkets.Any(im => recentMarketPair.Value.Symbol.StartsWith(im, StringComparison.InvariantCultureIgnoreCase))) + // Strip main markets from lists, if exists + string ignored = marketTrend.IgnoredMarkets.ToUpper(); + ignored = ignored.Replace(mainMarket, ""); + switch (exchange) + { + case "bittrex": + ignored = ignored.Replace("-", ""); + break; + case "poloniex": + ignored = ignored.Replace("_", ""); + break; + } + List ignoredMarkets = SystemHelper.ConvertTokenStringToList(ignored, ","); + if (ignoredMarkets.Contains(market)) { log.DoLogDebug(platform + " - Market trend '" + marketTrend.Name + "' for '" + recentMarketPair.Key + "' is ignored in this trend."); continue; } - List allowedMarkets = SystemHelper.ConvertTokenStringToList(marketTrend.AllowedMarkets, ","); - if (allowedMarkets.Count > 0 && !allowedMarkets.Any(am => recentMarketPair.Value.Symbol.StartsWith(am, StringComparison.InvariantCultureIgnoreCase))) + // Strip main markets from lists, if exists + string allowed = marketTrend.AllowedMarkets.ToUpper(); + allowed = allowed.Replace(mainMarket, ""); + switch (exchange) + { + case "bittrex": + allowed = allowed.Replace("-", ""); + break; + case "poloniex": + allowed = allowed.Replace("_", ""); + break; + } + List allowedMarkets = SystemHelper.ConvertTokenStringToList(allowed, ","); + if (allowedMarkets.Count > 0 && !allowedMarkets.Contains(market)) { log.DoLogDebug(platform + " - Market trend '" + marketTrend.Name + "' for '" + recentMarketPair.Key + "' is not allowed in this trend."); continue; diff --git a/Core/MarketAnalyzer/Binance.cs b/Core/MarketAnalyzer/Binance.cs index 8eae0a7..b2e6c68 100644 --- a/Core/MarketAnalyzer/Binance.cs +++ b/Core/MarketAnalyzer/Binance.cs @@ -364,12 +364,12 @@ namespace Core.MarketAnalyzer ConcurrentDictionary> marketTicks = new ConcurrentDictionary>(); int ParallelThrottle = 4; - if (systemConfiguration.AnalyzerSettings.MarketAnalyzer.StoreDataMaxHours > 200) + if (systemConfiguration.AnalyzerSettings.MarketAnalyzer.StoreDataMaxHours > 50) { 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("StoreDataMaxHours is greater than 50. Historical data requests will be"); + log.DoLogInfo("throttled to avoid exceeding exchange request limits. This initial "); log.DoLogInfo("run could take more than 30 minutes. Please go outside for a walk..."); log.DoLogInfo("----------------------------------------------------------------------------"); } diff --git a/Core/MarketAnalyzer/BinanceFutures.cs b/Core/MarketAnalyzer/BinanceFutures.cs index 1ba75a6..52b99e2 100644 --- a/Core/MarketAnalyzer/BinanceFutures.cs +++ b/Core/MarketAnalyzer/BinanceFutures.cs @@ -361,11 +361,11 @@ namespace Core.MarketAnalyzer ConcurrentDictionary> marketTicks = new ConcurrentDictionary>(); int ParallelThrottle = 4; - if (systemConfiguration.AnalyzerSettings.MarketAnalyzer.StoreDataMaxHours > 200) + if (systemConfiguration.AnalyzerSettings.MarketAnalyzer.StoreDataMaxHours > 50) { ParallelThrottle = 2; log.DoLogInfo("----------------------------------------------------------------------------"); - log.DoLogInfo("StoreDataMaxHours is greater than 200. Historical data requests will be"); + log.DoLogInfo("StoreDataMaxHours is greater than 50. 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("----------------------------------------------------------------------------"); diff --git a/Monitor/Pages/MarketAnalyzer.cshtml b/Monitor/Pages/MarketAnalyzer.cshtml index 37a7ff2..15bd1d1 100644 --- a/Monitor/Pages/MarketAnalyzer.cshtml +++ b/Monitor/Pages/MarketAnalyzer.cshtml @@ -183,14 +183,15 @@ else @Core.Helper.SystemHelper.SplitCamelCase(marketTrend.Name) @marketCountString - @Core.Helper.SystemHelper.GetProperDurationTime(marketTrend.TrendMinutes * 60, false) @if (marketTrend.TrendThreshold == 0) - { - -- - } - else - { - @marketTrend.TrendThreshold - } + @Core.Helper.SystemHelper.GetProperDurationTime(marketTrend.TrendMinutes * 60, false) + @if (marketTrend.TrendThreshold == 0) + { + -- + } + else + { + @marketTrend.TrendThreshold + } @trendChangeOutput% } @@ -275,18 +276,18 @@ else @mps.LatestPrice.ToString("#,#0.00000000", new System.Globalization.CultureInfo("en-US")) @Model.Summary.MainMarket @Math.Round(mps.Latest24hVolume, 0).ToString("#,#0", new System.Globalization.CultureInfo("en-US")) @Model.Summary.MainMarket @foreach (Core.Main.DataObjects.PTMagicData.MarketTrend marketTrend in marketTrends) { - if (mps.MarketTrendChanges.ContainsKey(marketTrend.Name)) { + if (mps.MarketTrendChanges.ContainsKey(marketTrend.Name)) + { marketTrendsDisplayed++; string trendChangeOutput = mps.MarketTrendChanges[marketTrend.Name].ToString("#,#0.00", new System.Globalization.CultureInfo("en-US")); - if ((mps.MarketTrendChanges[marketTrend.Name] > marketTrend.TrendThreshold) || (mps.MarketTrendChanges[marketTrend.Name] > marketTrend.TrendThreshold) ) - { -   @trendChangeOutput% - } - else - { - @trendChangeOutput% - } - + if (marketTrend.TrendThreshold != 0 && Math.Abs(mps.MarketTrendChanges[marketTrend.Name]) > marketTrend.TrendThreshold) + { +   @trendChangeOutput% + } + else + { + @trendChangeOutput% + } } } @for (int i = 0; i < marketTrends.Count - marketTrendsDisplayed; i++) { diff --git a/PTMagic/Program.cs b/PTMagic/Program.cs index 6139695..fbebbf2 100644 --- a/PTMagic/Program.cs +++ b/PTMagic/Program.cs @@ -6,7 +6,7 @@ using Core.Helper; using Microsoft.Extensions.DependencyInjection; -[assembly: AssemblyVersion("2.5.8")] +[assembly: AssemblyVersion("2.5.9")] [assembly: AssemblyProduct("PT Magic")] namespace PTMagic