B4. Plus the previous commit. Evaluate the algorithm
This commit is contained in:
@@ -40,19 +40,37 @@
|
||||
</div>
|
||||
|
||||
<!-- Tool Frame -->
|
||||
<div>
|
||||
<div class="gridFrame">
|
||||
<div>
|
||||
<div><h2>Actions</h2></div>
|
||||
<div>
|
||||
<input placeholder="Stock Symbol [NVDA]" @bind="addStockSymbol" />
|
||||
<button @onclick="addStock">Add To Tracked Stocks</button>
|
||||
<div>
|
||||
<input placeholder="Stock Symbol [NVDA]" @bind="addStockSymbol" />
|
||||
<button @onclick="addStock">Add To Watched Stocks</button>
|
||||
</div>
|
||||
<br />
|
||||
<div>
|
||||
<button @onclick="RunTest">Run 1Mo Evaluation</button>
|
||||
<br />
|
||||
<span>@TestResults</span>
|
||||
</div>
|
||||
<span>@resultError</span>
|
||||
</div>
|
||||
<br />
|
||||
</div>
|
||||
<!-- Tracked Stocks -->
|
||||
<div style="margin-top: 20px;" class="gridFrame">
|
||||
<div>
|
||||
<button @onclick="RunTest">Run 1Mo Test</button>
|
||||
<span>@TestResults</span>
|
||||
<h2>Watched Stocks</h2>
|
||||
</div>
|
||||
<div style="column-count: 2;">
|
||||
@foreach (Stock cur in Session.TrackedStocks){
|
||||
<div class="signalBlock">
|
||||
<p style="text-align: center; font-weight: bold;">@cur.Symbol</p>
|
||||
<p>AI Predicted Score: @cur.Score</p>
|
||||
<button @onclick="() => {removeStock(cur);}">Remove</button>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
<span>@resultError</span>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
@@ -60,23 +78,10 @@
|
||||
<!-- AI Frame -->
|
||||
@if (Session != null){
|
||||
<div>
|
||||
<!-- Tracked Stocks -->
|
||||
<div class="gridFrame">
|
||||
<div>
|
||||
<h2>Current Signal</h2>
|
||||
</div>
|
||||
@foreach (Stock cur in Session.TrackedStocks){
|
||||
<div class="signalBlock">
|
||||
<p style="text-align: center; font-weight: bold;">@cur.Symbol</p>
|
||||
<p>AI Predicted Score: @cur.Score</p>
|
||||
<button @onclick="() => {removeStock(cur);}">Remove</button>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
<!-- Trade History -->
|
||||
<div class="gridFrame">
|
||||
<div>
|
||||
<h2>Trade History</h2>
|
||||
<h2>Auto Trade History</h2>
|
||||
</div>
|
||||
@foreach (PurchasedStock cur in Session.TradeHistory){
|
||||
<div class="signalBlock">
|
||||
@@ -205,8 +210,15 @@
|
||||
|
||||
string TestResults = "";
|
||||
async Task RunTest(){
|
||||
|
||||
// Make sure a session exists
|
||||
if (Session == null){
|
||||
return;
|
||||
}
|
||||
|
||||
// Simulate 1 month
|
||||
D683_Project_Test tests = new D683_Project_Test(aiModule);
|
||||
float score = await tests.Simulate();
|
||||
float score = await tests.Simulate(Session.TrackedStocks);
|
||||
TestResults = $"The amount of money the AI did better than the SPY: ${score} or { score / 10 }% better";
|
||||
}
|
||||
|
||||
|
||||
@@ -62,25 +62,36 @@
|
||||
|
||||
.signalBlock {
|
||||
display: flex;
|
||||
width: min-content;
|
||||
margin-top: 5px;;
|
||||
}
|
||||
|
||||
.signalBlock > :nth-child(1) {
|
||||
border: solid #040 1px;
|
||||
border-radius: 15px;
|
||||
padding: 0px 20px;
|
||||
padding: 5px 20px;
|
||||
background-color: greenyellow;
|
||||
align-self: center;
|
||||
margin: 0;
|
||||
width: 100px;
|
||||
}
|
||||
|
||||
.signalBlock > :nth-child(2) {
|
||||
padding: 0 30px;
|
||||
font-size: 30px;
|
||||
align-content: center;
|
||||
margin: 0;
|
||||
text-wrap: nowrap;
|
||||
}
|
||||
|
||||
.signalBlock > :nth-child(3) {
|
||||
color: white;
|
||||
padding: 0 30px;
|
||||
width: 40px;
|
||||
padding: 10px 30px;
|
||||
border: solid #000 1px;
|
||||
border-radius: 15px;
|
||||
}
|
||||
background-color: #F44;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.signalBlock > :nth-child(3):hover {
|
||||
background-color: #f00;
|
||||
}
|
||||
Reference in New Issue
Block a user