Blocking bets from being placed in play

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • steve88
    Junior Member
    • Dec 2018
    • 10

    #1

    Blocking bets from being placed in play

    Hi,

    I'm trying to ensure that my placed bets don't accidentally end up in the in-play market. I've read through the docs and tried to use the market version function but for some reason it doesn't work. Any help is appreciated.

    This is the instruction I'm using in python:
    order = trading.betting.place_orders( market_id= i, instructions= place_order_list, market_version= int(3235800000) )
  • steve88
    Junior Member
    • Dec 2018
    • 10

    #2
    Sorry I should said that market id = i and instructions= place_order_list are both correct. It's only the market_version section of the instruction I am having trouble with.

    Comment

    • LiamP
      Junior Member
      • Oct 2015
      • 284

      #3
      You should use the market version that comes from the marketBook, from memory it looks like:

      Code:
      {‘version’: 128474746364}
      Note that if you are using an ide like pycharm it would tell you that market_version is expecting a dict and not an integer, bflw has typing.

      Comment

      • gus
        Senior Member
        • Jan 2009
        • 134

        #4
        Why not just use "persistenceType": "LAPSE" in your order instructions?

        the persistence type is an Enum:

        PersistenceType
        LAPSE Lapse the order when the market is turned in-play
        PERSIST Persist the order to in-play. The bet will be place automatically into the in-play market at the start of the event.
        MARKET_ON_CLOSE Put the order into the auction (SP) at turn-in-play

        e.g (from https://docs.developer.betfair.com/d...ni/placeOrders )

        {
        "jsonrpc": "2.0",
        "method": "SportsAPING/v1.0/placeOrders",
        "params": {
        "marketId": "1.109850906",
        "instructions": [
        {
        "selectionId": "237486",
        "handicap": "0",
        "side": "LAY",
        "orderType": "LIMIT",
        "limitOrder": {
        "size": "2",
        "price": "3",
        "persistenceType": "LAPSE"
        }
        }
        ]
        },
        "id": 1
        }

        Comment

        • LiamP
          Junior Member
          • Oct 2015
          • 284

          #5
          That won’t stop a bet executing into an inplay market, it will however cause a bet to lapse if a market becomes inplay.

          Comment

          Working...
          X