The martingale bot

I realy like the martingale bot (Bfexplorer.Scripting.BetOnFavouriteStopAtProfitLookUpBot), but I would like to use it by a market criteria, for example (BackBookValue<102%). Is it possible to use "my bot" maybe you can show an exaple how to do that.

The martingale only take the favorite, I would like to set up for a specific selection (1 or 2)

/Mattias

Comments (3)

  1. StefanBelo Says:
    Wednesday, February 10, 2010

    The Bfexplorer.Scripting.BetOnFavouriteStopAtProfitLookUpBot bot is LookUpBot script and you can run it only by using the Trader opportunity lookup tool (TOL).

    The action bot script, so any custom bot script ending with Bot in the name like: Bfexplorer.Scripting.DutchRunnersInOddsRangeBot can be executed by the tool: Bot Executor what means that such bot could use market or selection criteria as additional parameters, and can be used by TOL as well.

    In this case you can set your parameter: BackBookValue<102% using the market criteria, but such bot will not be able to use money management system required to run any martingale strategy. The money management system is available only for LookUpBot or any bespoke solution we build. If you want to change behavior of this bot: Bfexplorer.Scripting.BetOnFavouriteStopAtProfitLookUpBot, you have to change the source code adding your additional criteria evaluation.

    To retrieve back book value use following code:

    float backBookValue = 
            monitoredMarket.MarketDetails.BackBookValue ?? float.MaxValue;
    
  2. MatteL Says:
    Wednesday, February 10, 2010

    Stefan, thanks for support!

    I implemented the code (line) you proposed and also an and-condition as shown below, seems to work.

    This bot is betting on the favorite,if I would like it to bet on a apecific selection for example on selection 2 in a soccer game (not the second favorite) I suppose the source code could be modified, can you show the line.

    Mattias

     

    /// <returns></returns>

    private Runner GetRunnerToBet(MonitoredMarket monitoredMarket)

    {

    runnersSortedCollection.Initialize(monitoredMarket);

    float backBookValue = monitoredMarket.MarketDetails.BackBookValue ?? float.MaxValue;

    Runner runnerFavourite = runnersSortedCollection[0];

    BetPrice betPrice = runnerFavourite.BestPriceToBack;

    if (betPrice != null)

    {

    double odds = betPrice.Price;

    if (odds >= MinOddsToBack && odds <= MaxOddsToBack && backBookValue < 102)

    {

    return runnerFavourite;

  3. StefanBelo Says:
    Thursday, February 11, 2010

    Footbal martingale betfair bot

    If you want to change functionality of your bot script it is a good idea to change the bot script name and name it appropriately. The bot script file name has to be the same as the full class name.

    If you want to place your bet on particular selection, so in your case on away team on a football (soccer) match odds market, you do not need to sort selections, so you do not need the object:

    private RunnersSortedCollection runnersSortedCollection

    Remove it from the betfair bot source code, and of course all references:

    runnersSortedCollection.Initialize(monitoredMarket); 
    Runner runnerFavourite = runnersSortedCollection[0];

    to get selection data for the away team use the following code:

    Runner runner = monitoredMarket.MarketDetails.Runners[1];

    In the C# is array indexed from 0, so index 1 will get you 2nd selection.


Do you want to comment this article? Sign up here or login.