Пример #1
0
        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));
        }
Пример #2
0
        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);
        }
Пример #3
0
 public FixtureAndBettingData(Fixture fixture, MatchBettingData betting)
 {
     Fixture     = fixture;
     BettingData = betting;
 }