Skip to content

Instantly share code, notes, and snippets.

@StefanBelo
Created October 16, 2019 13:03
Show Gist options
  • Save StefanBelo/dd9577c2e43ff52614a710a3dfc575e4 to your computer and use it in GitHub Desktop.
Save StefanBelo/dd9577c2e43ff52614a710a3dfc575e4 to your computer and use it in GitHub Desktop.
// Bfexplorer cannot be held responsible for any losses or damages incurred during the use of this betfair bot.
// It is up to you to determine the level of risk you wish to trade under.
// Do not gamble with money you cannot afford to lose.
module BfexplorerBot
//(*
#I @"C:\Program Files (x86)\BeloSoft\Bfexplorer\"
#r "BeloSoft.Data.dll"
#r "BeloSoft.Betfair.API.dll"
#r "BeloSoft.Bfexplorer.Domain.dll"
#r "BeloSoft.Bfexplorer.Trading.dll"
#r "BeloSoft.Bfexplorer.Service.Core.dll"
//*)
open BeloSoft.Bfexplorer.Domain
open BeloSoft.Bfexplorer.Trading
/// <summary>
/// ShowOfferedPrices
/// </summary>
type ShowOfferedPrices(market : Market, selection : Selection, _botName : string, _botTriggerParameters : BotTriggerParameters, myBfexplorer : IMyBfexplorer) =
let outputMessage message =
myBfexplorer.BfexplorerService.OutputMessage(message, market.Id)
let showOfferedPrices() =
selection.PriceGridData.GetOfferedPriceData()
|> Seq.map (fun priceData ->
let offerData =
if priceData.IsBack
then
{| BetType = BetType.Back; Volume = priceData.ToBack |}
else
{| BetType = BetType.Lay; Volume = priceData.ToLay |}
sprintf "%.2f | %A | %.2f" priceData.Price offerData.BetType offerData.Volume
)
|> String.concat "\n"
|> sprintf "%s:\n%s" selection.Name
|> outputMessage
interface IBotTrigger with
/// <summary>
/// Execute
/// </summary>
member __.Execute() =
showOfferedPrices()
TriggerResult.EndExecution
/// <summary>
/// EndExecution
/// </summary>
member __.EndExecution() =
()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment