Lock/guarantee cash in API

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Nordick
    Junior Member
    • Apr 2013
    • 2

    #1

    Lock/guarantee cash in API

    Hi there!

    In web interface a bettor has "lock/guarantee cash" function, that allows to withdraw a matched deal based on the current market situation.

    Is such function available in API?

    Thanks!
  • Strappa71
    Junior Member
    • Apr 2010
    • 3

    #2
    If you can do math it has always been and will always be available!

    Comment

    • Nordick
      Junior Member
      • Apr 2013
      • 2

      #3
      Originally posted by Strappa71 View Post
      If you can do math it has always been and will always be available!
      Ok, I see. I just wanted a magic button

      Comment

      • Ztown
        Junior Member
        • May 2010
        • 21

        #4
        hi

        what is the math?

        Comment

        • AlgoTrader
          Junior Member
          • Mar 2012
          • 243

          #5
          The math iss very basic

          for two selectionId's markets

          p1Balance + p1Sum*(p1Price-1) = p2Balance-p1Sum;
          for three selectionId's markets

          p1Balance + p1Sum*(p1Price-1)-p2Sum = p2Balance - p1Sum + p2Sum*(p2Price-1) = p3Balance - p1Sum - p2Sum
          For two outcomes, you need just one bet to fix profit or loss, for three outcomes you may need two bets. For N selectionIds there may be need of N-1 bets. There are lots of special cases when several selectionIds has equal current balance, then the number of bets is reduced.
          Betfair Bots Made Easy

          Comment

          • Ztown
            Junior Member
            • May 2010
            • 21

            #6
            I implemented the cash out feature using matrix algebra for cases where n>3. If anyone is having problems with the matrix algebra, please ask me.

            Comment

            • AlgoTrader
              Junior Member
              • Mar 2012
              • 243

              #7
              The problem is not algebra. The problem is when several bets are needed to "cache out", then price change may cause some of the bets to be matched and some stay open. The only reliable cache out is when betting was done on a single selectionId.
              Betfair Bots Made Easy

              Comment

              • Ztown
                Junior Member
                • May 2010
                • 21

                #8
                The original poster just wanted a replication of the "cash out" feature of betfair. Betfair doesn't
                guarantee you get filled. What you are talking about is order/position management.
                Last edited by Ztown; 13-05-2013, 11:20 AM.

                Comment

                Working...
                X