Guest User

Untitled

a guest
Oct 21st, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.12 KB | None | 0 0
  1. #I @"C:\Program Files (x86)\BeloSoft\Bfexplorer\"
  2.  
  3. #r "BeloSoft.Data.dll"
  4. #r "BeloSoft.Bfexplorer.Domain.dll"
  5. #r "BeloSoft.Bfexplorer.Service.Core.dll"
  6.  
  7. open System
  8. open BeloSoft.Data
  9. open BeloSoft.Bfexplorer.Domain
  10. open BeloSoft.Bfexplorer.Service
  11.  
  12. //let bfexplorer = nil<IBfexplorerConsole>
  13.  
  14. let reportMarketSelectionData (market : Market, selection : Selection) =
  15. printfn "%s - %s: %.2f" market.MarketFullName selection.Name selection.LastPriceTraded
  16.  
  17. let isMyFootballMatchOddsMarket (market : Market) =
  18. let homeTeamSelection = market.Selections.[0]
  19.  
  20. reportMarketSelectionData (market, homeTeamSelection)
  21.  
  22. homeTeamSelection.LastPriceTraded <= 1.8
  23.  
  24. let isMyFootballOverUnderMarket (market : Market) =
  25. let overSelection = market.Selections.[1]
  26.  
  27. reportMarketSelectionData (market, overSelection)
  28.  
  29. overSelection.LastPriceTraded >= 1.5
  30.  
  31. async {
  32. let! result = bfexplorer.OpenMyFavouriteBetEvent("Football - Top Leagues")
  33.  
  34. if result.IsSuccessResult
  35. then
  36. let today = DateTime.Today
  37.  
  38. let marketInfos =
  39. bfexplorer.BetEventBrowserMarketCatalogs
  40. |> List.filter (fun marketCatalog -> marketCatalog.MarketInfo.StartTime.Date = today)
  41. |> List.map (fun marketCatalog -> marketCatalog.MarketInfo)
  42.  
  43. let! resultMyMarkets = bfexplorer.GetMyMarkets(marketInfos)
  44.  
  45. match resultMyMarkets with
  46. | DataResult.Success markets ->
  47.  
  48. for market in markets do
  49. if isMyFootballMatchOddsMarket market
  50. then
  51. let! resultAssociatedMarkets = bfexplorer.GetMyAssociatedMarkets(market.MarketInfo, [| "OVER_UNDER_25" |])
  52.  
  53. if resultAssociatedMarkets.IsSuccessResult
  54. then
  55. let marketOverUnder = resultAssociatedMarkets.SuccessResult.Head
  56.  
  57. if isMyFootballOverUnderMarket marketOverUnder
  58. then
  59. bfexplorer.OpenMyMarkets([ market; marketOverUnder ])
  60.  
  61. | DataResult.Failure errorMessage -> printfn "%s" errorMessage
  62. else
  63. printfn "%s" result.FailureMessage
  64. }
  65. |> Async.RunSynchronously
Add Comment
Please, Sign In to add comment