How to get profitAndLoss for bet (order) using API-NG?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • HazuRek
    Junior Member
    • Aug 2013
    • 21

    #1

    How to get profitAndLoss for bet (order) using API-NG?

    Good morning!

    Is it possible to get profitAndLoss for bet (order) using API-NG?
    If not at this moment - will it be supported (and when)?
  • AlgoTrader
    Junior Member
    • Mar 2012
    • 243

    #2
    Profit and loss for bet is trivial. You lose size for back, win size*(price-1), for lay things reverse.

    As to market - you can calculate stuff yourself for now, that's easy having all market bet list.

    I think it should be added to listMarketBook
    Betfair Bots Made Easy

    Comment

    • HazuRek
      Junior Member
      • Aug 2013
      • 21

      #3
      Thank you for the reply. But by P&L I meant the result of already calculated bet. I see that there is no method for getting info about calculated bets at this moment. Or I am wrong?

      Comment

      • AlgoTrader
        Junior Member
        • Mar 2012
        • 243

        #4
        Do you mean "calculated" bet is really "settled" bet? You seem to use your own words describing your problem.

        The listMarketBook has list of runners with statuses like
        ACTIVE, REMOVED, WINNER, LOSER. Poll for runner to become WINNER/LOSER and then... You know if you back the winner or lay the loser then add win amount, otherwise - subtract lose amount.

        WINNER/LOSER are your best friends
        Betfair Bots Made Easy

        Comment

        • HazuRek
          Junior Member
          • Aug 2013
          • 21

          #5
          Thanks, got the idea. But if I want to get this info using only betId, it is hard to get it. May be announced method:

          listClearedOrders - Retrieves a list of settled bets. Equivalent to API6 getBetHistory.

          will be easier way to get this info.

          Comment

          • AlgoTrader
            Junior Member
            • Mar 2012
            • 243

            #6
            Why you think you need betIds? listMarketBook returns all runners with statuses and all the matched bets on this market. So you can do everything in a single API call handler.

            listClearedOrders is not there yet. If it is, it is rather statement stuff that is updated with a delay. You know runner status immediatly after match settled and you get statement after some processing delay that may be minutes.
            Betfair Bots Made Easy

            Comment

            • HazuRek
              Junior Member
              • Aug 2013
              • 21

              #7
              I mostly agree with you. Just need to think about it and change the paradigm of my client's api.

              Comment

              • HazuRek
                Junior Member
                • Aug 2013
                • 21

                #8
                I continue thinking about your proposal. So things are not so simple.

                It is not so easy to get correct win/lose amount because of:

                1. How to get win amount? Just multiplication of average price and matched amount is not correct. Average price is just rounded up to 2 figures. And for large amounts it could be the issue. And to get the correct price you need to go through all the Matches of the Order. Yes, it is possible, but I think, there should be more easy way to get it - as it was just one field in old API to get result of settled bet.

                2. There are some special markets: with Dead Heat rules, Bookings Match bet, etc. For these markets you cannot calculate the result of settled bet (order) on "client's" size using just price and matched size.


                So I think there should be some easy way of getting the result of settled bet (order) as it was in old API.
                Last edited by HazuRek; 29-08-2013, 07:03 PM. Reason: 1

                Comment

                • betdynamics
                  Junior Member
                  • Sep 2010
                  • 534

                  #9
                  If I understand correctly, I think they said that it is scheduled for a future release of the API (I think they mentioned September).

                  I am also waiting for the same functionality.

                  Comment

                  Working...
                  X