Finalize the preditctor algorithm

This commit is contained in:
derek.holloway
2026-03-12 09:35:12 -07:00
parent 8df645aac5
commit 45353b8a01
3 changed files with 30 additions and 9 deletions
+13
View File
@@ -22,6 +22,13 @@ namespace Controllers.Automation {
// Start this process on a background thread so its non-blocking
Task thread = new Task(() => {
// Check if the day is a weekend
DateTime chosenDate = DateTime.Now.AddDays(-DaysBefore);
if (chosenDate.DayOfWeek == DayOfWeek.Saturday || chosenDate.DayOfWeek == DayOfWeek.Sunday) {
// If its a weekend skip
return;
}
// Load the userlist
List<string> VerifiedUserList = new List<string>(){ "TESTMODE" };
if (!testmode) {
@@ -121,6 +128,9 @@ namespace Controllers.Automation {
// Get sell price
float sellPrice = cur.Quantity * _aiModule.GetCurrentPrice( cur.Symbol );
if (sellPrice == 0) {
return -1f;
}
// Try create payment session
(bool, string) createResult = _paymentProcessor.CreatePayment(username);
@@ -157,6 +167,9 @@ namespace Controllers.Automation {
// Get Stock Price
float stockPrice = _aiModule.GetCurrentPrice( stockSymbol );
if (stockPrice == 0) {
return -1f;
}
// Get max stocks user can purchase [ int cast truncates the decimal ]
int MaxQty = (int)( Money / stockPrice );