From 7d579145497c778c41426352e48e582ae35831f7 Mon Sep 17 00:00:00 2001 From: HojouFotytu <36724681+HojouFotytu@users.noreply.github.com> Date: Wed, 22 Jul 2020 13:31:33 +0900 Subject: [PATCH 1/2] shortcut changes --- Core/ProfitTrailer/StrategyHelper.cs | 44 ++++++++++++++-------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/Core/ProfitTrailer/StrategyHelper.cs b/Core/ProfitTrailer/StrategyHelper.cs index 68e7508..4b7a363 100644 --- a/Core/ProfitTrailer/StrategyHelper.cs +++ b/Core/ProfitTrailer/StrategyHelper.cs @@ -269,40 +269,40 @@ namespace Core.ProfitTrailer result = String.Concat(strategyLetter, "LOSS"); break; case "smagain": - result = String.Concat(strategyLetter, "SMAG"); + result = String.Concat(strategyLetter, "SMA-G"); break; case "emagain": - result = String.Concat(strategyLetter, "EMAG"); + result = String.Concat(strategyLetter, "EMA-G"); break; case "hmagain": - result = String.Concat(strategyLetter, "HMAG"); + result = String.Concat(strategyLetter, "HMA-G"); break; case "dmagain": - result = String.Concat(strategyLetter, "DMAG"); + result = String.Concat(strategyLetter, "DMA-G"); break; case "smaspread": - result = String.Concat(strategyLetter, "SMAS"); + result = String.Concat(strategyLetter, "SMA-S"); break; case "emaspread": - result = String.Concat(strategyLetter, "EMAS"); + result = String.Concat(strategyLetter, "EMA-S"); break; case "hmaspread": - result = String.Concat(strategyLetter, "HMAS"); + result = String.Concat(strategyLetter, "HMA-S"); break; case "dmaspread": - result = String.Concat(strategyLetter, "DMAS"); + result = String.Concat(strategyLetter, "DMA-S"); break; case "smacross": - result = String.Concat(strategyLetter, "SMAC"); + result = String.Concat(strategyLetter, "SMA-C"); break; case "emacross": - result = String.Concat(strategyLetter, "EMAC"); + result = String.Concat(strategyLetter, "EMA-C"); break; case "hmacross": - result = String.Concat(strategyLetter, "HMAC"); + result = String.Concat(strategyLetter, "HMA-C"); break; case "dmacross": - result = String.Concat(strategyLetter, "DMAC"); + result = String.Concat(strategyLetter, "DMA-C"); break; case "rsi": result = String.Concat(strategyLetter, "RSI"); @@ -314,13 +314,13 @@ namespace Core.ProfitTrailer result = String.Concat(strategyLetter, "SRSI"); break; case "stochrsik": - result = String.Concat(strategyLetter, "SRSIK"); + result = String.Concat(strategyLetter, "SRSI-K"); break; case "stochrsid": - result = String.Concat(strategyLetter, "SRSID"); + result = String.Concat(strategyLetter, "SRSI-D"); break; case "stochrsicross": - result = String.Concat(strategyLetter, "SRSIC"); + result = String.Concat(strategyLetter, "SRSI-C"); break; case "macd": result = String.Concat(strategyLetter, "MACD"); @@ -359,19 +359,19 @@ namespace Core.ProfitTrailer result = String.Concat(strategyLetter, "FIXED"); break; case "lowatrband": - result = String.Concat(strategyLetter, "LATR"); + result = String.Concat(strategyLetter, "L-ATR"); break; case "highatrband": - result = String.Concat(strategyLetter, "HATR"); + result = String.Concat(strategyLetter, "H-ATR"); break; case "atrpercentage": - result = String.Concat(strategyLetter, "ATRPCT"); + result = String.Concat(strategyLetter, "ATR-PCT"); break; case "vwappercentage": result = String.Concat(strategyLetter, "VWAP"); break; case "mvwappercentage": - result = String.Concat(strategyLetter, "MVWAP"); + result = String.Concat(strategyLetter, "M-VWAP"); break; case "btcdominance": result = String.Concat(strategyLetter, "BTCDOM"); @@ -425,13 +425,13 @@ namespace Core.ProfitTrailer result = String.Concat(strategyLetter, "NODCA"); break; case "combimagain": - result = String.Concat(strategyLetter, "COMBIG"); + result = String.Concat(strategyLetter, "COMBI-G"); break; case "combimaspread": - result = String.Concat(strategyLetter, "COMBIS"); + result = String.Concat(strategyLetter, "COMBI-S"); break; case "combimacross": - result = String.Concat(strategyLetter, "COMBIC"); + result = String.Concat(strategyLetter, "COMBI-C"); break; case "macdpercentage": result = String.Concat(strategyLetter, "MACDPERC"); From 9afb3df9ee89f0859750303ed1213926713bdf2e Mon Sep 17 00:00:00 2001 From: HojouFotytu <36724681+HojouFotytu@users.noreply.github.com> Date: Wed, 22 Jul 2020 16:48:40 +0900 Subject: [PATCH 2/2] fix TCV on Sales Analyzer Page --- Monitor/Pages/SalesAnalyzer.cshtml | 10 +++++----- Monitor/Pages/SalesAnalyzer.cshtml.cs | 18 +++++++++++++++++- Monitor/Pages/_get/DashboardBottom.cshtml.cs | 5 ----- 3 files changed, 22 insertions(+), 11 deletions(-) diff --git a/Monitor/Pages/SalesAnalyzer.cshtml b/Monitor/Pages/SalesAnalyzer.cshtml index f7716d2..cdf53d3 100644 --- a/Monitor/Pages/SalesAnalyzer.cshtml +++ b/Monitor/Pages/SalesAnalyzer.cshtml @@ -19,13 +19,13 @@ @{ - double currentBalance = Model.PTData.GetCurrentBalance(); - string currentBalanceString = currentBalance.ToString("#,#0.00000000", new System.Globalization.CultureInfo("en-US")); - if (currentBalance > 100) { - currentBalanceString = Math.Round(currentBalance, 2).ToString("#,#0.00", new System.Globalization.CultureInfo("en-US")); + string totalCurrentValueString = Model.totalCurrentValue.ToString("#,#0.00000000", new System.Globalization.CultureInfo("en-US")); + if (Model.totalCurrentValue > 100) + { + totalCurrentValueString = Math.Round(Model.totalCurrentValue, 2).ToString("#,#0.00", new System.Globalization.CultureInfo("en-US")); } } - Account Value:   @currentBalanceString   @Model.Summary.MainMarket + Total Account Value:   @totalCurrentValueString @Model.Summary.MainMarket Starting Value:   @Model.PTMagicConfiguration.GeneralSettings.Application.StartBalance   @Model.Summary.MainMarket diff --git a/Monitor/Pages/SalesAnalyzer.cshtml.cs b/Monitor/Pages/SalesAnalyzer.cshtml.cs index dd8f41a..7c262bd 100644 --- a/Monitor/Pages/SalesAnalyzer.cshtml.cs +++ b/Monitor/Pages/SalesAnalyzer.cshtml.cs @@ -20,12 +20,13 @@ namespace Monitor.Pages public Dictionary DailyGains = new Dictionary(); public Dictionary MonthlyGains = new Dictionary(); public DateTimeOffset DateTimeNow = Constants.confMinDate; - + public double totalCurrentValue = 0; public void OnGet() { base.Init(); BindData(); + BuildTCV(); } private void BindData() @@ -135,5 +136,20 @@ namespace Monitor.Pages } } } + + private void BuildTCV() + { + double AvailableBalance = PTData.GetCurrentBalance(); + foreach (Core.Main.DataObjects.PTMagicData.DCALogData dcaLogEntry in PTData.DCALog) + { + totalCurrentValue = totalCurrentValue + ((dcaLogEntry.Amount * dcaLogEntry.CurrentPrice) / dcaLogEntry.Leverage); + } + totalCurrentValue = totalCurrentValue + AvailableBalance; + } + + + + + } } diff --git a/Monitor/Pages/_get/DashboardBottom.cshtml.cs b/Monitor/Pages/_get/DashboardBottom.cshtml.cs index 1d86478..daa0d0f 100644 --- a/Monitor/Pages/_get/DashboardBottom.cshtml.cs +++ b/Monitor/Pages/_get/DashboardBottom.cshtml.cs @@ -19,10 +19,6 @@ namespace Monitor.Pages public string LastGlobalSetting = "Default"; public DateTimeOffset DateTimeNow = Constants.confMinDate; public string AssetDistributionData = ""; - public double currentBalance = 0; - public string currentBalanceString = ""; - public double TotalBagCost = 0; - public double TotalBagValue = 0; public double totalCurrentValue = 0; public void OnGet() { @@ -170,7 +166,6 @@ namespace Monitor.Pages foreach (Core.Main.DataObjects.PTMagicData.DCALogData dcaLogEntry in PTData.DCALog) { - Core.Main.DataObjects.PTMagicData.MarketPairSummary mps = null; string sellStrategyText = Core.ProfitTrailer.StrategyHelper.GetStrategyText(Summary, dcaLogEntry.SellStrategies, dcaLogEntry.SellStrategy, isSellStrategyTrue, isTrailingSellActive); // Aggregate totals