30day sales to dashboard

This commit is contained in:
HojouFotytu 2019-01-14 12:09:58 +09:00
parent d657ca9e68
commit 17bdca1184
2 changed files with 22 additions and 0 deletions

View File

@ -101,6 +101,14 @@ namespace Core.Main.DataObjects
} }
} }
public List<SellLogData> SellLogLast30Days
{
get
{
return _sellLog.FindAll(sl => sl.SoldDate.Date >= _dateTimeNow.DateTime.AddDays(-30).Date);
}
}
public List<DCALogData> DCALog public List<DCALogData> DCALog
{ {
get get

View File

@ -70,6 +70,13 @@
double last7DaysProfit = Model.PTData.SellLogLast7Days.Sum(s => s.Profit); double last7DaysProfit = Model.PTData.SellLogLast7Days.Sum(s => s.Profit);
double last7DaysProfitFiat = Math.Round(last7DaysProfit * Model.Summary.MainMarketPrice, 2); double last7DaysProfitFiat = Math.Round(last7DaysProfit * Model.Summary.MainMarketPrice, 2);
double last7DaysPercentGain = Math.Round(last7DaysProfit / last7DaysStartBalance * 100, 2); double last7DaysPercentGain = Math.Round(last7DaysProfit / last7DaysStartBalance * 100, 2);
double last30DaysStartBalance = Model.PTData.GetSnapshotBalance(Model.DateTimeNow.DateTime.AddDays(-30));
double last30DaysProfit = Model.PTData.SellLogLast30Days.Sum(s => s.Profit);
double last30DaysProfitFiat = Math.Round(last30DaysProfit * Model.Summary.MainMarketPrice, 2);
double last30DaysPercentGain = Math.Round(last30DaysProfit / last30DaysStartBalance * 100, 2);
}
} }
<table class="table table-sm"> <table class="table table-sm">
@ -104,6 +111,13 @@
<td class="text-right text-autocolor">@Html.Raw(Model.MainFiatCurrencySymbol + last7DaysProfitFiat.ToString("#,#0.00", new System.Globalization.CultureInfo("en-US")))</td> <td class="text-right text-autocolor">@Html.Raw(Model.MainFiatCurrencySymbol + last7DaysProfitFiat.ToString("#,#0.00", new System.Globalization.CultureInfo("en-US")))</td>
<td class="text-right text-autocolor">@last7DaysPercentGain.ToString("#,#0.00", new System.Globalization.CultureInfo("en-US"))%</td> <td class="text-right text-autocolor">@last7DaysPercentGain.ToString("#,#0.00", new System.Globalization.CultureInfo("en-US"))%</td>
</tr> </tr>
<tr>
<th>Last 30 Days</th>
<td class="text-right">@Model.PTData.SellLogLast30Days.Count</td>
<td class="text-right text-autocolor">@last30DaysProfit.ToString("#,#0.00000000", new System.Globalization.CultureInfo("en-US"))</td>
<td class="text-right text-autocolor">@Html.Raw(Model.MainFiatCurrencySymbol + last30DaysProfitFiat.ToString("#,#0.00", new System.Globalization.CultureInfo("en-US")))</td>
<td class="text-right text-autocolor">@last30DaysPercentGain.ToString("#,#0.00", new System.Globalization.CultureInfo("en-US"))%</td>
</tr>
<tr> <tr>
<th>Total</th> <th>Total</th>
<td class="text-right">@Model.PTData.SellLog.Count</td> <td class="text-right">@Model.PTData.SellLog.Count</td>