-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Emil Koutanov
committed
Jan 18, 2024
1 parent
d8103f1
commit 21b2310
Showing
1 changed file
with
25 additions
and
1 deletion.
There are no files selected for viewing
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 |
---|---|---|
@@ -1,3 +1,27 @@ | ||
`overround-methods` | ||
=== | ||
A collection of overround application methods. | ||
[![Build Status](https://img.shields.io/github/actions/workflow/status/kindredgroup/overround-methods/master.yml?branch=master&style=flat-square&logo=github)](https://github.com/kindredgroup/overround-methods/actions/workflows/dotnet.yml) | ||
|
||
A collection of overround application methods. | ||
|
||
# Examples | ||
```csharp | ||
using Overround; | ||
|
||
double[] fairPrices = [1 / 0.1, 1 / 0.2, 1 / 0.3, 1 / 0.4]; | ||
double fairBooksum = Booksum.FromPrices(fairPrices); | ||
Console.WriteLine("fair prices: [{0}]", string.Join(", ", fairPrices)); | ||
Console.WriteLine("fair booksum: {0}", fairBooksum); | ||
|
||
double idealOverround = 1.15; | ||
Console.WriteLine("ideal overround: {0}", idealOverround); | ||
|
||
IOverroundMethod[] methods = [new Multiplicative(), new Additive(), new Power(), new OddsRatio()]; | ||
foreach (var method in methods) | ||
{ | ||
double[] odds = method.Apply(fairPrices, idealOverround); | ||
Console.WriteLine(""); | ||
Console.WriteLine("method: {0}", method.GetType().Name); | ||
Console.WriteLine("odds: [{0}]", string.Join(", ", odds)); | ||
} | ||
``` |