Merge pull request #268 from HojouFotytu/develop
Trading View & Distribution chart fixes
This commit is contained in:
commit
1093a7ed53
|
@ -536,20 +536,14 @@ namespace Core.Helper
|
||||||
string result = "#";
|
string result = "#";
|
||||||
if (platform.Equals("TradingView"))
|
if (platform.Equals("TradingView"))
|
||||||
{
|
{
|
||||||
result = "https://www.tradingview.com/symbols/" + market.ToUpper() + "/?exchange=" + exchange.ToUpper();
|
if (exchange.Equals("binancefutures", StringComparison.InvariantCultureIgnoreCase))
|
||||||
}
|
|
||||||
else if (platform.Equals("TradingViewFutures"))
|
|
||||||
{
|
|
||||||
result = "https://www.tradingview.com/chart/?symbol=";
|
|
||||||
|
|
||||||
string pairName = SystemHelper.StripBadCode(market, Constants.WhiteListMinimal);
|
|
||||||
|
|
||||||
if (pairName.StartsWith(mainMarket))
|
|
||||||
{
|
{
|
||||||
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
|
else
|
||||||
{
|
{
|
||||||
|
@ -614,8 +608,16 @@ namespace Core.Helper
|
||||||
pairName = pairName.Replace(mainMarket, "") + mainMarket;
|
pairName = pairName.Replace(mainMarket, "") + mainMarket;
|
||||||
}
|
}
|
||||||
|
|
||||||
result += pairName;
|
if (exchange.Equals("binancefutures", StringComparison.InvariantCultureIgnoreCase))
|
||||||
|
{
|
||||||
|
result = "BINANCE:" + pairName + "PERP";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
result += pairName;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
|
@ -161,7 +161,12 @@ namespace Monitor.Pages
|
||||||
double AvailableBalance = PTData.GetCurrentBalance();
|
double AvailableBalance = PTData.GetCurrentBalance();
|
||||||
foreach (Core.Main.DataObjects.PTMagicData.DCALogData dcaLogEntry in PTData.DCALog)
|
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;
|
totalCurrentValue = totalCurrentValue + AvailableBalance;
|
||||||
}
|
}
|
||||||
|
|
|
@ -243,7 +243,6 @@
|
||||||
<select name="Monitor_LinkPlatform" class="form-control">
|
<select name="Monitor_LinkPlatform" class="form-control">
|
||||||
<option selected="@(Model.PTMagicConfiguration.GeneralSettings.Monitor.LinkPlatform.Equals("Exchange", StringComparison.InvariantCultureIgnoreCase))">Exchange</option>
|
<option selected="@(Model.PTMagicConfiguration.GeneralSettings.Monitor.LinkPlatform.Equals("Exchange", StringComparison.InvariantCultureIgnoreCase))">Exchange</option>
|
||||||
<option selected="@(Model.PTMagicConfiguration.GeneralSettings.Monitor.LinkPlatform.Equals("TradingView", StringComparison.InvariantCultureIgnoreCase))">TradingView</option>
|
<option selected="@(Model.PTMagicConfiguration.GeneralSettings.Monitor.LinkPlatform.Equals("TradingView", StringComparison.InvariantCultureIgnoreCase))">TradingView</option>
|
||||||
<option selected="@(Model.PTMagicConfiguration.GeneralSettings.Monitor.LinkPlatform.Equals("TradingViewFutures", StringComparison.InvariantCultureIgnoreCase))">TradingViewFutures</option>
|
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -177,35 +177,22 @@ namespace Monitor.Pages
|
||||||
string sellStrategyText = Core.ProfitTrailer.StrategyHelper.GetStrategyText(Summary, dcaLogEntry.SellStrategies, dcaLogEntry.SellStrategy, isSellStrategyTrue, isTrailingSellActive);
|
string sellStrategyText = Core.ProfitTrailer.StrategyHelper.GetStrategyText(Summary, dcaLogEntry.SellStrategies, dcaLogEntry.SellStrategy, isSellStrategyTrue, isTrailingSellActive);
|
||||||
|
|
||||||
// Aggregate totals
|
// Aggregate totals
|
||||||
if (dcaLogEntry.Leverage == 0)
|
double leverage = dcaLogEntry.Leverage;
|
||||||
|
if (leverage == 0)
|
||||||
{
|
{
|
||||||
if (sellStrategyText.Contains("PENDING"))
|
leverage = 1;
|
||||||
{
|
}
|
||||||
PendingBalance = PendingBalance + (dcaLogEntry.Amount * dcaLogEntry.CurrentPrice);
|
if (sellStrategyText.Contains("PENDING"))
|
||||||
}
|
{
|
||||||
else if (dcaLogEntry.BuyStrategies.Count > 0)
|
PendingBalance = PendingBalance + ((dcaLogEntry.Amount * dcaLogEntry.CurrentPrice) / leverage);
|
||||||
{
|
}
|
||||||
DCABalance = DCABalance + (dcaLogEntry.Amount * dcaLogEntry.CurrentPrice);
|
else if (dcaLogEntry.BuyStrategies.Count > 0)
|
||||||
}
|
{
|
||||||
else
|
DCABalance = DCABalance + ((dcaLogEntry.Amount * dcaLogEntry.CurrentPrice) / leverage);
|
||||||
{
|
|
||||||
PairsBalance = PairsBalance + (dcaLogEntry.Amount * dcaLogEntry.CurrentPrice);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (sellStrategyText.Contains("PENDING"))
|
PairsBalance = PairsBalance + ((dcaLogEntry.Amount * dcaLogEntry.CurrentPrice) / 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 != 0 ? dcaLogEntry.Leverage : 1);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
PairsBalance = PairsBalance + ((dcaLogEntry.Amount * dcaLogEntry.CurrentPrice) / dcaLogEntry.Leverage != 0 ? dcaLogEntry.Leverage : 1);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
totalCurrentValue = PendingBalance + DCABalance + PairsBalance + AvailableBalance;
|
totalCurrentValue = PendingBalance + DCABalance + PairsBalance + AvailableBalance;
|
||||||
|
|
|
@ -6,7 +6,7 @@ using Core.Helper;
|
||||||
using Microsoft.Extensions.DependencyInjection;
|
using Microsoft.Extensions.DependencyInjection;
|
||||||
|
|
||||||
|
|
||||||
[assembly: AssemblyVersion("2.5.4")]
|
[assembly: AssemblyVersion("2.5.5")]
|
||||||
[assembly: AssemblyProduct("PT Magic")]
|
[assembly: AssemblyProduct("PT Magic")]
|
||||||
|
|
||||||
namespace PTMagic
|
namespace PTMagic
|
||||||
|
|
Loading…
Reference in New Issue