Merge branch 'develop' into develop

This commit is contained in:
Dave Baddeley 2020-07-23 19:28:19 +01:00 committed by GitHub
commit 849e4268ee
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 53 additions and 37 deletions

View File

@ -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");

View File

@ -19,13 +19,13 @@
<thead>
<tr>
@{
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"));
}
}
<th class="m-t-0 header-title text-left">Account Value: &nbsp; <text class="text-autocolor"> @currentBalanceString &nbsp; @Model.Summary.MainMarket </text> <small> <i class="fa fa-info-circle text-muted" data-toggle="tooltip" data-placement="top" title="This is based on your sales history, entries on the Transactions page and any currently held positions."></i></small></th>
<th class="m-t-0 header-title text-left">Total Account Value: &nbsp; <text class="text-autocolor"> @totalCurrentValueString @Model.Summary.MainMarket </text> <small> <i class="fa fa-info-circle text-muted" data-toggle="tooltip" data-placement="top" title="This is based on your sales history, entries on the Transactions page and any currently held positions."></i></small></th>
<th class="text-right">Starting Value: &nbsp; <text class="text-autocolor"> @Model.PTMagicConfiguration.GeneralSettings.Application.StartBalance &nbsp; @Model.Summary.MainMarket </text> <small> <i class="fa fa-info-circle text-muted" data-toggle="tooltip" data-placement="top" title="This is the starting value found in your settings file"></i></small></th>
</tr>
</thead>

View File

@ -20,12 +20,13 @@ namespace Monitor.Pages
public Dictionary<DateTime, double> DailyGains = new Dictionary<DateTime, double>();
public Dictionary<DateTime, double> MonthlyGains = new Dictionary<DateTime, double>();
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;
}
}
}

View File

@ -32,10 +32,14 @@
}
}
<div id="AssetDistribution" class="container">
<div class="row px1">
<div class="col-3 px-1 text-center"><small>Start:&nbsp;<text class="text-autocolor">@Model.PTMagicConfiguration.GeneralSettings.Application.StartBalance @Model.Summary.MainMarket</text></small></div>
<div class="col-6 px-1 text-center"><small>TCV:&nbsp;<text class="text-autocolor">@totalCurrentValueString @Model.Summary.MainMarket</text></small></div>
<div class="col-3 px-1 text-center"><small>Gain:&nbsp;<text class="text-autocolor">@Math.Round(((Model.totalCurrentValue - Model.PTMagicConfiguration.GeneralSettings.Application.StartBalance) / Model.PTMagicConfiguration.GeneralSettings.Application.StartBalance) * 100, 2)%</text></small></div>
<div class="text-center">
<small>
<span data-toggle="tooltip" data-placement="top" title="Starting balance from PTM settings">Start: &nbsp; <text class="text-autocolor"> @Model.PTMagicConfiguration.GeneralSettings.Application.StartBalance @Model.Summary.MainMarket </text></span>
<span data-toggle="tooltip" data-placement="top" title="TCV gain on starting balance"> &emsp; &emsp; Gain:&nbsp;<text class="text-autocolor">@Math.Round(((Model.totalCurrentValue - Model.PTMagicConfiguration.GeneralSettings.Application.StartBalance) / Model.PTMagicConfiguration.GeneralSettings.Application.StartBalance) * 100, 2)%</text></span>
</small>
</div>
<div class="text-center">
<span data-toggle="tooltip" data-placement="top" title="Total current account value">TCV: &nbsp; <text class="text-autocolor"> @totalCurrentValueString @Model.Summary.MainMarket </text> </span>
</div>
<div class="row px1">
<svg style="height:260px;width:100%"></svg>

View File

@ -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()
{
@ -171,7 +167,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

View File

@ -62,6 +62,7 @@
<td class="text-autocolor">@string.Format("{0}%", (buyLogEntry.PercChange * 100).ToString("#,#0.00"))</td>
<td class="text">@string.Format("{0}", (buyLogEntry.Volume24h).ToString())</td>
<td class="text-left">@buyLogEntry.CurrentPrice.ToString("#,#0.00000000", new System.Globalization.CultureInfo("en-US"))</td>
@if (buyDisabled) {
<td>@Html.Raw(buyStrategyText)</td>
} else {