How to Sync the time between my server and Betfair

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • monkeymagix
    Junior Member
    • Jul 2010
    • 105

    #1

    How to Sync the time between my server and Betfair

    Hi

    I have a problem where I keep getting messages of BET_TAKEN_OR_LAPSED (even though the bet is not set to be converted to SP at inplay but kept as an inplay bet) - and is logged in the Betfair website betting history as Cancelled.

    This usually happens BEFORE the time of the race as well so I am thinking maybe my server clock is out of sync with Betfair and I am trying to place a bet which has lapsed because the race has started.

    How can I sync my clock up with Betfair so the times are in sync?

    I am using API-ING C# - a non interactive BOT

    Thanks

    Rob
  • betdynamics
    Junior Member
    • Sep 2010
    • 534

    #2
    Just sync your PC clock to an internet timesource.

    You can do this as a one-off exercise via Windows, or use a tool (like the NetTime tool - www.timesynctool.com)

    If you are not on Windows, then I assume there are corresponding tools available for your O/S.

    Comment

    • zoltanthemage
      Junior Member
      • May 2015
      • 17

      #3
      I think you can check the "inplay" flag before placing the order. The market could go in play in the time between your check and the order place, but it should not be very common (it sometimes happens to me though and sometimes the bets are actually placed and not lapsed).

      Comment

      • monkeymagix
        Junior Member
        • Jul 2010
        • 105

        #4
        Hi

        Hi

        I have already set my clock using the 4 NTP servers e.g the BDP team told me to use them from here

        http://www.pool.ntp.org/en/use.html

        and I have also created a webpage that checks the times from

        -My WebServer
        -My SQL Server
        -My Computer (JavaScript)
        -A web based time server (with some scraping) e.g http://nist.time.gov/actualtime.cgi?lzbc=siqm9b

        And they are all in sync e.g the output of this test page is

        Server / Client Time Checks

        SQL TIME = 03/09/2015 12:37:50
        WEB SERVER ASP TIME = 03/09/2015 12:37:50
        PC JAVASCRIPT TIME = 03/09/2015 12:37:50
        NIST.TIME.GOV TIME = Thu Sep 03 2015 12:37:50 GMT+0100 (GMT Daylight Time)

        So they are all in sync.

        However this doesn't stop me logging into a DB a race date/time of 15:45 and the race going off slightly early or later and your right the inplay flag does tell you - also check the market status to see if it's closed or suspended (as it goes suspended for a few seconds at the start of the race) before allowing inplay bets is what I am already doing - however this isn't preventing me getting the error.

        However BDP qualified the error (the message was not actually correct in it's meaning of "Bet cannot be cancelled or modified as it has already been taken or has lapsed Includes attempts to cancel/modify market on close BSP bets and cancelling limit on close BSP bets"

        https://api.developer.betfair.com/services/webapps/docs/display/1smk3cen4v3lu3yomq5qye0ni/Betting+Enums


        As I got told that...

        The BET_TAKEN_OR_LAPSED error also applies to bets that have since been cancelled, so I've updated the documentation to reflect this.
        So it could be cancelled bets that cannot be placed again due to an early race or my time being off.

        Thanks

        Rob

        Comment

        • zoltanthemage
          Junior Member
          • May 2015
          • 17

          #5
          I think it's completely normal for the events to start some minutes before or after the scheduled time. At least I have never seen a football match start at the exact time it was scheduled for.

          The market turns in play when the event starts, so you cannot be sure it won't turn in play before the exact scheduled time. I start to monitor the markets 5 mins before the scheduled start.

          Another thing that happens is that the market is suspended a few times as soon as it turns in play. I don't know the reasons, but I get some BET_TAKEN_OR_LAPSED errors even if I check the inplay flag and the market status before placing the order. I've see it with my eyes going from OPEN to SUPENDED a few times on the website around the time it was supposed to start. In my case, those orders are simetimes accepted, sometimes not.

          As a final notice, the market start time changes pretty often in the time between the market creation and start, so you should keep the info up to date.

          In this scenario, the perfect time sync seems completely unuseful to successfully place an order just before/after a market starts.

          Comment

          Working...
          X