public static bool isArbitrage(ref FootballMatch match) { bool v_IsArbitrage; match.FirstTeamIAP = CalculateIAP(match.FirstTeamRatio); match.SecondTeamIAP = CalculateIAP(match.SecondTeamRatio); v_IsArbitrage = (match.FirstTeamIAP + match.SecondTeamIAP) < 100; return(v_IsArbitrage); }
public async Task Execute(IJobExecutionContext context) { writeTimeAndDateToDebug(); Dictionary <string, Scraper> Scrapers = (Dictionary <string, Scraper>)context.JobDetail.JobDataMap.Get("DictOfScraper"); List <FootballMatch> footballMatchesToBetOn = new List <FootballMatch>(); foreach (Scraper scraper in Scrapers.Values) { try { scraper.LoadUrl(); List <FootballMatch> FootballMatchesFromScraper = scraper.MakeListOfDailyMatchesPlaying(); foreach (FootballMatch match in FootballMatchesFromScraper) { FootballMatch tempMatch = match; if (Arbitrager.isArbitrage(ref tempMatch) == true) { Arbitrager.GamblingRatio(ref tempMatch); tempMatch.MatchStats = scraper.StatsCollector(tempMatch.StatsUrl); footballMatchesToBetOn.Add(tempMatch); } } foreach (FootballMatch match in footballMatchesToBetOn) { Console.WriteLine(UI.ArrangeHebStringToBeHebUICustomize(" מהכסף שלך.") + match.FirstTeamGamble + " " + match.FirstTeam + UI.ArrangeHebStringToBeHebUICustomize(" מהכסף שלך, ועל הקבוצה ") + match.SecondTeamGamble + " " + match.SecondTeam + UI.ArrangeHebStringToBeHebUICustomize("תהמר על הקבוצה ")); Console.WriteLine(match.MatchStats); } // bet/send message/dont know on arbitrage game (footballMatchesToBetOn) } catch (Exception e) { Console.WriteLine(e.Message); } } }
public static void GamblingRatio(ref FootballMatch match) { match.FirstTeamGamble = match.FirstTeamIAP / (match.FirstTeamIAP + match.SecondTeamIAP); match.SecondTeamGamble = match.SecondTeamIAP / (match.FirstTeamIAP + match.SecondTeamIAP); }