From 0aa36bac86620bd52da54257bb4b42156e25a60f Mon Sep 17 00:00:00 2001 From: djbadders <34887832+djbadders@users.noreply.github.com> Date: Tue, 9 Feb 2021 19:49:42 +0000 Subject: [PATCH 01/10] Fixed TradingView chart flashing in the bag details pop-up --- Core/Helper/SystemHelper.cs | 11 +---------- Monitor/Pages/_get/BagDetails.cshtml | 5 ++++- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/Core/Helper/SystemHelper.cs b/Core/Helper/SystemHelper.cs index da10013..021c12f 100644 --- a/Core/Helper/SystemHelper.cs +++ b/Core/Helper/SystemHelper.cs @@ -536,16 +536,7 @@ namespace Core.Helper string result = "#"; if (platform.Equals("TradingView")) { - result = "https://www.tradingview.com/chart/?symbol=" + exchange.ToUpper() + ":"; - - string pairName = SystemHelper.StripBadCode(market, Constants.WhiteListMinimal); - - if (pairName.StartsWith(mainMarket)) - { - pairName = pairName.Replace(mainMarket, "") + mainMarket; - } - - result += pairName; + result = "https://uk.tradingview.com/symbols/" + market.ToUpper() + "/?exchange=" + exchange.ToUpper(); } else if (platform.Equals("TradingViewFutures")) { diff --git a/Monitor/Pages/_get/BagDetails.cshtml b/Monitor/Pages/_get/BagDetails.cshtml index 88f2a35..087a4e1 100644 --- a/Monitor/Pages/_get/BagDetails.cshtml +++ b/Monitor/Pages/_get/BagDetails.cshtml @@ -102,7 +102,10 @@
- +
From c189006093b00550c0b05120e4f6ac66e066e439 Mon Sep 17 00:00:00 2001 From: HojouFotytu <36724681+HojouFotytu@users.noreply.github.com> Date: Thu, 11 Feb 2021 23:26:47 +0900 Subject: [PATCH 02/10] relocate auto-update --- PTMagic/{_defaults/_linux => _auto_updater}/PTMUpdate.sh | 0 _Development/CreateRelease.cmd | 1 + 2 files changed, 1 insertion(+) rename PTMagic/{_defaults/_linux => _auto_updater}/PTMUpdate.sh (100%) diff --git a/PTMagic/_defaults/_linux/PTMUpdate.sh b/PTMagic/_auto_updater/PTMUpdate.sh similarity index 100% rename from PTMagic/_defaults/_linux/PTMUpdate.sh rename to PTMagic/_auto_updater/PTMUpdate.sh diff --git a/_Development/CreateRelease.cmd b/_Development/CreateRelease.cmd index 612a331..f35624e 100644 --- a/_Development/CreateRelease.cmd +++ b/_Development/CreateRelease.cmd @@ -15,6 +15,7 @@ DEL /F /S /Q * REM Copy release files MD PTMagic XCOPY /Y /S ..\..\PTMagic\_defaults\* .\ +XCOPY /Y /S ..\..\PTMagic\_auto_updater\* .\PTMagic XCOPY /Y /S ..\..\PTMagic\bin\Release\PublishOutput .\PTMagic CD .\PTMagic DEL /F /S /Q _presets From b637a12e6f10eec869748c519cb73d1142715541 Mon Sep 17 00:00:00 2001 From: HojouFotytu Date: Fri, 12 Feb 2021 00:10:40 +0900 Subject: [PATCH 03/10] Update SystemHelper.cs Changed uk.tradingview.com -- > www.tradingview.com --- Core/Helper/SystemHelper.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Core/Helper/SystemHelper.cs b/Core/Helper/SystemHelper.cs index 021c12f..c315e50 100644 --- a/Core/Helper/SystemHelper.cs +++ b/Core/Helper/SystemHelper.cs @@ -536,7 +536,7 @@ namespace Core.Helper string result = "#"; if (platform.Equals("TradingView")) { - result = "https://uk.tradingview.com/symbols/" + market.ToUpper() + "/?exchange=" + exchange.ToUpper(); + result = "https://www.tradingview.com/symbols/" + market.ToUpper() + "/?exchange=" + exchange.ToUpper(); } else if (platform.Equals("TradingViewFutures")) { From 44404e2f301e78500750937c786bb989390c74dc Mon Sep 17 00:00:00 2001 From: HojouFotytu <36724681+HojouFotytu@users.noreply.github.com> Date: Fri, 12 Feb 2021 13:38:36 +0900 Subject: [PATCH 04/10] wording changes for clarity --- Monitor/Pages/MarketAnalyzer.cshtml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Monitor/Pages/MarketAnalyzer.cshtml b/Monitor/Pages/MarketAnalyzer.cshtml index 691e585..37a7ff2 100644 --- a/Monitor/Pages/MarketAnalyzer.cshtml +++ b/Monitor/Pages/MarketAnalyzer.cshtml @@ -155,7 +155,7 @@ else
-

Market Trends at @Model.PTMagicConfiguration.GeneralSettings.Application.Exchange

+

Market Trend Averages at @Model.PTMagicConfiguration.GeneralSettings.Application.Exchange

@@ -280,7 +280,7 @@ else 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) ) { - + } else { From e2e79bdf235d7b282175868a323be23fbac6a587 Mon Sep 17 00:00:00 2001 From: djbadders <34887832+djbadders@users.noreply.github.com> Date: Wed, 17 Feb 2021 13:07:31 +0000 Subject: [PATCH 05/10] Tweaked font size in tables to cope better when many strategies being used --- Monitor/wwwroot/assets/css/custom.css | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Monitor/wwwroot/assets/css/custom.css b/Monitor/wwwroot/assets/css/custom.css index 165ca0a..dbdce4a 100644 --- a/Monitor/wwwroot/assets/css/custom.css +++ b/Monitor/wwwroot/assets/css/custom.css @@ -132,13 +132,13 @@ a:active { .table { color : white; font-family: "Noto Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; - font-size : 12px; + font-size : 11px; } /* If the screen size is 400px wide or less, set the font-size of
to 30px */ @media screen and (max-width: 400px) { .table { - font-size: 10px; + font-size: 9px; } } From b5b0fc95a3f20d134b1dc637134f51988117c31c Mon Sep 17 00:00:00 2001 From: HojouFotytu <36724681+HojouFotytu@users.noreply.github.com> Date: Thu, 18 Feb 2021 00:24:47 +0900 Subject: [PATCH 06/10] added icon for TSL --- Core/ProfitTrailer/StrategyHelper.cs | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/Core/ProfitTrailer/StrategyHelper.cs b/Core/ProfitTrailer/StrategyHelper.cs index db866e7..b211fe0 100644 --- a/Core/ProfitTrailer/StrategyHelper.cs +++ b/Core/ProfitTrailer/StrategyHelper.cs @@ -22,7 +22,14 @@ namespace Core.ProfitTrailer // PT allows for "advanced_stats" to show details of the trailing logic and dynamic formulas. if (result.Contains("STATS") || result.Contains("DYN")) { - result = ""; + if (result.Contains("STATS-TSL") && (!result.Contains("TSL-STRAT"))) + { + result = "TSL"; + } + else + { + result = ""; + } } // strategy labels with variable values if (result.Contains("BUY TIMEOUT AS")) @@ -411,7 +418,14 @@ namespace Core.ProfitTrailer else if (strategy.Name.Contains("STATS")) // Avoid displaying advanced buy stats and completed level formulas { - strategy.Name = ""; + if (strategy.Name.Contains("STATS-TSL") && (!strategy.Name.Contains("TSL-STRAT"))) + { + strategyText += "" + StrategyHelper.GetStrategyShortcut(strategy.Name, false) + " "; + } + else + { + strategy.Name = ""; + } } else if (strategy.Name.Contains("FORMULA")) // Avoid displaying formula details From 4fdd0ed112598fd1057aad77e9b7d856fa45987b Mon Sep 17 00:00:00 2001 From: djbadders <34887832+djbadders@users.noreply.github.com> Date: Wed, 17 Feb 2021 15:28:13 +0000 Subject: [PATCH 07/10] Fix issue with Sales Analyzer showing no TCV --- Monitor/Pages/SalesAnalyzer.cshtml.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Monitor/Pages/SalesAnalyzer.cshtml.cs b/Monitor/Pages/SalesAnalyzer.cshtml.cs index 9f74924..37725f3 100644 --- a/Monitor/Pages/SalesAnalyzer.cshtml.cs +++ b/Monitor/Pages/SalesAnalyzer.cshtml.cs @@ -161,7 +161,7 @@ namespace Monitor.Pages double AvailableBalance = PTData.GetCurrentBalance(); foreach (Core.Main.DataObjects.PTMagicData.DCALogData dcaLogEntry in PTData.DCALog) { - totalCurrentValue = totalCurrentValue + ((dcaLogEntry.Amount * dcaLogEntry.CurrentPrice) / dcaLogEntry.Leverage); + totalCurrentValue = totalCurrentValue + ((dcaLogEntry.Amount * dcaLogEntry.CurrentPrice) / dcaLogEntry.Leverage != 0 ? dcaLogEntry.Leverage : 1); } totalCurrentValue = totalCurrentValue + AvailableBalance; } From 89e7534e40bd9f755cb3151b6d4ccc6984134f33 Mon Sep 17 00:00:00 2001 From: JackTerok Date: Wed, 17 Feb 2021 16:29:08 +0100 Subject: [PATCH 08/10] Remove unused download function. --- Monitor/Pages/_get/DownloadFile.cshtml | 5 ---- Monitor/Pages/_get/DownloadFile.cshtml.cs | 36 ----------------------- 2 files changed, 41 deletions(-) delete mode 100644 Monitor/Pages/_get/DownloadFile.cshtml delete mode 100644 Monitor/Pages/_get/DownloadFile.cshtml.cs diff --git a/Monitor/Pages/_get/DownloadFile.cshtml b/Monitor/Pages/_get/DownloadFile.cshtml deleted file mode 100644 index e47402b..0000000 --- a/Monitor/Pages/_get/DownloadFile.cshtml +++ /dev/null @@ -1,5 +0,0 @@ -@page -@model DownloadFileModel -@{ - Layout = null; -} \ No newline at end of file diff --git a/Monitor/Pages/_get/DownloadFile.cshtml.cs b/Monitor/Pages/_get/DownloadFile.cshtml.cs deleted file mode 100644 index 63498ca..0000000 --- a/Monitor/Pages/_get/DownloadFile.cshtml.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using System.Linq; -using Core.Main; -using Core.Helper; -using Core.Main.DataObjects.PTMagicData; -using Core.MarketAnalyzer; - -namespace Monitor.Pages { - public class DownloadFileModel : _Internal.BasePageModelSecure { - - public void OnGet() { - // Initialize Config - base.Init(); - - InitializeDownload(); - } - - private void InitializeDownload() { - string fileName = GetStringParameter("f", ""); - if (System.IO.File.Exists(PTMagicBasePath + fileName)) { - if (!System.IO.Directory.Exists(PTMagicMonitorBasePath + "wwwroot" + System.IO.Path.DirectorySeparatorChar + "assets" + System.IO.Path.DirectorySeparatorChar + "tmp" + System.IO.Path.DirectorySeparatorChar)) { - System.IO.Directory.CreateDirectory(PTMagicMonitorBasePath + "wwwroot" + System.IO.Path.DirectorySeparatorChar + "assets" + System.IO.Path.DirectorySeparatorChar + "tmp" + System.IO.Path.DirectorySeparatorChar); - } - - string sourcefilePath = PTMagicBasePath + fileName; - string destinationFilePath = PTMagicMonitorBasePath + "wwwroot" + System.IO.Path.DirectorySeparatorChar + "assets" + System.IO.Path.DirectorySeparatorChar + "tmp" + System.IO.Path.DirectorySeparatorChar + fileName + ".zip"; - - ZIPHelper.CreateZipFile(new ArrayList() { sourcefilePath }, destinationFilePath); - - Response.Redirect(PTMagicConfiguration.GeneralSettings.Monitor.RootUrl + "assets/tmp/" + fileName + ".zip"); - } - } - } -} From d7f61da1b6b3711499b7c7b4b502ca0a9c6056bb Mon Sep 17 00:00:00 2001 From: djbadders <34887832+djbadders@users.noreply.github.com> Date: Wed, 17 Feb 2021 15:35:23 +0000 Subject: [PATCH 09/10] Leverage calculations issues fixed for distibution chart --- Monitor/Pages/_get/DashboardBottom.cshtml.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Monitor/Pages/_get/DashboardBottom.cshtml.cs b/Monitor/Pages/_get/DashboardBottom.cshtml.cs index eeb3004..96bc581 100644 --- a/Monitor/Pages/_get/DashboardBottom.cshtml.cs +++ b/Monitor/Pages/_get/DashboardBottom.cshtml.cs @@ -196,15 +196,15 @@ namespace Monitor.Pages { if (sellStrategyText.Contains("PENDING")) { - PendingBalance = PendingBalance + ((dcaLogEntry.Amount * dcaLogEntry.CurrentPrice) / dcaLogEntry.Leverage); + PendingBalance = PendingBalance + ((dcaLogEntry.Amount * dcaLogEntry.CurrentPrice) / dcaLogEntry.Leverage != 0 ? dcaLogEntry.Leverage : 1); } else if (dcaLogEntry.BuyStrategies.Count > 0) { - DCABalance = DCABalance + ((dcaLogEntry.Amount * dcaLogEntry.CurrentPrice) / dcaLogEntry.Leverage); + DCABalance = DCABalance + ((dcaLogEntry.Amount * dcaLogEntry.CurrentPrice) / dcaLogEntry.Leverage != 0 ? dcaLogEntry.Leverage : 1); } else { - PairsBalance = PairsBalance + ((dcaLogEntry.Amount * dcaLogEntry.CurrentPrice) / dcaLogEntry.Leverage); + PairsBalance = PairsBalance + ((dcaLogEntry.Amount * dcaLogEntry.CurrentPrice) / dcaLogEntry.Leverage != 0 ? dcaLogEntry.Leverage : 1); } } } From 0d2ca8c28f1a0aa3b28d8844379ff83a4f95b2ad Mon Sep 17 00:00:00 2001 From: HojouFotytu <36724681+HojouFotytu@users.noreply.github.com> Date: Thu, 18 Feb 2021 01:07:03 +0900 Subject: [PATCH 10/10] increment version --- PTMagic/Program.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PTMagic/Program.cs b/PTMagic/Program.cs index dd9d492..ff6fbbd 100644 --- a/PTMagic/Program.cs +++ b/PTMagic/Program.cs @@ -6,7 +6,7 @@ using Core.Helper; using Microsoft.Extensions.DependencyInjection; -[assembly: AssemblyVersion("2.5.3")] +[assembly: AssemblyVersion("2.5.4")] [assembly: AssemblyProduct("PT Magic")] namespace PTMagic
  @trendChangeOutput%  @trendChangeOutput%