Add simulated stock history to UI

This commit is contained in:
derek.holloway
2026-03-13 10:35:20 -07:00
parent b6798e84f5
commit b54f4a29b7
3 changed files with 17 additions and 8 deletions
+9 -5
View File
@@ -81,14 +81,16 @@
<!-- Trade History -->
<div class="gridFrame">
<div>
<h2>Auto Trade History</h2>
<h2>@HistoryTitle</h2>
</div>
@foreach (PurchasedStock cur in Session.TradeHistory){
<div class="signalBlock">
<p style="text-align: center; font-weight: bold;">@cur.Symbol</p>
<p>Purchased Quantity: @cur.Quantity</p>
<p>Purchased Price: @cur.PurchasePrice</p>
<p>Sell Price: @cur.PurchasePrice</p>
<p>Sell Price: @cur.PurchasePrice</p><br />
<p>Buy Date: @cur.BuyDate.ToString("MM/dd/yy")</p><br />
<p>Sell Date: @cur.BuyDate.ToString("MM/dd/yy")</p>
</div>
}
</div>
@@ -105,7 +107,7 @@
loginSession? Session = null;
string resultError = "";
string HistoryTitle = "Auto Trade History";
@@ -218,8 +220,10 @@
// Simulate 1 month
D683_Project_Test tests = new D683_Project_Test(aiModule);
float score = await tests.Simulate(Session.TrackedStocks);
TestResults = $"The amount of money the AI did better than the SPY: ${score} or { score / 10 }% better";
(float, List<PurchasedStock>) score = await tests.Simulate(Session.TrackedStocks);
TestResults = $"The amount of money the AI did better than the SPY: ${score} or { score.Item1 / 10 }% better";
Session.TradeHistory = score.Item2;
HistoryTitle = "Simulated History";
}
}