{"id":828,"date":"2022-07-30T07:52:58","date_gmt":"2022-07-30T07:52:58","guid":{"rendered":"https:\/\/giuliopulino.com\/?p=828"},"modified":"2022-07-30T12:21:31","modified_gmt":"2022-07-30T12:21:31","slug":"tennis-analysis","status":"publish","type":"post","link":"https:\/\/giuliopulino.com\/index.php\/2022\/07\/30\/tennis-analysis\/","title":{"rendered":"Tennis Analysis"},"content":{"rendered":"\n<p>As Sport Trader, one of the most common question that I receive from friends is &#8221; What is the best strategy to win by betting? &#8221; and the most popular is the one that betting always on the favorite player can guarantee a profit.<\/p>\n\n\n\n<p>Let&#8217;s demonstrate with data if this strategy is profitable, so next time that I receive this question I can direct them to this page.<\/p>\n\n\n\n<p>For those who are new to the world of betting let&#8217;s do a quick example:<\/p>\n\n\n\n<p>We have a Tennis match, Federer vs Cecchinato.<\/p>\n\n\n\n<p>Let\u2019s say you bet 10\u20ac on Federer with an odd of 1.1<\/p>\n\n\n\n<ul><li>If he wins, you have back your 10\u20ac, plus 1\u20ac of profit<\/li><li>If he loses you\u2019ll return will be 0\u20ac<\/li><\/ul>\n\n\n\n<ul><li>If he wins, as you bet 10\u20ac and won 11\u20ac, your ROI (return on investment) is 10%<\/li><li>If he loses, your ROI is -100%<\/li><\/ul>\n\n\n\n<p><\/p>\n\n\n\n<p>If you place 10 bets of 10<strong>\u20ac<\/strong> each at an odd of 1.10, the total stake will be 100<strong>\u20ac<\/strong>, the return 110<strong>\u20ac<\/strong>(including the stake), so the profit will be 10<strong>\u20ac<\/strong>.<\/p>\n\n\n\n<p>If you just lose 1 of these 10 bets, you&#8217;ll return including the stake will be 99<strong>\u20ac<\/strong>, a loss of 1<strong>\u20ac<\/strong>. If you lose 2 bets, you&#8217;ll return including stake will be 88<strong>\u20ac<\/strong>, a loss of 11<strong>\u20ac<\/strong>.<\/p>\n\n\n\n<p>So you need to win several bets in order to guarantee you a profit.<\/p>\n\n\n\n<p>Is it really sustainable?<\/p>\n\n\n\n<p><strong>Dataset<\/strong><\/p>\n\n\n\n<p>Dataset source:&nbsp;<a href=\"http:\/\/tennis-data.co.uk\/data.php\" target=\"_blank\" rel=\"noreferrer noopener\">http:\/\/tennis-data.co.uk\/data.php<\/a><\/p>\n\n\n\n<p>I used all ATP MATCHES from 2010 to 2021, in the dataset we have a lot of interesting data such as tournament names, players, odds, etc.<\/p>\n\n\n\n<p>Our focus will be on analyzing the possible strategies to make a profit.<\/p>\n\n\n\n<p><strong>Data Cleaning<\/strong><\/p>\n\n\n\n<p>I combined all tables in a single one with the UNION ALL query, I checked for incorrect data, mispelling, duplicate, format date, etc.<\/p>\n\n\n\n<p>The dataset, processes of data cleaning and analysis are available on GitHub: LINK<\/p>\n\n\n\n<p>The entire process of data cleaning and analysis is available on GitHub <a href=\"https:\/\/github.com\/giuliopulino\/tennis-analysis\/tree\/main\" target=\"_blank\" rel=\"noopener\"> View on GitHub <\/a><\/p>\n\n\n\n<p><strong>Analysis<\/strong><\/p>\n\n\n\n<p>OBJECTIVE: Answer the question \u201d Is it profitable bets always on the favorite player? \u201c<\/p>\n\n\n\n<p>In order to answer this question we have to decide on some strategies to apply:<\/p>\n\n\n\n<p>STRATEGY 1: bets always on the favorite player with an odd &lt;= 1.30<\/p>\n\n\n\n<p>STRATEGY 2: bets always on the favorite player with an odd &lt;= 1.10<\/p>\n\n\n\n<p>STRATEGY 3: bets always on the favorite player (by odds) no matter what are the odds<\/p>\n\n\n\n<p>STRATEGY 4: bets always on the top10 ranking players when they are playing versus a player who is in ranking in 20th position or more<\/p>\n\n\n\n<p>Let&#8217;s Start !!<\/p>\n\n\n\n<p>Before applying our strategies, let\u2019s calculate the total number of matches and which bookmaker offer us the best profit.<\/p>\n\n\n\n<p>Calculate the total number of matches:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: sql; title: ; notranslate\" title=\"\">\nSELECT COUNT(*) AS total_matches\nFROM atp_matches;\n<\/pre><\/div>\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" width=\"294\" height=\"102\" src=\"https:\/\/giuliopulino.com\/wp-content\/uploads\/2022\/07\/Schermata-2022-07-30-alle-09.58.45.png\" alt=\"\" class=\"wp-image-833\"\/><\/figure>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity is-style-wide\"\/>\n\n\n\n<p>In the dataset, we have the odds from 2 different bookmakers, BET365 and PINNACLE. We want to know which bookmaker offers us the best odds, so we can check who offers the best margin.<\/p>\n\n\n\n<p>Calculate who offer the best margin:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: sql; title: ; notranslate\" title=\"\">\nSELECT\n\tROUND(AVG((100 \/ B365W) + (100 \/ B365L)),2) AS bet365_margin,\n    ROUND(AVG((100 \/ PSW) + (100 \/ PSL)),2) AS pinnacle_margin\nFROM atp_matches;\n<\/pre><\/div>\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" width=\"490\" height=\"102\" src=\"https:\/\/giuliopulino.com\/wp-content\/uploads\/2022\/07\/Schermata-2022-07-30-alle-10.01.30.png\" alt=\"\" class=\"wp-image-836\" srcset=\"https:\/\/giuliopulino.com\/wp-content\/uploads\/2022\/07\/Schermata-2022-07-30-alle-10.01.30.png 490w, https:\/\/giuliopulino.com\/wp-content\/uploads\/2022\/07\/Schermata-2022-07-30-alle-10.01.30-300x62.png 300w\" sizes=\"(max-width: 490px) 100vw, 490px\" \/><\/figure>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity is-style-wide\"\/>\n\n\n\n<p>More the margin is small, more are the profits, if we imagine that we know who is the winner of the match in advance and we bet always on the winner player, we can see the Pinnacle offers us the best ROI.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: sql; title: ; notranslate\" title=\"\">\nSELECT\n\tROUND(SUM(10 * B365W),2) AS bet365_winnings,\n    ROUND(SUM(10 * PSW),2) AS pinnacle_winnings\nFROM atp_matches;\n<\/pre><\/div>\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" width=\"490\" height=\"102\" src=\"https:\/\/giuliopulino.com\/wp-content\/uploads\/2022\/07\/Schermata-2022-07-30-alle-10.16.42.png\" alt=\"\" class=\"wp-image-839\" srcset=\"https:\/\/giuliopulino.com\/wp-content\/uploads\/2022\/07\/Schermata-2022-07-30-alle-10.16.42.png 490w, https:\/\/giuliopulino.com\/wp-content\/uploads\/2022\/07\/Schermata-2022-07-30-alle-10.16.42-300x62.png 300w\" sizes=\"(max-width: 490px) 100vw, 490px\" \/><\/figure>\n\n\n\n<p>Pinnacle offers us the best return, so we&#8217;ll use it for our analysis.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity is-style-wide\"\/>\n\n\n\n<p>STRATEGY 1: bets always on the favorite player with an odd &lt;= 1.30<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: sql; title: ; notranslate\" title=\"\">\nSELECT\n\t10 * COUNT(CASE WHEN PSW &lt;= 1.30 OR PSL &lt;= 1.30 THEN 1 ELSE NULL END) AS total_stake,\n    ROUND(SUM(CASE WHEN PSW &lt;= 1.30 THEN 10 * PSW ELSE NULL END),2) AS total_winnings,\n    ROUND(SUM(CASE WHEN PSW &lt;= 1.30 THEN 10 * PSW ELSE NULL END),2) - (10 * COUNT(CASE WHEN PSW &lt;= 1.30 OR PSL &lt;= 1.30 THEN 1 ELSE NULL END)) AS profit\nFROM atp_matches;\n<\/pre><\/div>\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" width=\"490\" height=\"102\" src=\"https:\/\/giuliopulino.com\/wp-content\/uploads\/2022\/07\/Schermata-2022-07-30-alle-10.18.27.png\" alt=\"\" class=\"wp-image-842\" srcset=\"https:\/\/giuliopulino.com\/wp-content\/uploads\/2022\/07\/Schermata-2022-07-30-alle-10.18.27.png 490w, https:\/\/giuliopulino.com\/wp-content\/uploads\/2022\/07\/Schermata-2022-07-30-alle-10.18.27-300x62.png 300w\" sizes=\"(max-width: 490px) 100vw, 490px\" \/><\/figure>\n\n\n\n<p>Grouping by year<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: sql; title: ; notranslate\" title=\"\">\nSELECT\n    YEAR(match_date) AS yr,\n    10 * COUNT(CASE WHEN PSW &lt;= 1.30 OR PSL &lt;= 1.30 THEN 1 ELSE NULL END) AS total_stake,\n    ROUND(SUM(CASE WHEN PSW &lt;= 1.30 THEN 10 * PSW ELSE NULL END),2) AS total_winnings,\n    ROUND(SUM(CASE WHEN PSW &lt;= 1.30 THEN 10 * PSW ELSE NULL END),2) - (10 * COUNT(CASE WHEN PSW &lt;= 1.30 OR PSL &lt;= 1.30 THEN 1 ELSE NULL END)) AS profit\nFROM atp_matches\nGROUP BY 1\nORDER BY 1 DESC;\n<\/pre><\/div>\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" width=\"490\" height=\"462\" src=\"https:\/\/giuliopulino.com\/wp-content\/uploads\/2022\/07\/Schermata-2022-07-30-alle-10.42.23.png\" alt=\"\" class=\"wp-image-843\" srcset=\"https:\/\/giuliopulino.com\/wp-content\/uploads\/2022\/07\/Schermata-2022-07-30-alle-10.42.23.png 490w, https:\/\/giuliopulino.com\/wp-content\/uploads\/2022\/07\/Schermata-2022-07-30-alle-10.42.23-300x283.png 300w\" sizes=\"(max-width: 490px) 100vw, 490px\" \/><\/figure>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity is-style-wide\"\/>\n\n\n\n<p>STRATEGY 2: bets always on the favorite player with an odd &lt;= 1.10, the query it\u2019s the same as above, we have only to change all values of 1.30 with 1.10<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: sql; title: ; notranslate\" title=\"\">\nSELECT\n\t10 * COUNT(CASE WHEN PSW &lt;= 1.10 OR PSL &lt;= 1.10 THEN 1 ELSE NULL END) AS total_stake,\n    ROUND(SUM(CASE WHEN PSW &lt;= 1.10 THEN 10 * PSW ELSE NULL END),2) AS total_winnings,\n    ROUND(SUM(CASE WHEN PSW &lt;= 1.10 THEN 10 * PSW ELSE NULL END) - (10 * COUNT(CASE WHEN PSW &lt;= 1.10 OR PSL &lt;= 1.10 THEN 1 ELSE NULL END)),2) AS profit\nFROM atp_matches;\n<\/pre><\/div>\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" width=\"490\" height=\"120\" src=\"https:\/\/giuliopulino.com\/wp-content\/uploads\/2022\/07\/Schermata-2022-07-30-alle-10.45.06.png\" alt=\"\" class=\"wp-image-844\" srcset=\"https:\/\/giuliopulino.com\/wp-content\/uploads\/2022\/07\/Schermata-2022-07-30-alle-10.45.06.png 490w, https:\/\/giuliopulino.com\/wp-content\/uploads\/2022\/07\/Schermata-2022-07-30-alle-10.45.06-300x73.png 300w\" sizes=\"(max-width: 490px) 100vw, 490px\" \/><\/figure>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity is-style-wide\"\/>\n\n\n\n<p>STRATEGY 3: bets always on the favorite player (by odds) no matter what are the odds<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: sql; title: ; notranslate\" title=\"\">\nSELECT\n\t10 * COUNT(CASE WHEN PSW &lt; PSL OR PSL &lt; PSW THEN 1 ELSE NULL END) AS total_stake,\n    ROUND(SUM(CASE WHEN PSW &lt; PSL THEN 10 * PSW ELSE NULL END),2) AS winnings,\n    ROUND(SUM(CASE WHEN PSW &lt; PSL THEN 10 * PSW ELSE NULL END) - 10 * COUNT(CASE WHEN PSW &lt; PSL OR PSL &lt; PSW THEN 1 ELSE NULL END),2) AS profit\nFROM atp_matches;\n<\/pre><\/div>\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" width=\"490\" height=\"120\" src=\"https:\/\/giuliopulino.com\/wp-content\/uploads\/2022\/07\/Schermata-2022-07-30-alle-10.46.42.png\" alt=\"\" class=\"wp-image-845\" srcset=\"https:\/\/giuliopulino.com\/wp-content\/uploads\/2022\/07\/Schermata-2022-07-30-alle-10.46.42.png 490w, https:\/\/giuliopulino.com\/wp-content\/uploads\/2022\/07\/Schermata-2022-07-30-alle-10.46.42-300x73.png 300w\" sizes=\"(max-width: 490px) 100vw, 490px\" \/><\/figure>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity is-style-wide\"\/>\n\n\n\n<p>STRATEGY 4: bets always on the top10 ranking players when they are playing versus a player who is in ranking in 20th position or more<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: sql; title: ; notranslate\" title=\"\">\nSELECT\n\t10 * COUNT(CASE WHEN (WRank &lt;= 10 AND LRank &gt;= 20) OR (WRank &gt;= 20 AND LRank &lt;= 10) THEN 1 ELSE NULL END) AS total_stake,\n    ROUND(SUM(CASE WHEN WRank &lt;= 10 AND LRank &gt;= 20 THEN 10 * PSW ELSE NULL END),2) AS total_winnings,\n    ROUND(SUM(CASE WHEN WRank &lt;= 10 AND LRank &gt;= 20 THEN 10 * PSW ELSE NULL END)\n\t\t- 10 * COUNT(CASE WHEN (WRank &lt;= 10 AND LRank &gt;= 20) OR (WRank &gt;= 20 AND LRank &lt;= 10) THEN 1 ELSE NULL END),2) AS profit\nFROM atp_matches;\n<\/pre><\/div>\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" width=\"490\" height=\"120\" src=\"https:\/\/giuliopulino.com\/wp-content\/uploads\/2022\/07\/Schermata-2022-07-30-alle-10.56.23.png\" alt=\"\" class=\"wp-image-848\" srcset=\"https:\/\/giuliopulino.com\/wp-content\/uploads\/2022\/07\/Schermata-2022-07-30-alle-10.56.23.png 490w, https:\/\/giuliopulino.com\/wp-content\/uploads\/2022\/07\/Schermata-2022-07-30-alle-10.56.23-300x73.png 300w\" sizes=\"(max-width: 490px) 100vw, 490px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p>Unfortunately for some players, the strategy to bet always on the favorite player is not profitable.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>Thanks for your time.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>Giulio Pulino.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>As Sport Trader, one of the most common question that I receive from friends is &#8221; What is the best strategy to win by betting? &#8221; and the most popular is the one that betting always on the favorite player can guarantee a profit. Let&#8217;s demonstrate with data if this strategy is profitable, so next &hellip;<\/p>\n<p class=\"read-more\"> <a class=\"\" href=\"https:\/\/giuliopulino.com\/index.php\/2022\/07\/30\/tennis-analysis\/\"> <span class=\"screen-reader-text\">Tennis Analysis<\/span> Read More &raquo;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"site-sidebar-layout":"default","site-content-layout":"default","ast-global-header-display":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":""},"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/giuliopulino.com\/index.php\/wp-json\/wp\/v2\/posts\/828"}],"collection":[{"href":"https:\/\/giuliopulino.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/giuliopulino.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/giuliopulino.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/giuliopulino.com\/index.php\/wp-json\/wp\/v2\/comments?post=828"}],"version-history":[{"count":15,"href":"https:\/\/giuliopulino.com\/index.php\/wp-json\/wp\/v2\/posts\/828\/revisions"}],"predecessor-version":[{"id":903,"href":"https:\/\/giuliopulino.com\/index.php\/wp-json\/wp\/v2\/posts\/828\/revisions\/903"}],"wp:attachment":[{"href":"https:\/\/giuliopulino.com\/index.php\/wp-json\/wp\/v2\/media?parent=828"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/giuliopulino.com\/index.php\/wp-json\/wp\/v2\/categories?post=828"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/giuliopulino.com\/index.php\/wp-json\/wp\/v2\/tags?post=828"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}