Changed to use local time in file comments, plus minor fixes and tweaks

This commit is contained in:
djbadders 2019-03-02 08:10:33 +00:00
parent 552f22b78d
commit 00a8a1b3ef
3 changed files with 15 additions and 11 deletions

View File

@ -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();

View File

@ -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<string, string> globalDCAProperties = SettingsHandler.GetPropertiesAsDictionary(globalDCALines);
Dictionary<string, string> 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;
}
}
}

View File

@ -88,7 +88,6 @@ namespace Monitor._Internal
LatestVersion = BaseAnalyzer.GetLatestGitHubRelease(Log, Summary.Version);
HttpContext.Session.SetString("LatestVersion", LatestVersion);
}
}
catch { }