Get overall results and post the photo

This commit is contained in:
derek.holloway
2026-03-12 14:06:31 -07:00
parent aca85ce4d8
commit b6a37681ba
3 changed files with 13 additions and 3 deletions
Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

+1 -1
View File
@@ -207,7 +207,7 @@
async Task RunTest(){ async Task RunTest(){
D683_Project_Test tests = new D683_Project_Test(aiModule); D683_Project_Test tests = new D683_Project_Test(aiModule);
float score = await tests.Simulate(); float score = await tests.Simulate();
TestResults = "Performance [measured in dollars difference from starting money]: " + score.ToString(); TestResults = $"The amount of money the AI did better than the SPY: ${score} or { score / 10 }% better";
} }
} }
+12 -2
View File
@@ -108,8 +108,18 @@ namespace Controllers.ProjectTest {
next:; next:;
} }
// Return a score [Bigger than 0 is money earned] or [Less than 0 is money lost] // Get price of SPY starting and end
return Money - StartingMoney; float SPYbegin = _aiModule.GetCurrentPrice( "SPY", 30 );
float SPYend = _aiModule.GetCurrentPrice( "SPY" );
// Get max quantity for the amount of money given
int SPYQty = (int)( StartingMoney / SPYbegin );
// Calculate how much money you would end with if just stayed in the normal S&P500
float earned = StartingMoney / SPYbegin * SPYend;
// Return the difference between the AI and the SPY -> if value returned is 10. The AI did better than the SPY by $10
return Money - earned;
} }