diff --git a/Monitor/Pages/_get/DashboardBottom.cshtml b/Monitor/Pages/_get/DashboardBottom.cshtml index 6508be7..03cff44 100644 --- a/Monitor/Pages/_get/DashboardBottom.cshtml +++ b/Monitor/Pages/_get/DashboardBottom.cshtml @@ -196,7 +196,7 @@ Sales Profit @Model.Summary.MainMarket Profit @Model.Summary.MainFiatCurrency - % Gain + Gain diff --git a/Monitor/Pages/_get/DashboardTop.cshtml b/Monitor/Pages/_get/DashboardTop.cshtml index 2a2fb03..9793351 100644 --- a/Monitor/Pages/_get/DashboardTop.cshtml +++ b/Monitor/Pages/_get/DashboardTop.cshtml @@ -138,50 +138,36 @@ isSellStrategyTrue = (dcaLogEntry.SellStrategies.FindAll(ss => !ss.IsTrue).Count == 0); } - bool buyDisabled = false; string leverage = ""; double leverageValue = 1; string buyStrategyText = Core.ProfitTrailer.StrategyHelper.GetStrategyText(Model.Summary, dcaLogEntry.BuyStrategies, dcaLogEntry.BuyStrategy, isBuyStrategyTrue, isTrailingBuyActive); - - if (!Core.ProfitTrailer.StrategyHelper.IsValidStrategy(buyStrategyText, true)) - { - buyDisabled = true; - } string sellStrategyText = Core.ProfitTrailer.StrategyHelper.GetStrategyText(Model.Summary, dcaLogEntry.SellStrategies, dcaLogEntry.SellStrategy, isSellStrategyTrue, isTrailingSellActive); // Check for when PT loses the value of a pair bool lostValue = false; lostValue = (dcaLogEntry.TotalCost == 0.0) || (dcaLogEntry.AverageBuyPrice == 0.0); - double exchangeFee = 0; - switch (Model.PTMagicConfiguration.GeneralSettings.Application.Exchange.ToLower()) + // Profit percentage + var profitPercentage = dcaLogEntry.ProfitPercent; + + if (dcaLogEntry.SellStrategies != null) { - case "binance": - exchangeFee = 0.002; - break; - case "binanceus": - exchangeFee = 0.002; - break; - case "binancefutures": - exchangeFee = 0.002; - break; - case "bittrex": - exchangeFee = 0.0025; - break; - case "poloniex": - exchangeFee = 0.0025; - break; - default: - break; + var gainStrategy = dcaLogEntry.SellStrategies.FirstOrDefault(x => x.Name.Contains(" GAIN", StringComparison.InvariantCultureIgnoreCase)); + if (gainStrategy != null) + { + // Use the gain percentage value as it is accurate to what can be achieved with the order book! + profitPercentage = gainStrategy.CurrentValue; + } } + // Aggregate totals - double tradingFee = (exchangeFee * dcaLogEntry.TotalCost) * 2; - double bagGain = (dcaLogEntry.ProfitPercent / 100) * dcaLogEntry.TotalCost * leverageValue; + double bagGain = (profitPercentage / 100) * dcaLogEntry.TotalCost * leverageValue; Model.TotalBagCost = Model.TotalBagCost + dcaLogEntry.TotalCost; Model.TotalBagGain = Model.TotalBagGain + bagGain; // Render the row + @if (mps == null || mps.ActiveSingleSettings == null || mps.ActiveSingleSettings.Count == 0) { @dcaLogEntry.Market @@ -189,8 +175,11 @@ { @dcaLogEntry.Market } + @Html.Raw((dcaLogEntry.PercChange * 100).ToString("#,#0.00", new System.Globalization.CultureInfo("en-US")))% + @Html.Raw(dcaLogEntry.TotalCost.ToString("#,#0.000000", new System.Globalization.CultureInfo("en-US"))) + @if (dcaEnabled) { @@ -203,9 +192,11 @@ } + @Html.Raw(buyStrategyText) + @Html.Raw(sellStrategyText) - + @if (!sellStrategyText.Contains("WATCHMODE")) { @if (sellStrategyText.Contains("CROSSED")) @@ -223,12 +214,12 @@ } @if (leverageValue == 1) { - @Html.Raw(dcaLogEntry.TargetGainValue.HasValue ? dcaLogEntry.TargetGainValue.Value.ToString("#,#0.00", new System.Globalization.CultureInfo("en-US")) + "%" : " ") + @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")) + "%" : " ") + @Html.Raw(dcaLogEntry.TargetGainValue.HasValue ? TargetGain.ToString("#,#0.00", new System.Globalization.CultureInfo("en-US")) + "%" : " ") } } else @@ -236,16 +227,17 @@ } - - + @if (!@lostValue) - { - @dcaLogEntry.ProfitPercent.ToString("#,#0.00", new System.Globalization.CultureInfo("en-US"))% + { + @profitPercentage.ToString("#,#0.00", new System.Globalization.CultureInfo("en-US"))% } else { No Value! } + + }