Amount of money for last price traded

Hi,

On horse racing, I would like to know, how to get the amount of money already traded for the actual price (odd).

"this.runner.LastPriceMatched.Price" gives me the latest price traded. But "this.runner.LastPriceMatched.Amount" doesn't give me the money traded for this price but the money traded for this runner overall prices.

On the BetFair-Chart below the value to which the blue arrow points, is the value that I would like to get. But I get the value on which the grey arrow points:


BetFair Price/Volume Chart

Simple Scalping

Hi, I'm new to Bfexplorer, and I've tried to program a bot, but I can't match my criteria, which sound simple:

In the market of o/u 2.5 of all live football games, ask the bot to buy the under 2.5 at a maximum of @ 1.99 odds, but always one tick above of the current market's price, and then sell one tick below.

It could be applied to other market's also, but this one is the easiest, since the under 2.5 is always going down.

With such a powerfull tool, how nobody has yet talked about simple scalping? I would love to know how to build the bot criteria for this, thank you!

On Goal Back or Lay Goal Scorer

I am tring to create a bot to wait for a goal. When first goal is scored then:

- If goal scored by fav then back fav

- If goal scored by outsider then lay outsider

I am struggling to find a combination of bots to carry this out. 

Any help greatly appreciated.

 

js

Get odd for required profit

Hi, I'm trying to implement a custom bot that in certain conditions after backing a runner lays it for a required profit. I looked at the ClosePositionOnOfferedBot Bot but that didn't help. 
I'm looking for something like "runner.GetBetToClosePositionAtOdds" but with profit instead of Odds :) that would return the odd where i should place the bet. Is there a function like that?

Backing Over/Under market if required score at x minute of a match.

Sorry my bad english, I'm brazilian User.

I need, select all the games (soccer) that come to minute 70 with the result of 0x0, 1x1 and 2x0 and make a bet on Back Under x, 5 goals. Always leaving me with 1 goal advantage.

 

And,

 

I'm trying to create a dutching in soccer, only for the first time half.

For games where the odds initial are 2 teams of more than 2

To make the back just in 0x0, 1x0, 0x1 and 1x1.

This is possible?

How do I? Have a tutorial?


Placing Bet one tick over best Price

 

Hi,

sorry to be bothering but i need help.

I have this piece of code:

BetPrice[] precosBack = currentRunner.BetPricesToBack;
short oddIndex = (short)(precosBack[0].OddsIndex + 1);
double odd = OddsData.GetOddsFromIndex(oddIndex);

What i was trying to achieve was placing a bet in the next odd ex:

 if precosBack[0] odd is 2.0 i want to place it at 2.02.

how can i do this?

 

 

Trading two different markets

Hi,

I would like to have a bot that observes market A and, at a certrain point if something special happens, places a bet on market B. Lets say it's a soccer match and my bot oberserves the market "over/under 2.5 goals". At a certrain moment the bot should place a bet not on this market but on the "correct score" market. The trigger signal to place the bet comes from market A but the bet has to be placed on market B.

How would you approach a solution to this problem?

Thanks in advance!

Place a bet in my Code on a AssociatedMarket

Hi,

I've written an custom bot and implemented my own logic there.

Now i wanted to start Placing bets but somehow i'm sucked in my code.

What i do in my code is the following:

  1. myAssociatedMarket = AssociatedMarket("Halbzeitstand");
  2. runner = myAssociatedMarket.MarketDetails.Runners[0];
  3. PlaceBet(runner, betType, odds, stake, true);

Wehn i execute this code, the bet will not be placed on the Market. but when i use the runner which is provided.. it's working and the bet is set correctly.

  1. PlaceBet(runner, betType, odds, stake, true);

How can i solve this issue?

Thanks for your reply 

Viktor

Restarting the bot

Hi, Stefan!

I have a problem with which I can not cope.

I created three bot.

1. Trade Lay Bet (Place bet and close position)

2. Trade Back Bet (Place bet and close position)

3. Scalping Trend (Trigger a bot by odds trend)

10 minutes before the race I run Scalping Trend, this bot determines the trend, if Trend Up - run Trade Lay Bet, if Trend Down a Trade Back Bet. Then everything stops. And I need that would all start again, that would start up again Scalping Trend. How can I do?

How to program a bot to save betfair charts

Yesterday I read this Czech blog that discusses the use of betfair charts to analyze different betting or trading strategies. It is quite easy to program such betfair bot, so here there is my code:

class SaveBetfairChartsBot : Bot
{
  private const string ChartFolderName = "My Charts";
  private const string BetfairChartUK = "http://uk.site.sports.betfair.com/betting/LoadRunnerInfoChartAction.do?marketId={0}&selectionId={1}&asianLineId={2}";
  private const string BetfairChartAUS = "http://au.site.sports.betfair.com/betting/LoadRunnerInfoChartAction.do?marketId={0}&selectionId={1}&asianLineId={2}";

  private string chartsFolder;

  public SaveBetfairChartsBot(IBetfairService betfairService,
       MonitoredMarket monitoredMarket, Runner runner)
    : base(betfairService, monitoredMarket, runner)
  {
    chartsFolder = Path.Combine(
     betfairService.ApplicationDocumentPathName, 
     string.Format("{0}/{1}", ChartFolderName, 
     DateTime.Now.ToString("yyyy_MM_dd")));

    if (!Directory.Exists(chartsFolder))
    {
      Directory.CreateDirectory(chartsFolder);
    }
  }

  public override void DoYourJob()
  {
    base.DoYourJob();

    string myChartsFolder = Path.Combine(
       chartsFolder, 
       monitoredMarket.Description.Replace(':', '_'));

    if (!Directory.Exists(myChartsFolder))
    {
      Directory.CreateDirectory(myChartsFolder);
    }

    int marketId = monitoredMarket.MarketId;
    string betfairChartUrl = 
     monitoredMarket.ExchangeId == ExchangeId.UK ? 
       BetfairChartUK : BetfairChartAUS;

    foreach (Runner myRunner in monitoredMarket.MarketDetails.Runners)
    {
      SaveRunnerChart(myRunner, marketId, betfairChartUrl, myChartsFolder);
    }

    ShowMessage(
     string.Format("Saving charts for the market: {0}",
     monitoredMarket.Description));

    Stop();
  }

  private void SaveRunnerChart(Runner myRunner, 
      int marketId, string betfairChartUrl, string myChartsFolder)
  {
    ShowMessage(myRunner.Name);

    try
    {
      WebRequest request = WebRequest.Create(
        string.Format(betfairChartUrl, 
             marketId, myRunner.SelectionId, myRunner.AsianLineId));

      using (WebResponse response = request.GetResponse())
      {
        using (Image image = Image.FromStream(response.GetResponseStream()))
        {
          image.Save(string.Format(
           Path.Combine(myChartsFolder, 
             string.Format("{0}.png", myRunner.Name))), ImageFormat.Png);
        }
      }
    }
    catch (Exception exception)
    {
      ShowMessage(exception.ToString());
    }
  }

  private void ShowMessage(string message)
  {
    betfairService.AddMessage(message, monitoredMarket.MarketId);
  }
}

You can download the source code here, unzip the file and copy the betfair bot script and xml file to MyBots folder.