-
Notifications
You must be signed in to change notification settings - Fork 459
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Math for expected value of bet. Need to implement * Added research to notes * Updated notes * Working ev with updated readme
- Loading branch information
Showing
13 changed files
with
102 additions
and
8 deletions.
There are no files selected for viewing
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import unittest | ||
from src.Utils import Expected_Value | ||
|
||
|
||
class TestExpectedValue(unittest.TestCase): | ||
|
||
def test_expected_value_1(self): | ||
result = Expected_Value.expected_value(.76, -200) | ||
self.assertEqual(result, 14) | ||
|
||
def test_expected_value_2(self): | ||
result = Expected_Value.expected_value(.3, -500) | ||
self.assertEqual(result, -64) | ||
|
||
def test_expected_value_3(self): | ||
result = Expected_Value.expected_value(.6, 250) | ||
self.assertEqual(result, 110) | ||
|
||
def test_expected_value_4(self): | ||
result = Expected_Value.expected_value(.2, -200) | ||
self.assertEqual(result, -70) | ||
|
||
def test_expected_value_5(self): | ||
result = Expected_Value.expected_value(.8137, -200) | ||
self.assertEqual(result, 22.05) | ||
|
||
def test_expected_value_6(self): | ||
result = Expected_Value.expected_value(.2175, -550) | ||
self.assertEqual(result, -74.30) | ||
|
||
def test_expected_value_7(self): | ||
result = Expected_Value.expected_value(.5298, 1000) | ||
self.assertEqual(result, 482.78) | ||
|
||
def test_expected_value_8(self): | ||
result = Expected_Value.expected_value(.638, 275) | ||
self.assertEqual(result, 139.25) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
def expected_value(Pwin, odds): | ||
Ploss = 1 - Pwin | ||
Mwin = payout(odds) | ||
return round((Pwin * Mwin) - (Ploss * 100), 2) | ||
|
||
|
||
def payout(odds): | ||
if odds > 0: | ||
return odds | ||
else: | ||
return (100 / (-1 * odds)) * 100 |