diff --git a/Core/Main/PTMagic.cs b/Core/Main/PTMagic.cs index c84e2e3..ae8df5f 100644 --- a/Core/Main/PTMagic.cs +++ b/Core/Main/PTMagic.cs @@ -615,8 +615,13 @@ namespace Core.Main { this.PTMagicConfiguration = new PTMagicConfiguration(); - this.Log.DoLogInfo("Configuration loaded. Found " + this.PTMagicConfiguration.AnalyzerSettings.MarketAnalyzer.MarketTrends.Count.ToString() + " Market Trends, " + this.PTMagicConfiguration.AnalyzerSettings.GlobalSettings.Count.ToString() + " Global Settings and " + this.PTMagicConfiguration.AnalyzerSettings.SingleMarketSettings.Count.ToString() + " Single Market Settings."); - + this.Log.DoLogInfo( "Configuration loaded. Found " + + this.PTMagicConfiguration.AnalyzerSettings.MarketAnalyzer.MarketTrends != null ? this.PTMagicConfiguration.AnalyzerSettings.MarketAnalyzer.MarketTrends.Count.ToString() : "0" + + " Market Trends, " + + this.PTMagicConfiguration.AnalyzerSettings.GlobalSettings != null ? this.PTMagicConfiguration.AnalyzerSettings.GlobalSettings.Count.ToString() : "0" + + " Global Settings and " + + this.PTMagicConfiguration.AnalyzerSettings.SingleMarketSettings != null ? this.PTMagicConfiguration.AnalyzerSettings.SingleMarketSettings.Count.ToString() : "0" + + " Single Market Settings."); } catch (Exception ex) { @@ -2311,8 +2316,9 @@ namespace Core.Main this.Log.DoLogInfo("Summary: Current global properties saved."); - this.Log.DoLogInfo("Summary: Getting current single market properties..."); // Get current single market settings from PAIRS.PROPERTIES for each configured market + this.Log.DoLogInfo("Summary: Getting current single market properties..."); + foreach (string marketPair in this.MarketList) { MarketPairSummary mpSummary = new MarketPairSummary(); diff --git a/Core/ProfitTrailer/SettingsHandler.cs b/Core/ProfitTrailer/SettingsHandler.cs index 602b486..5d679e1 100644 --- a/Core/ProfitTrailer/SettingsHandler.cs +++ b/Core/ProfitTrailer/SettingsHandler.cs @@ -88,7 +88,7 @@ namespace Core.ProfitTrailer // Writing Header lines fileLines.Insert(0, ""); fileLines.Insert(0, "# ####################################"); - fileLines.Insert(0, "# PTMagic_LastChanged = " + DateTime.UtcNow.ToShortDateString() + " " + DateTime.UtcNow.ToShortTimeString()); + fileLines.Insert(0, "# PTMagic_LastChanged = " + DateTime.Now.ToShortDateString() + " " + DateTime.UtcNow.ToShortTimeString()); fileLines.Insert(0, "# PTMagic_ActiveSetting = " + SystemHelper.StripBadCode(ptmagicInstance.DefaultSettingName, Constants.WhiteListProperties)); fileLines.Insert(0, "# ####################################"); @@ -339,7 +339,7 @@ namespace Core.ProfitTrailer } } - newPairsLines.Add("# PTMagic_SingleMarketSettings - Written on " + DateTime.UtcNow.ToString()); + newPairsLines.Add("# PTMagic_SingleMarketSettings - Written on " + DateTime.Now.ToString()); newPairsLines.Add("# ########################################################################"); newPairsLines.Add(""); @@ -359,7 +359,7 @@ namespace Core.ProfitTrailer } } - newDCALines.Add("# PTMagic_SingleMarketSettings - Written on " + DateTime.UtcNow.ToString()); + newDCALines.Add("# PTMagic_SingleMarketSettings - Written on " + DateTime.Now.ToString()); newDCALines.Add("# ########################################################################"); newDCALines.Add(""); @@ -383,7 +383,7 @@ namespace Core.ProfitTrailer Dictionary globalDCAProperties = SettingsHandler.GetPropertiesAsDictionary(globalDCALines); Dictionary globalIndicatorsProperties = SettingsHandler.GetPropertiesAsDictionary(globalIndicatorsLines); - newIndicatorsLines.Add("# PTMagic_SingleMarketSettings - Written on " + DateTime.UtcNow.ToString()); + newIndicatorsLines.Add("# PTMagic_SingleMarketSettings - Written on " + DateTime.Now.ToString()); newIndicatorsLines.Add("# ########################################################################"); newIndicatorsLines.Add(""); @@ -534,6 +534,7 @@ namespace Core.ProfitTrailer case Constants.ValueModeOffsetPercent: // Offset value by percentage double offsetValuePercent = SystemHelper.TextToDouble(newValueString, 0, "en-US"); + if (offsetValuePercent != 0) { double oldValue = SystemHelper.TextToDouble(SettingsHandler.GetCurrentPropertyValue(fullProperties, propertyKey, propertyKey.Replace("ALL_", "DEFAULT_")), 0, "en-US"); @@ -545,7 +546,7 @@ namespace Core.ProfitTrailer double oldValueOffset = (oldValue * (offsetValuePercent / 100)); - if (propertyKey.Contains("rebuy_timeout", StringComparison.CurrentCultureIgnoreCase) || propertyKey.Contains("trading_pairs", StringComparison.CurrentCultureIgnoreCase)) + if (propertyKey.Contains("rebuy_timeout", StringComparison.InvariantCultureIgnoreCase) || propertyKey.Contains("trading_pairs", StringComparison.InvariantCultureIgnoreCase)) { // Ensure some values are rounded up to integers for PT comaptability newValueString = ((int)(Math.Round((oldValue + oldValueOffset), MidpointRounding.AwayFromZero) + .5)).ToString(new System.Globalization.CultureInfo("en-US")); @@ -646,7 +647,5 @@ namespace Core.ProfitTrailer return result; } - - } } diff --git a/Monitor/_Internal/BasePageModel.cs b/Monitor/_Internal/BasePageModel.cs index 9b2f9f8..30a8bee 100644 --- a/Monitor/_Internal/BasePageModel.cs +++ b/Monitor/_Internal/BasePageModel.cs @@ -88,7 +88,6 @@ namespace Monitor._Internal LatestVersion = BaseAnalyzer.GetLatestGitHubRelease(Log, Summary.Version); HttpContext.Session.SetString("LatestVersion", LatestVersion); } - } catch { }