Fill or Kill a lay bet in-running

We were all new to Bet Angel once. Ask any question you like here and fellow forum members promise not to laugh. Betfair trading made simple.
Post Reply
User avatar
jamesedwards
Posts: 2309
Joined: Wed Nov 21, 2018 6:16 pm

Two years in and I still need to ask an occasional question in here :lol:

I want to place a lay bet in-running that is either taken instantly (by what is already in the market) or is cancelled immediately.

I tick the "place fill or kill bets" box and apply 0.1s delay. This seems to work perfectly when in practise mode but as soon as I switch to real mode I am finding when I execute the same rule if the lay bets are not taken then they stay up as unmatched marked as "pending fill or kill" in the unmatched bets window.

Why is this happening please and how can I fix?
Anbell
Posts: 2049
Joined: Fri Apr 05, 2019 2:31 am

jameegray1 wrote:
Sun Sep 13, 2020 3:52 am
Two years in and I still need to ask an occasional question in here :lol:

I want to place a lay bet in-running that is either taken instantly (by what is already in the market) or is cancelled immediately.

I tick the "place fill or kill bets" box and apply 0.1s delay. This seems to work perfectly when in practise mode but as soon as I switch to real mode I am finding when I execute the same rule if the lay bets are not taken then they stay up as unmatched marked as "pending fill or kill" in the unmatched bets window.

Why is this happening please and how can I fix?
I'm not sure but I'll take a stab at it to get you moving: There's a 1 second delay for bets IP. It might have something to do with that.
User avatar
firlandsfarm
Posts: 2722
Joined: Sat May 03, 2014 8:20 am

Just a guess but it could be being affected by the 1 second delay … try a 1.10 sec. fill or kill or something slightly longer … may work. If you try it I would like to know how it goes as part of my learning/understanding process. :) (snap, sorry Anbell, you reply was not onscreen when I replied. :) )
User avatar
jamesedwards
Posts: 2309
Joined: Wed Nov 21, 2018 6:16 pm

Thanks. I thought about the 1 sec delay but that also applies on practise mode. Would like to know for certain that is what I need to do before I play about in real mode.
User avatar
ShaunWhite
Posts: 9731
Joined: Sat Sep 03, 2016 3:42 am

The 1s delay is in the bet placement process, but cancelations don't have a delay. If BA is submitting a fill/kill bet then there shouldn't be a problem but if it's simulating that with a bet followed by a timed cancel there could be an issue. Ie the 0.1s cancel gets there before the 1s delayed bet.
spreadbetting
Posts: 3140
Joined: Sun Jan 31, 2010 8:06 pm

You can't cancel a bet without a BetID and that doesn't get returned to BA until the bet has hit the system so any bets would be at the mercy of your latency/connection. I.e bet gets sent to betfair, BA starts fill/kill timer from time it recieves back a betID then send the cancel request once the fill time you set has elapsed. So you should simply set your fill/kill timer to 0.

For the practise mode I'd guess they simply start the timer once the Betdelay has run it's course as that's simply a field returned within the API requests.

There is a FILL_OR_KILL option with the API placeBets request but that's a basic bet not matched kill it, also has the option of minFillSize which simply means if the size of bet you requested can't be matched the bet never gets placed i.e. killed , although a betID is generated for audit/transaction charge purposes. No idea if BA uses the timeInForce & minFillSize in their fill/kill options that'd be one for Dallas to answer.
User avatar
jamesedwards
Posts: 2309
Joined: Wed Nov 21, 2018 6:16 pm

Getting even more confused now. Tried amending to 1.1s and Guardian is still trying to cancel unmatched bets a minute after the race has ended and market suspended.
spreadbetting
Posts: 3140
Joined: Sun Jan 31, 2010 8:06 pm

Maybe BA is simply sending a cancellation at a set time after submission rather than timing from when they get the betID
User avatar
jamesedwards
Posts: 2309
Joined: Wed Nov 21, 2018 6:16 pm

See below the relevant bits from the log. Same rules, same time, same value, same odds, same matched status, and yet very different results. Any ideas what is going on here?

Bet ref: 211092925354 was triggered at 18:43:05 with 1.1s fill or kill, was entirely unmatched, but only killed 3 secs later.
Bet ref: 211092926995 was also triggered at 18:43:05 with 1.1s fill or kill, was also entirely unmatched, but kill was not attempted until 15 seconds later (the kill at this point presumably failed because market was by then suspended).


Log:
13/09/2020 18:41:59: Market is in-play
13/09/2020 18:43:05: [AS 92] : £ 2.00 Lay bet placed on Risen Change at 100. Entirely unmatched when it initially reached the market. Ref: 211092925354 ( Fill or kill bet with 1.1 seconds delay. )
13/09/2020 18:43:05: [AS 92] : £ 2.00 Lay bet placed on Right Notion at 100. Entirely unmatched when it initially reached the market. Ref: 211092926995 ( Fill or kill bet with 1.1 seconds delay. )
13/09/2020 18:43:08: [AS 92] : £ 2 unmatched bet (Ref:211092925354) was killed.
13/09/2020 18:43:10: Market has been suspended
13/09/2020 18:43:20: [AS 92] : WARNING: The Betfair API was unable to process the bet cancellation request. Second attempt activated. (Ref: 211092926995)
13/09/2020 18:43:23: [AS 92] : £ 2 unmatched bet (Ref:211092926995) was killed.
User avatar
Dallas
Posts: 22713
Joined: Sun Aug 09, 2015 10:57 pm
Location: Working From Home

jameegray1 wrote:
Sun Sep 13, 2020 3:52 am
Two years in and I still need to ask an occasional question in here :lol:

I want to place a lay bet in-running that is either taken instantly (by what is already in the market) or is cancelled immediately.

I tick the "place fill or kill bets" box and apply 0.1s delay. This seems to work perfectly when in practise mode but as soon as I switch to real mode I am finding when I execute the same rule if the lay bets are not taken then they stay up as unmatched marked as "pending fill or kill" in the unmatched bets window.

Why is this happening please and how can I fix?
The kill time starts from the moment the bet is matched, but the recommended minimum for a fill/kill time is 0.5 secs, that allows enough time for any latency and delays getting the information required.

If you are submitting multiple orders at the same time will fill/kill you can run into problems due to the way Betfair queue and process fill/kill orders.
Your location will dictate how many fill/kill orders you can place at the same time before some begin experiencing delays as Betfair queue them up
User avatar
jamesedwards
Posts: 2309
Joined: Wed Nov 21, 2018 6:16 pm

Dallas wrote:
Sun Sep 13, 2020 9:30 pm
jameegray1 wrote:
Sun Sep 13, 2020 3:52 am
Two years in and I still need to ask an occasional question in here :lol:

I want to place a lay bet in-running that is either taken instantly (by what is already in the market) or is cancelled immediately.

I tick the "place fill or kill bets" box and apply 0.1s delay. This seems to work perfectly when in practise mode but as soon as I switch to real mode I am finding when I execute the same rule if the lay bets are not taken then they stay up as unmatched marked as "pending fill or kill" in the unmatched bets window.

Why is this happening please and how can I fix?
The kill time starts from the moment the bet is matched, but the recommended minimum for a fill/kill time is 0.5 secs, that allows enough time for any latency and delays getting the information required.

If you are submitting multiple orders at the same time will fill/kill you can run into problems due to the way Betfair queue and process fill/kill orders.
Your location will dictate how many fill/kill orders you can place at the same time before some begin experiencing delays as Betfair queue them up
Thanks Dallas. That's exactly what I needed to know.
Post Reply

Return to “Bet Angel for newbies / Getting started”