Glad to see the forum is back online!
I’ve been using spreadsheets for my trading for a while now but up until this point I have only ever used “BACK” or “LAY” in the L column to make my trades. I’ve recently decided to try out the other syntax options and have a couple of questions I’m hoping some users could clear up for me please.
I’m trying to make a LAY order using fill or kill that repeats until the bet is fully matched. I’m testing on the greyhound markets so the kill can be quite quick, I’ve chosen every 2 seconds as I’m only trying to get through a single £2 stake. So in Cell L9 I have:
LAY:FILL_KILL:TRUE:KILL_DELAY:2:BATCHES:15
Because I’m testing in practice mode with small stakes in quick markets, I can’t see whether this is working. I don’t get “ERROR”, which is good, a LAY bet goes through. I have searched the forum and I don’t need to untick the cog on the ladder or anything like this from what I have read? Should I be seeing some sort of confirmation that my order is selected as fill or kill? Are there any other settings I am forgetting to include or is the way I have written the line incorrect in some way? I wasn’t sure whether ‘batches’ was for the Offset option?
I intend it to keep putting the order in if it’s not filled. 15 batches x 2 second delay = 30 seconds before the start time which is when my test trigger has been activating from. Cell M9 equals the Last Traded Price so essentially the Lay bet chases the price in either direction until it is fully filled. I have changed cell M9 to equal a price away from the LTP for testing but still can’t see my bet get killed and then resubmit in the log? Any ideas please?
Also, as a safety feature, I’d like my LAY bet to TakeSP. I can’t attach a TakeSP part to this syntax at all so am I correct in thinking the best practice is for the next line in my VBA script to make the global command cell (L6) = TAKE_SP_ALL, this should take the bet to SP almost immediately on the off chance BetFair goes down? As long as my bet has gone through, it ‘should’ be unlikely it hasn’t registered with TakeSP status?
I’m thinking of having it trigger once after the entry signal and once when it detects my stake has been fully matched. Am I also correct in assuming, much like automation, I can send a TakeSP signal as many times as I’d like to BetFair and this won’t cause any sort of error message?
Using Fill or Kill Syntax Until Fully Matched in Excel
-
- Posts: 575
- Joined: Wed Apr 19, 2017 5:12 pm
I have tried using the ladder. The cog does not have a red ‘x’ going through it. The first little dropdown box still shows ‘None’ and everything else is at default. The only thing I have changed is the fill or kill box is ticked and there is a 5 second delay.
I put my bet into the market and sure enough, in the log, next to the ‘Cancel’ and ‘Close’ buttons I see ‘Pending Fill or Kill bet’. 5 seconds later this bet (which was about 4/5 ticks away from the current price) is cancelled. But then the spreadsheet tries the same thing with the syntax from my previous message and this doesn’t happen, it never cancels. The spreadsheet doesn’t show anywhere that it is a fill or kill bet and neither does the log on the ladder screen.
I’m probably doing something super stupid, anyone help please?
Also this just puts a single bet in and cancels it. Is there something I can add to the syntax so if it is cancelled my workbook fires in a new bet and keeps doing this fill or kill loop until I'm fully matched? I'm just trying to add to my decision tree and in some instances I just want to try and chase the price to get matched effectively.
I put my bet into the market and sure enough, in the log, next to the ‘Cancel’ and ‘Close’ buttons I see ‘Pending Fill or Kill bet’. 5 seconds later this bet (which was about 4/5 ticks away from the current price) is cancelled. But then the spreadsheet tries the same thing with the syntax from my previous message and this doesn’t happen, it never cancels. The spreadsheet doesn’t show anywhere that it is a fill or kill bet and neither does the log on the ladder screen.
I’m probably doing something super stupid, anyone help please?
Also this just puts a single bet in and cancels it. Is there something I can add to the syntax so if it is cancelled my workbook fires in a new bet and keeps doing this fill or kill loop until I'm fully matched? I'm just trying to add to my decision tree and in some instances I just want to try and chase the price to get matched effectively.
-
- Posts: 575
- Joined: Wed Apr 19, 2017 5:12 pm
Figured it out!!
For anyone else in the future who may have the same problem, you don't put the : between each section, it's a space. It was as simple as that! So issuing a Lay bet with a fill of kill of 2 seconds looks like this:
LAY FILL_KILL:TRUE KILL_DELAY:2
If my stake (£2 min at the moment) isn't fully matched in two seconds the whole stake is cancelled (killed), is there any way of adding anything to the syntax so it tries again or am I going to have to add another layer of detail to my decision tree for this? I think I have read everything to do with this area of the spreadsheet so I assume no?
For anyone else in the future who may have the same problem, you don't put the : between each section, it's a space. It was as simple as that! So issuing a Lay bet with a fill of kill of 2 seconds looks like this:
LAY FILL_KILL:TRUE KILL_DELAY:2
If my stake (£2 min at the moment) isn't fully matched in two seconds the whole stake is cancelled (killed), is there any way of adding anything to the syntax so it tries again or am I going to have to add another layer of detail to my decision tree for this? I think I have read everything to do with this area of the spreadsheet so I assume no?
- firlandsfarm
- Posts: 3332
- Joined: Sat May 03, 2014 8:20 am
Hi Callum, I've had some trouble with TAKE_SP_ALL and I suspect it's down to my ignorance! Am I right in assuming that I need to trigger TAKE_SP_ALL each time I want it to apply so maybe in L6 I use "=if([time to off]<5 seconds, "TAKE_SP_ALL","") so that the TAKE_SP_ALL command is issued as a final 5 seconds failsafe?CallumPerry wrote: ↑Mon Feb 10, 2020 4:44 pmAlso, as a safety feature, I’d like my LAY bet to TakeSP. I can’t attach a TakeSP part to this syntax at all so am I correct in thinking the best practice is for the next line in my VBA script to make the global command cell (L6) = TAKE_SP_ALL, this should take the bet to SP almost immediately on the off chance BetFair goes down? As long as my bet has gone through, it ‘should’ be unlikely it hasn’t registered with TakeSP status?
I’m thinking of having it trigger once after the entry signal and once when it detects my stake has been fully matched. Am I also correct in assuming, much like automation, I can send a TakeSP signal as many times as I’d like to BetFair and this won’t cause any sort of error message?
STOP PRESS: just tried it on the Dogs and yes it worked as I was thinking but … I'm finding some Dog "take SP" bets though converted are not being taken. Do you know if that is because of the lower liquidity?
-
- Posts: 575
- Joined: Wed Apr 19, 2017 5:12 pm
I don't believe TakeSP is dependent on liquidity in any way, I think it's just an option what you want to happen to your money once the market is underway. Perhaps the instances you've noticed it not work, the race started more than 5 seconds earlier than it should have done and thus didn't execute?
Try firing in the order with your opening trigger. I have written my code so that it fires a BACK/LAY bet depending on certain parameters and then a line after it asks to TakeSP so upon the next refresh it should fire a bet in and almost instantaneously, define it as a TakeSP. Because my VBA code runs quicker than 20m/s it would go through with the order command at the same time to BF. I do this for my closing orders too just as a failsafe.
Try firing in the order with your opening trigger. I have written my code so that it fires a BACK/LAY bet depending on certain parameters and then a line after it asks to TakeSP so upon the next refresh it should fire a bet in and almost instantaneously, define it as a TakeSP. Because my VBA code runs quicker than 20m/s it would go through with the order command at the same time to BF. I do this for my closing orders too just as a failsafe.
- firlandsfarm
- Posts: 3332
- Joined: Sat May 03, 2014 8:20 am
I would have thought there would have to be a liquidity check somewhere otherwise if heavily out of balance you could get some very strange BSP's! I have had it where Take SP was flagged but the bet didn't convert.CallumPerry wrote: ↑Mon Mar 16, 2020 12:27 pmI don't believe TakeSP is dependent on liquidity in any way, … Perhaps the instances you've noticed it not work, the race started more than 5 seconds earlier than it should have done and thus didn't execute?
And nope, sorry, but the Take SP command had been issued and was showing in the Betfair OpenBets window for the race as the selected option for unmatched bets at the off. Betfair had it but did nothing with it!
-
- Posts: 575
- Joined: Wed Apr 19, 2017 5:12 pm
Oh, well I am ignorant to the coding behind the TakeSP, it does make sense that a check would need to be done to balance the Back/Lays to calculate the final price. Perhaps yours couldn't be accepted for whatever reason but then it should tell you why or at least that it hadn't gone through.
That's surprising, and concerning, hopefully somebody else has a reasonable answer as to why and a workaround because I may have to implement another layer to my safety logic!
That's surprising, and concerning, hopefully somebody else has a reasonable answer as to why and a workaround because I may have to implement another layer to my safety logic!