Skip to content

Instantly share code, notes, and snippets.

@StefanBelo
Created August 16, 2019 12:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save StefanBelo/50186494957fa8a1a154866a7319d5e0 to your computer and use it in GitHub Desktop.
Save StefanBelo/50186494957fa8a1a154866a7319d5e0 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.Bfexplorer.Domain.dll"
#r "BeloSoft.Bfexplorer.Trading.dll"
#r "BeloSoft.Bfexplorer.Service.Core.dll"
//*)
open BeloSoft.Bfexplorer.Domain
open BeloSoft.Bfexplorer.Trading
/// <summary>
/// FootballExecuteOnUnderdogBotTrigger
/// </summary>
type FootballExecuteOnUnderdogBotTrigger(market : Market, _selection : Selection, _botName : string, _botTriggerParameters : BotTriggerParameters, _myBfexplorer : IMyBfexplorer) =
let getUnderdogSelection() =
let homeTeamSelection, awayTeamSelection =
let selections = market.Selections
selections.[0], selections.[1]
if homeTeamSelection.LastPriceTraded > awayTeamSelection.LastPriceTraded
then
homeTeamSelection
else
awayTeamSelection
interface IBotTrigger with
/// <summary>
/// Execute
/// </summary>
member _this.Execute() =
if market.MarketInfo.BetEventType.Id = 1 && market.MarketDescription.MarketType = "MATCH_ODDS"
then
TriggerResult.ExecuteActionBotOnSelection (getUnderdogSelection())
else
TriggerResult.EndExecutionWithMessage "You can execute this bot only on a football market."
/// <summary>
/// EndExecution
/// </summary>
member _this.EndExecution() =
()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment