BET_ACTION_ERROR : INVALID_ODDS issue

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • str114
    Junior Member
    • Feb 2014
    • 5

    #1

    BET_ACTION_ERROR : INVALID_ODDS issue

    Hi,

    I'm having some issues placing bets and am receiving INVALID_ODDS. Searching the forum (and google) the only other issue was related to malformed json and unless I'm missing something glaringly obvious this doesn't seem to be the cause.

    The code has been working successfully for months and suddenly I am experiencing this issue (though have changed my betting strategy, but not the actual code to serialise/place the bet).

    example json input (customer ref changed):
    Code:
    {"jsonrpc":"2.0","method":"SportsAPING/v1.0/placeOrders","params":{"marketId":"1.112905897","instructions":
    
    [{"orderType":"LIMIT","selectionId":3093005,"handicap":0.0,"side":"LAY","limitOrder":
    
    {"size":2.1,"price":35.0,"persistenceType":"LAPSE"}}],"customerRef":"xxx","locale":null},"id":1}
    Finally some screenshots of the deserialised response:
    betissue.png

    And the market at the time:
    betissue2.jpg

    As you can see the price I was laying at was considerably away from the available to lay market, yet still situated above the best back price. FYI this was an inplay horse race.

    Can anyone shed any light on this?

    Thanks
  • gus
    Senior Member
    • Jan 2009
    • 134

    #2
    From odds of 30 to odds of 50 the price increment is 2:

    30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50

    so 35 is an INVALID_ODDS

    so at least it's not coding problem!

    Comment

    • str114
      Junior Member
      • Feb 2014
      • 5

      #3
      Hi Gus,

      Thanks ever so much! I did not know that.. I can't believe this is the first time I've hit it.

      Is this outlined anywhere (so I can code up the other ranges)? I can't seem to find it

      Appreciate your help!

      Comment

      • gus
        Senior Member
        • Jan 2009
        • 134

        #4
        There used to be a really handy spreadheet with all that kind of stuff in it, but seems to have disapperaed.

        Anyway they are:

        Price Increments:


        1.01 → 2: 0.01

        2 → 3: 0.02

        3 → 4: 0.05

        4 → 6: 0.1

        6 → 10: 0.2

        10 → 20: 0.5

        20 → 30: 1

        30 → 50: 2

        50 → 100: 5

        100 → 1000: 10

        You can work them out programmatically, but I just have them in a List in my utilities class:

        1.01, 1.02, 1.03, 1.04, 1.05, 1.06, 1.07, 1.08, 1.09, 1.1, 1.11, 1.12, 1.13, 1.14, 1.15, 1.16, 1.17, 1.18, 1.19, 1.2, 1.21, 1.22, 1.23, 1.24, 1.25, 1.26, 1.27, 1.28, 1.29, 1.3, 1.31, 1.32, 1.33, 1.34, 1.35, 1.36, 1.37, 1.38, 1.39, 1.4, 1.41, 1.42, 1.43,1.44, 1.45, 1.46, 1.47, 1.48, 1.49, 1.5, 1.51, 1.52, 1.53, 1.54, 1.55, 1.56, 1.57, 1.58, 1.59, 1.6, 1.61, 1.62, 1.63, 1.64, 1.65, 1.66,1.67, 1.68, 1.69, 1.7, 1.71, 1.72, 1.73, 1.74, 1.75, 1.76, 1.77, 1.78, 1.79, 1.8, 1.81, 1.82, 1.83, 1.84, 1.85, 1.86, 1.87, 1.88, 1.89, 1.9, 1.91, 1.92, 1.93, 1.94, 1.95, 1.96, 1.97, 1.98, 1.99, 2, 2.02, 2.04, 2.06, 2.08, 2.1, 2.12, 2.14, 2.16, 2.18, 2.2, 2.22, 2.24, 2.26, 2.28, 2.3, 2.32, 2.34, 2.36, 2.38, 2.4, 2.42, 2.44, 2.46, 2.48, 2.5, 2.52, 2.54, 2.56, 2.58, 2.6, 2.62, 2.64, 2.66, 2.68, 2.7, 2.72, 2.74, 2.76, 2.78, 2.8, 2.82, 2.84, 2.86, 2.88, 2.9, 2.92, 2.94, 2.96, 2.98, 3, 3.05, 3.1, 3.15, 3.2, 3.25, 3.3, 3.35, 3.4, 3.45, 3.5, 3.55, 3.6, 3.65, 3.7, 3.75, 3.8, 3.85, 3.9, 3.95, 4, 4.1, 4.2, 4.3, 4.4, 4.5, 4.6, 4.7, 4.8, 4.9, 5, 5.1, 5.2, 5.3, 5.4, 5.5, 5.6, 5.7, 5.8, 5.9, 6, 6.2, 6.4, 6.8, 7, 7.2, 7.4, 7.6, 7.8, 8, 8.2, 8.4, 8.6, 8.8, 9, 9.2, 9.4, 9.6, 9.8, 10, 10.5, 11, 11.5, 12, 12.5, 13, 13.5, 14, 14.5, 15, 15.5, 16, 16.5, 17, 17.5, 18, 18.5, 19, 19.5, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 55, 60, 65, 70, 75, 80, 85, 90, 95, 100, 110, 120, 130, 140, 150, 160, 170, 180, 190, 200, 210, 220, 230, 240, 250, 260, 270, 280, 290, 300, 310, 320,330, 340, 350, 360, 370, 380, 390, 400, 410, 420, 430, 440, 450, 460, 470, 480, 490, 500, 510, 520, 530, 540, 550, 560, 570, 580, 590, 600, 610, 620, 630, 640, 650, 660, 670, 680, 690, 700, 710, 720, 730, 740, 750, 760, 770, 780, 790, 800, 810, 820, 830, 840, 850, 860, 870, 880, 890, 900, 910, 920, 930, 940, 950, 960, 970, 980, 990, 1000

        Comment

        • AlgoTrader
          Junior Member
          • Mar 2012
          • 243

          #5
          The rounding code is there:

          Code:
          BetfairPrice.prototype.setStake = function (size) {
              if (!size)
                  size = 1.01;
              if (typeof (size) === 'string')
                  size = parseFloat(size);
          
              if (size < 1.01)
                  size = 1.01;
              else if (size < 2)
                  size = Math.round(size * 100.0) / 100.0;
              else if (size < 3)
                  size = Math.round(size * 50.0) / 50.0;
              else if (size < 4)
                  size = Math.round(size * 20.0) / 20.0;
              else if (size < 6)
                  size = Math.round(size * 10.0) / 10.0;
              else if (size < 10)
                  size = Math.round(size * 5.0) / 5.0;
              else if (size < 20)
                  size = Math.round(size * 2.0) / 2.0;
              else if (size < 30)
                  size = Math.round(size * 1.0) / 1.0;
              else if (size < 50)
                  size = Math.round(size * 0.5) / 0.5;
              else if (size < 100)
                  size = Math.round(size * 0.2) / 0.2;
              else if (size < 1000)
                  size = Math.round(size * 0.1) / 0.1;
              else
                  size = 1000.0;
          
              this.size = size.toFixed(2)*1;
              return;
          }
          Betfair Bots Made Easy

          Comment

          • str114
            Junior Member
            • Feb 2014
            • 5

            #6
            Thank you both for the information & code. Very kind of you!

            Comment

            • PT_PT
              Junior Member
              • Nov 2012
              • 17

              #7
              Originally posted by gus View Post
              There used to be a really handy spreadheet with all that kind of stuff in it, but seems to have disapperaed.
              you can find the price increments here: http://bdp.betfair.com/index.php?opt...&catid=59&id=6

              And here is another spreadsheet showing the minimum bet size per currency: http://bdp.betfair.com/index.php?opt...59&Itemid=113#

              Comment

              Working...
              X