Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
#I @"C:\Program Files (x86)\BeloSoft\Bfexplorer\"
#r "BeloSoft.Data.dll"
#r "BeloSoft.Bfexplorer.Domain.dll"
#r "BeloSoft.Bfexplorer.Service.Core.dll"
open System
open BeloSoft.Data
open BeloSoft.Bfexplorer.Domain
open BeloSoft.Bfexplorer.Service
//let bfexplorer = nil<IBfexplorerConsole>
let reportMarketSelectionData (market : Market, selection : Selection) =
printfn "%s - %s: %.2f" market.MarketFullName selection.Name selection.LastPriceTraded
let isMyFootballMatchOddsMarket (market : Market) =
let homeTeamSelection = market.Selections.[0]
reportMarketSelectionData (market, homeTeamSelection)
homeTeamSelection.LastPriceTraded <= 1.8
let isMyFootballOverUnderMarket (market : Market) =
let overSelection = market.Selections.[1]
reportMarketSelectionData (market, overSelection)
overSelection.LastPriceTraded >= 1.5
async {
let! result = bfexplorer.OpenMyFavouriteBetEvent("Football - Top Leagues")
if result.IsSuccessResult
let today = DateTime.Today
let marketInfos =
|> List.filter (fun marketCatalog -> marketCatalog.MarketInfo.StartTime.Date = today)
|> (fun marketCatalog -> marketCatalog.MarketInfo)
let! resultMyMarkets = bfexplorer.GetMyMarkets(marketInfos)
match resultMyMarkets with
| DataResult.Success markets ->
for market in markets do
if isMyFootballMatchOddsMarket market
let! resultAssociatedMarkets = bfexplorer.GetMyAssociatedMarkets(market.MarketInfo, [| "OVER_UNDER_25" |])
if resultAssociatedMarkets.IsSuccessResult
let marketOverUnder = resultAssociatedMarkets.SuccessResult.Head
if isMyFootballOverUnderMarket marketOverUnder
bfexplorer.OpenMyMarkets([ market; marketOverUnder ])
| DataResult.Failure errorMessage -> printfn "%s" errorMessage
printfn "%s" result.FailureMessage
|> Async.RunSynchronously
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.