diff --git a/Core/Helper/SystemHelper.cs b/Core/Helper/SystemHelper.cs index c315e50..dcb2f79 100644 --- a/Core/Helper/SystemHelper.cs +++ b/Core/Helper/SystemHelper.cs @@ -536,20 +536,14 @@ namespace Core.Helper string result = "#"; if (platform.Equals("TradingView")) { - result = "https://www.tradingview.com/symbols/" + market.ToUpper() + "/?exchange=" + exchange.ToUpper(); - } - else if (platform.Equals("TradingViewFutures")) - { - result = "https://www.tradingview.com/chart/?symbol="; - - string pairName = SystemHelper.StripBadCode(market, Constants.WhiteListMinimal); - - if (pairName.StartsWith(mainMarket)) + if (exchange.Equals("binancefutures", StringComparison.InvariantCultureIgnoreCase)) { - pairName = pairName.Replace(mainMarket, "") + mainMarket; + result = "https://uk.tradingview.com/chart/?symbol=BINANCE:" + market.ToUpper() + "PERP"; + } + else + { + result = "https://uk.tradingview.com/?symbol=" + exchange.ToUpper() + ":" + market.ToUpper(); } - - result += pairName + "PERP"; } else { @@ -614,8 +608,16 @@ namespace Core.Helper pairName = pairName.Replace(mainMarket, "") + mainMarket; } - result += pairName; + if (exchange.Equals("binancefutures", StringComparison.InvariantCultureIgnoreCase)) + { + result = "BINANCE:" + pairName + "PERP"; + } + else + { + result += pairName; + } + return result; } diff --git a/Monitor/Pages/SalesAnalyzer.cshtml.cs b/Monitor/Pages/SalesAnalyzer.cshtml.cs index 37725f3..1b2a00f 100644 --- a/Monitor/Pages/SalesAnalyzer.cshtml.cs +++ b/Monitor/Pages/SalesAnalyzer.cshtml.cs @@ -161,7 +161,12 @@ 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 != 0 ? dcaLogEntry.Leverage : 1); + double leverage = dcaLogEntry.Leverage; + if (leverage == 0) + { + leverage = 1; + } + totalCurrentValue = totalCurrentValue + ((dcaLogEntry.Amount * dcaLogEntry.CurrentPrice) / leverage); } totalCurrentValue = totalCurrentValue + AvailableBalance; } diff --git a/Monitor/Pages/SettingsGeneral.cshtml b/Monitor/Pages/SettingsGeneral.cshtml index 5447e0b..64c3783 100644 --- a/Monitor/Pages/SettingsGeneral.cshtml +++ b/Monitor/Pages/SettingsGeneral.cshtml @@ -243,7 +243,6 @@ diff --git a/Monitor/Pages/_get/DashboardBottom.cshtml.cs b/Monitor/Pages/_get/DashboardBottom.cshtml.cs index 96bc581..5eb3390 100644 --- a/Monitor/Pages/_get/DashboardBottom.cshtml.cs +++ b/Monitor/Pages/_get/DashboardBottom.cshtml.cs @@ -177,35 +177,22 @@ namespace Monitor.Pages string sellStrategyText = Core.ProfitTrailer.StrategyHelper.GetStrategyText(Summary, dcaLogEntry.SellStrategies, dcaLogEntry.SellStrategy, isSellStrategyTrue, isTrailingSellActive); // Aggregate totals - if (dcaLogEntry.Leverage == 0) + double leverage = dcaLogEntry.Leverage; + if (leverage == 0) { - if (sellStrategyText.Contains("PENDING")) - { - PendingBalance = PendingBalance + (dcaLogEntry.Amount * dcaLogEntry.CurrentPrice); - } - else if (dcaLogEntry.BuyStrategies.Count > 0) - { - DCABalance = DCABalance + (dcaLogEntry.Amount * dcaLogEntry.CurrentPrice); - } - else - { - PairsBalance = PairsBalance + (dcaLogEntry.Amount * dcaLogEntry.CurrentPrice); - } + leverage = 1; + } + if (sellStrategyText.Contains("PENDING")) + { + PendingBalance = PendingBalance + ((dcaLogEntry.Amount * dcaLogEntry.CurrentPrice) / leverage); + } + else if (dcaLogEntry.BuyStrategies.Count > 0) + { + DCABalance = DCABalance + ((dcaLogEntry.Amount * dcaLogEntry.CurrentPrice) / leverage); } else { - if (sellStrategyText.Contains("PENDING")) - { - 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 != 0 ? dcaLogEntry.Leverage : 1); - } - else - { - PairsBalance = PairsBalance + ((dcaLogEntry.Amount * dcaLogEntry.CurrentPrice) / dcaLogEntry.Leverage != 0 ? dcaLogEntry.Leverage : 1); - } + PairsBalance = PairsBalance + ((dcaLogEntry.Amount * dcaLogEntry.CurrentPrice) / leverage); } } totalCurrentValue = PendingBalance + DCABalance + PairsBalance + AvailableBalance; diff --git a/PTMagic/Program.cs b/PTMagic/Program.cs index ff6fbbd..11bc420 100644 --- a/PTMagic/Program.cs +++ b/PTMagic/Program.cs @@ -6,7 +6,7 @@ using Core.Helper; using Microsoft.Extensions.DependencyInjection; -[assembly: AssemblyVersion("2.5.4")] +[assembly: AssemblyVersion("2.5.5")] [assembly: AssemblyProduct("PT Magic")] namespace PTMagic