public BackedTeamData GetTeamToBack(MatchBettingData betData, double predictedScoreSpread) { double predictedVsBookScoreSpread = 0; if (predictedScoreSpread > 0 && betData.HomeSpread > 0) { predictedVsBookScoreSpread = predictedScoreSpread - betData.HomeSpread; } else if (predictedScoreSpread > 0 && betData.HomeSpread < 0) { predictedVsBookScoreSpread = predictedScoreSpread + betData.HomeSpread; } else if (predictedScoreSpread < 0 && betData.HomeSpread > 0) { predictedVsBookScoreSpread = predictedScoreSpread + betData.HomeSpread; } else if (predictedScoreSpread < 0 && betData.HomeSpread < 0) { predictedVsBookScoreSpread = predictedScoreSpread - betData.HomeSpread; } _teamToBack = predictedVsBookScoreSpread > 0 ? betData.HomeTeam : betData.AwayTeam; _swerveTeam = _teamToBack == betData.HomeTeam ? betData.AwayTeam : betData.HomeTeam; return(new BackedTeamData(_teamToBack, predictedScoreSpread, betData.HomeSpread)); }
public PredictionOutcome GetPredictionOutcome( MatchBettingData bettingData, BackedTeamData backedTeamData, double actualDelta) { var isHomeTeamTheBackedTeam = backedTeamData.BackedTeam == bettingData.HomeTeam; var predictionOutcome = PredictionOutcome.Fail; if (isHomeTeamTheBackedTeam) { if (bettingData.HomeSpread < 0 && actualDelta < 0) { predictionOutcome = PredictionOutcome.Fail; } else if (bettingData.HomeSpread < 0 && actualDelta > 0) { predictionOutcome = bettingData.HomeSpread + actualDelta > 0 ? PredictionOutcome.Success : PredictionOutcome.Fail; } else if (bettingData.HomeSpread > 0 && actualDelta < 0) { predictionOutcome = bettingData.HomeSpread + actualDelta > 0 ? PredictionOutcome.Success : PredictionOutcome.Fail; } else if (bettingData.HomeSpread > 0 && actualDelta > 0) { predictionOutcome = PredictionOutcome.Success; } } else { if (bettingData.AwaySpread < 0 && actualDelta < 0) { predictionOutcome = actualDelta - bettingData.AwaySpread < 0 ? PredictionOutcome.Success : PredictionOutcome.Fail; } else if (bettingData.AwaySpread < 0 && actualDelta > 0) { predictionOutcome = bettingData.AwaySpread + actualDelta > 0 ? PredictionOutcome.Success : PredictionOutcome.Fail; } else if (bettingData.AwaySpread > 0 && actualDelta < 0) { predictionOutcome = PredictionOutcome.Success; } else if (bettingData.AwaySpread > 0 && actualDelta > 0) { predictionOutcome = actualDelta - bettingData.AwaySpread < 0 ? PredictionOutcome.Success : PredictionOutcome.Fail; } } return(predictionOutcome); }
public FixtureAndBettingData(Fixture fixture, MatchBettingData betting) { Fixture = fixture; BettingData = betting; }