From 13d8ebbaf14b9fea54ccf968200cca322a6bba90 Mon Sep 17 00:00:00 2001
From: HojouFotytu <36724681+HojouFotytu@users.noreply.github.com>
Date: Tue, 26 Feb 2019 01:02:52 +0900
Subject: [PATCH] Badders' highlight pairs without average price
---
Monitor/Pages/BagAnalyzer.cshtml | 4 +--
Monitor/Pages/_get/BagList.cshtml | 39 ++++++++++++++++++++++++--
Monitor/Pages/_get/DashboardTop.cshtml | 25 ++++++++++++++---
Monitor/wwwroot/assets/css/custom.css | 10 +++++++
4 files changed, 69 insertions(+), 9 deletions(-)
diff --git a/Monitor/Pages/BagAnalyzer.cshtml b/Monitor/Pages/BagAnalyzer.cshtml
index 07e6e01..87c1093 100644
--- a/Monitor/Pages/BagAnalyzer.cshtml
+++ b/Monitor/Pages/BagAnalyzer.cshtml
@@ -29,7 +29,7 @@
Market
- Value
+ Value
DCA
Buy Strats
BS Value
@@ -98,4 +98,4 @@
interval = setInterval(function () { loadBagList(); }, @Model.PTMagicConfiguration.GeneralSettings.Monitor.BagAnalyzerRefreshSeconds * 1000);
});
-}
+}
\ No newline at end of file
diff --git a/Monitor/Pages/_get/BagList.cshtml b/Monitor/Pages/_get/BagList.cshtml
index f48b16a..cc37519 100644
--- a/Monitor/Pages/_get/BagList.cshtml
+++ b/Monitor/Pages/_get/BagList.cshtml
@@ -11,6 +11,7 @@
}
@foreach (Core.Main.DataObjects.PTMagicData.DCALogData dcaLogEntry in dcaLogResult) {
+ // Loop through the pairs preparing the data for display
Core.Main.DataObjects.PTMagicData.MarketPairSummary mps = null;
if (Model.Summary.MarketSummary.ContainsKey(dcaLogEntry.Market)) {
mps = Model.Summary.MarketSummary[dcaLogEntry.Market];
@@ -75,28 +76,44 @@
string triggerSellValueText = Core.ProfitTrailer.StrategyHelper.GetTriggerValueText(Model.Summary, dcaLogEntry.SellStrategies, dcaLogEntry.SellStrategy, dcaLogEntry.BBTrigger, dcaLogEntry.SellTrigger, 0, true);
double currentFiatValue = Math.Round(dcaLogEntry.Amount * dcaLogEntry.CurrentPrice * Model.Summary.MainMarketPrice, 2);
-
+ // Check for when PT loses the value of a pair
+ bool lostValue = false;
+ lostValue = (dcaLogEntry.TotalCost == 0.0) || (dcaLogEntry.AverageBuyPrice == 0.0);
+
+ // Render the row
+
+ // Market
@if (mps != null && (mps.ActiveSingleSettings == null || mps.ActiveSingleSettings.Count == 0)) {
}
diff --git a/Monitor/Pages/_get/DashboardTop.cshtml b/Monitor/Pages/_get/DashboardTop.cshtml
index 527dba2..6b746d4 100644
--- a/Monitor/Pages/_get/DashboardTop.cshtml
+++ b/Monitor/Pages/_get/DashboardTop.cshtml
@@ -93,6 +93,7 @@
@dcaLogEntry.Market
} else {
@dcaLogEntry.Market
}
- @Html.Raw(@dcaLogEntry.TotalCost.ToString("#,#0.00000000", new System.Globalization.CultureInfo("en-US")) + "(" + Model.MainFiatCurrencySymbol + currentFiatValue.ToString("#,#0.00", new System.Globalization.CultureInfo("en-US")) + ")")
+
+ // Value
+ @Html.Raw(@dcaLogEntry.TotalCost.ToString("#,#0.00000000", new System.Globalization.CultureInfo("en-US")) + " (" + Model.MainFiatCurrencySymbol + currentFiatValue.ToString("#,#0.00", new System.Globalization.CultureInfo("en-US")) + ")")
+
+ // DCA level
@if (dcaLogEntry.BoughtTimes > 0) {
@dcaLogEntry.BoughtTimes;
}
+
+ // Buy strats
@if (buyDisabled) {
@Html.Raw(buyStrategyText)
} else {
@Html.Raw(buyStrategyText)
}
+
+ // BS Value
@if (!buyDisabled) {
@Html.Raw(currentBuyValueText)
}
+
+ // BS Trigger
@if (!buyDisabled && dcaLogEntry.BoughtTimes < Model.Summary.DCALevels) {
@Html.Raw(triggerBuyValueText)
} else {
@@ -106,13 +123,29 @@
Disabled!
}
}
- @dcaLogEntry.ProfitPercent.ToString("#,#0.00", new System.Globalization.CultureInfo("en-US"))%
+
+ // Percent
+ @if(!@lostValue)
+ {
+ @dcaLogEntry.ProfitPercent.ToString("#,#0.00", new System.Globalization.CultureInfo("en-US"))%
+ }
+ else
+ {
+ No Value!
+ }
+
+ // Sell Strats
@Html.Raw(sellStrategyText)
+
+ // SST
@Html.Raw(triggerSellValueText)
+
+ // Bid and avg price
@dcaLogEntry.CurrentPrice.ToString("#,#0.00000000", new System.Globalization.CultureInfo("en-US"))
+ // Details
@dcaLogEntry.AverageBuyPrice.ToString("#,#0.00000000", new System.Globalization.CultureInfo("en-US"))Details