From d8b3ee612cacdd04c89a60078d47a41de89aecff Mon Sep 17 00:00:00 2001 From: HojouFotytu <36724681+HojouFotytu@users.noreply.github.com> Date: Wed, 21 Apr 2021 19:29:42 +0900 Subject: [PATCH] Merge Target & Profit --- Monitor/Pages/SettingsGeneral.cshtml | 2 +- Monitor/Pages/_get/DashboardTop.cshtml | 68 +++++++++++--------------- 2 files changed, 29 insertions(+), 41 deletions(-) diff --git a/Monitor/Pages/SettingsGeneral.cshtml b/Monitor/Pages/SettingsGeneral.cshtml index 20f0d27..4989f93 100644 --- a/Monitor/Pages/SettingsGeneral.cshtml +++ b/Monitor/Pages/SettingsGeneral.cshtml @@ -190,7 +190,7 @@
- +
diff --git a/Monitor/Pages/_get/DashboardTop.cshtml b/Monitor/Pages/_get/DashboardTop.cshtml index 80d5569..9bdb3b4 100644 --- a/Monitor/Pages/_get/DashboardTop.cshtml +++ b/Monitor/Pages/_get/DashboardTop.cshtml @@ -98,10 +98,9 @@ 24H Cost - DCA - Sell - Target - Profit + DCA + Sell + Profit @@ -202,42 +201,32 @@ @Html.Raw(buyStrategyText) @Html.Raw(sellStrategyText) - - @if (!sellStrategyText.Contains("WATCHMODE")) - { - @if (sellStrategyText.Contains("CROSSED")) - // if leverage, recalculate profit target - { - string leverageText = sellStrategyText.Remove(0, sellStrategyText.IndexOf("CROSSED")+9); - leverage = leverageText.Remove(leverageText.IndexOf(".0)"), leverageText.Length - leverageText.IndexOf(".0)")); - leverageValue = double.Parse(leverage); - } - @if (sellStrategyText.Contains("ISOLATED")) - { - string leverageText = sellStrategyText.Remove(0, sellStrategyText.IndexOf("ISOLATED")+10); - leverage = leverageText.Remove(leverageText.IndexOf(".0)"), leverageText.Length - leverageText.IndexOf(".0)")); - leverageValue = double.Parse(leverage); - } - @if (leverageValue == 1) - { - @Html.Raw(dcaLogEntry.TargetGainValue.HasValue ? dcaLogEntry.TargetGainValue.Value.ToString("#,#0.00", new System.Globalization.CultureInfo("en-US")) + "%" : " ") - } - else - { - double TargetGain = leverageValue * dcaLogEntry.TargetGainValue.Value; - @Html.Raw(dcaLogEntry.TargetGainValue.HasValue ? TargetGain.ToString("#,#0.00", new System.Globalization.CultureInfo("en-US")) + "%" : " ") - } - } - else - { - - } - + @if (!@lostValue) - { - profitPercentage = profitPercentage * leverageValue; - @profitPercentage.ToString("#,#0.00", new System.Globalization.CultureInfo("en-US"))% - } + { + @if (!sellStrategyText.Contains("WATCHMODE")) + { + @if (sellStrategyText.Contains("CROSSED")) + // if leverage, recalculate profit target + { + string leverageText = sellStrategyText.Remove(0, sellStrategyText.IndexOf("CROSSED")+9); + leverage = leverageText.Remove(leverageText.IndexOf(".0)"), leverageText.Length - leverageText.IndexOf(".0)")); + leverageValue = double.Parse(leverage); + } + @if (sellStrategyText.Contains("ISOLATED")) + { + string leverageText = sellStrategyText.Remove(0, sellStrategyText.IndexOf("ISOLATED")+10); + leverage = leverageText.Remove(leverageText.IndexOf(".0)"), leverageText.Length - leverageText.IndexOf(".0)")); + leverageValue = double.Parse(leverage); + } + profitPercentage = profitPercentage * leverageValue; + double TargetGain = leverageValue * dcaLogEntry.TargetGainValue.Value; + @TargetGain.ToString("#,#0.00", new System.Globalization.CultureInfo("en-US"))% +
+
@profitPercentage.ToString("#,#0.00", new System.Globalization.CultureInfo("en-US"))%
+ + } + } else { No Value! @@ -258,7 +247,6 @@ - @Html.Raw((((Model.TotalBagGain) / Model.TotalBagCost) * 100).ToString("#,#0.00", new System.Globalization.CultureInfo("en-US")))%