Remove this ad
avatar

andrew987

rookie botter

Posts: 6 Member Since: January 8, 2011

Lead

September 21, 2013 07:04:24

Tags : :

Hi,

I'm using the API function getAllMarkets and having a bit of trouble with the market start time (field 5 from the string for each market, the 'Event Date' according to the API reference guide).

In particular, for all markets related to the AFL grand final it seems to give a start date back in March this year. For other markets the conversion lines up with the start time on the website, but for the couple I've checked related to the AFL grand final it doesn't.

Any idea what's going on?

I'm converting the milliseconds count using the following:



                DateTime startTime = DateTime.SpecifyKind(UnixEpoch.AddMilliseconds(Convert.ToInt64(fields[4])), DateTimeKind.Utc);
                DateTime localStartTime = startTime.ToLocalTime();

Cheers,

Andrew

Quote    Reply   
Remove this ad
Remove this ad
avatar

birchy

Betfair Elite

Posts: 591 Member Since:May 11, 2008

#1 [url]

September 21, 2013 13:04:19

Not sure what language that is, but in Python it looks like this:

start_time = datetime.utcfromtimestamp( int( market['event_date'] ) / 1000 )

www.bespokebots.com

"This time next year Rodney, we'll be millionaires!"

Quote    Reply   
avatar

andrew987

rookie botter

Posts: 6 Member Since:January 8, 2011

#2 [url]

September 21, 2013 13:09:16

Sorry that wasn't well written, it's C# but I realise I've left half of it out. I don't think the code's really the problem - as I said most markets seem to be working. Has anyone experienced this for the AFL premiership?

Cheers,

Andrew

Quote    Reply   
avatar

birchy

Betfair Elite

Posts: 591 Member Since:May 11, 2008

#3 [url]

September 21, 2013 13:24:26


Just checked my response for the AFL Grand Final match odds (market id = 100761478) and get this response:

{
 'bet_delay': '0',
 'bsp_market': 'N',
 'country_code': 'AUS',
 'event_date': datetime.datetime(2013, 9, 28, 4, 30),
 'event_hierarchy': '/61420/26898196/27071007/27071008/100761478',
 'exchange_id': '2',
 'last_refresh': '1379769664795',
 'market_id': '100761478',
 'market_name': 'Match Odds',
 'market_status': 'ACTIVE',
 'market_type': 'O',
 'menu_path': '\\Australian Rules\\AFL 2013\\Grand Final - 28 September\\Hawthorn v Fremantle',
 'no_of_runners': '2',
 'no_of_winners': '1',
 'total_matched': '0.0',
 'turning_in_play': 'Y'
}

Give me a market id for one of the "wrong" dates and I'll check it against my code...

www.bespokebots.com

"This time next year Rodney, we'll be millionaires!"

Quote    Reply   
avatar

andrew987

rookie botter

Posts: 6 Member Since:January 8, 2011

#4 [url]

September 22, 2013 04:48:19

Thanks for your help birchy.

I'm having trouble with the marketID 100554211 on exchange server 2 (name "Premiers 2013", "\\Australian Rules\\AFL 2013").

Cheers,

Andrew

Quote    Reply   
Remove this ad
avatar

birchy

Betfair Elite

Posts: 591 Member Since:May 11, 2008

#5 [url]

September 22, 2013 13:14:36


My bots don't even find that market unless I set fromDate = null in my getAllMarkets request, which does indicate that the market may have started already. I get the following response:
{
 'bet_delay': '0',
 'bsp_market': 'N',
 'country_code': 'AUS',
 'event_date': datetime.datetime(2013, 3, 22, 9, 40),
 'event_hierarchy': '/61420/26898196/100554211',
 'exchange_id': '2',
 'last_refresh': '1379855271474',
 'market_id': '100554211',
 'market_name': 'Premiers 2013',
 'market_status': 'ACTIVE',
 'market_type': 'O',
 'menu_path': '\\Australian Rules\\AFL 2013',
 'no_of_runners': 2,
 'no_of_winners': 1,
 'total_matched': 1031814.0,
 'turning_in_play': 'Y'
}

My conclusion is that your code is fine, but the date is a typo at Betfair's end. It's happened before and no doubt will happen again.

www.bespokebots.com

"This time next year Rodney, we'll be millionaires!"

Quote    Reply   
avatar

birchy

Betfair Elite

Posts: 591 Member Since:May 11, 2008

#6 [url]

September 22, 2013 13:20:16

There's obviously a date conflict there, but I'm not sure which one is correct?

At the start of the AFL regular season all unmatched bets will be cancelled and the market re-opened.

- http://sports.betfair.com/?mi=100554211&ex=2


Round 1 - Friday, 22 March (8:10 pm) - Adelaide vs Essendon

- http://en.wikipedia.org/wiki/2013_AFL_season#Premiership_season


www.bespokebots.com

"This time next year Rodney, we'll be millionaires!"

Quote    Reply   
avatar

andrew987

rookie botter

Posts: 6 Member Since:January 8, 2011

#8 [url]

September 27, 2013 09:11:21

Great, thanks all. Just wanted to make sure I wasn't missing anything.

Quote    Reply   
Remove this ad
Add Reply

Quick Reply

bbcode help