Placing two lay bets when one back bet is cancelled

Servants, just tap your bell to call them.
Post Reply
gazza740
Posts: 3
Joined: Mon May 14, 2018 3:19 pm

Hi Guys

Hopefully a simple enough mistake I am making that someone could help with. I have made a scalping servant that places a £10 back bet and then when it is matched a £10 lay bet one tick lower. It works fine.

However If i start the Servant and I no longer like my position, I am using the ladder to left click on the £10 unmatched back bet to cancel. I then may enter again using the servant at another price. However if the £10 back bet gets matched after I had cancelled a position it then places 2 lay bets instead of one or 3 or 4 lays depending on the amount of times I cancelled my earlier positions. Is there a way to stop this from happening? Below is an example I ran in practrice to force the error:

06/06/2018 13:49:30: [AS 12] : Automation Servant ( Scalp ) Started ( Selection context: Theatre Of War. )
06/06/2018 13:49:30: [AS 12] : £ 10.00 Back bet placed on Theatre Of War at 7.2. Entirely unmatched when it initially reached the market. Ref: 10019
06/06/2018 13:49:31: Cancelling bets 10019
06/06/2018 13:49:34: [AS 13] : Automation Servant ( Scalp ) Started ( Selection context: Theatre Of War. )
06/06/2018 13:49:34: [AS 13] : £ 10.00 Back bet placed on Theatre Of War at 7.2. Entirely unmatched when it initially reached the market. Ref: 10020
06/06/2018 13:50:02: [AS 12] : £ 10.00 Lay bet placed on Theatre Of War at 7. Entirely unmatched when it initially reached the market. Ref: 10021
06/06/2018 13:50:02: [AS 13] : £ 10.00 Lay bet placed on Theatre Of War at 7. Entirely unmatched when it initially reached the market. Ref: 10022

Thanks for your help
Autolearner
Posts: 49
Joined: Sat Mar 11, 2017 4:28 pm

Hi Gazza

I don't have an answer, just a similar problem. I attempted to construct a simple scalping bot based on Peter's recent Youtube video. I particularly liked the part where it scratches you out if the price goes against you. It seemed to work okay with £2 stakes so I thought I would try and get ambitious and make the stake context sensitive. It seems to work most of the time as shown on the video, and then occasionally fires in multiple lay bets. An example is shown below

06/06/2018 13:37:50: [AS 15] : Automation Servant ( ASC simple scalp ) Started ( Selection context: Excellent Team. Back Stake context: £3.00 . Lay Stake context: £3.00 . )
06/06/2018 13:37:50: [AS 15] : £ 3.00 Back bet placed on Excellent Team at 3.45. Fully matched at 3.45. Ref: 127697107674 ( Fill or kill bet with 15 seconds delay. )
06/06/2018 13:37:50: [AS 1] : Automation Servant ( ASC simple scalp ) Stopped.
06/06/2018 13:37:50: [AS 3] : Automation Servant ( ASC simple scalp ) Stopped.
06/06/2018 13:37:50: [AS 4] : Automation Servant ( ASC simple scalp ) Stopped.
06/06/2018 13:37:50: [AS 13] : Automation Servant ( ASC simple scalp ) Stopped.
06/06/2018 13:37:50: [AS 15] : Automation Servant ( ASC simple scalp ) Stopped.
06/06/2018 13:37:50: [AS 1] : £ 3.00 Lay bet placed on Excellent Team at 3.45. Entirely unmatched when it initially reached the market. Ref: 127697108263
06/06/2018 13:37:50: [AS 4] : £ 3.00 Lay bet placed on Excellent Team at 3.45. Entirely unmatched when it initially reached the market. Ref: 127697108265
06/06/2018 13:37:50: [AS 3] : £ 3.00 Lay bet placed on Excellent Team at 3.45. Entirely unmatched when it initially reached the market. Ref: 127697108266
06/06/2018 13:37:50: [AS 15] : £ 3.00 Lay bet placed on Excellent Team at 3.45. Entirely unmatched when it initially reached the market. Ref: 127697108315
06/06/2018 13:37:50: [AS 13] : £ 3.00 Lay bet placed on Excellent Team at 3.45. Entirely unmatched when it initially reached the market. Ref: 127697108270

I suspect that the issue in my case may be the condition I have put on the lay bet, which I thought was the same as on Peters video. It may be something about the back bet being pulled (as I set fill or kill to 15 seconds, and on Peter's video he has a very long fill or kill time, so the issue didn't arise).

i.e. for the Lay by using the Matched Bets amount condition, with total amount matched of the selections back bets is greater than the total amounts matched of your lay bets plus £0 - does it go "wrong" if some of the preceding back bets are "killed" rather than matched?

Any advice to both Gazza's and my (hopefully linked) query would be very gratefully received.
User avatar
Dallas
Posts: 22674
Joined: Sun Aug 09, 2015 10:57 pm
Location: Working From Home

For Gazza query it likely the earlier servants are not being stopped so starting it again to initiate another back bet means 2 lays will then follow (one from each servant)

If you add a new rule 'Stop previous Servants' and move it to the top of your servant file that should solve it

Autolearner - it looks like your issue is along similar lines if your self-canceling a bets from earlier servants then starting them again but I'd need to see the way you have it set up or watch the video to get an idea of what should be happening to answer yours definitively
Autolearner
Posts: 49
Joined: Sat Mar 11, 2017 4:28 pm

HI Dallas

Here is my attempt at what I gleaned from Peter's video - many thanks for any help
You do not have the required permissions to view the files attached to this post.
Autolearner
Posts: 49
Joined: Sat Mar 11, 2017 4:28 pm

And just to be clear, I am not cancelling the original back bets, they are being killed after 15 seconds, and it seems to be after this happens that the gremlins start to kick in

Many thanks
User avatar
Dallas
Posts: 22674
Joined: Sun Aug 09, 2015 10:57 pm
Location: Working From Home

Im tied up on tennis this afternoon but will try and look later if no one else has in the mean time
gazza740
Posts: 3
Joined: Mon May 14, 2018 3:19 pm

Thank you for the fast replies! That is my problem fixed. Autolearner I hope you get a resolution for your servant! I am still new to most of this so I dont think I would have too much valuable input unfortunately
User avatar
Dallas
Posts: 22674
Joined: Sun Aug 09, 2015 10:57 pm
Location: Working From Home

Autolearner wrote:
Wed Jun 06, 2018 3:46 pm
And just to be clear, I am not cancelling the original back bets, they are being killed after 15 seconds, and it seems to be after this happens that the gremlins start to kick in

Many thanks
It is the same problem as Gazza had in that the 'lay' rule is still active from previous servants but in your case where the back was killed, so doing the same thing as advised earlier will also resolve this for you

add a new rule 'Stop previous Servants' and move it to the top of your servant file that should solve it
Autolearner
Posts: 49
Joined: Sat Mar 11, 2017 4:28 pm

Many thanks Dallas

Will try that tomorrow
Autolearner
Posts: 49
Joined: Sat Mar 11, 2017 4:28 pm

Hi Dallas

Thanks as always for your help. I had a go at doing as you suggest (by putting the stop servant instruction on this selection at the top of the servant) and it doesn't seem to have resolved the problem

Had a quick go at a South African race to try it out and the resulting log is below. One hypothesis is that the entry at 11:00:15 which says
07/06/2018 11:00:15: [AS 3] : £ 2 of unmatched bet (Ref:127767989197) was filled before remainder was killed.
This implies that there may be a small fraction of the original £2 bet that was still unmatched and it was this small proportion that was "killed". Is it possibly this that is causing erroneous extra lays?

I attach my update version of the .BAF file, which hopefully accords with your suggestion about stopping existing servants first

I don't want to over tax your goodwill, as I fully realise how much you contribute throughout this forum, but any pointers would be very gratefully received

7/06/2018 10:58:54: Market changed to Vaal (RSA) 7th Jun - 11:00 R1 1200m Plt
07/06/2018 10:59:38: [AS 1] : Automation Servant ( ASC simple scalp ) Started ( Selection context: La Lucia. Back Stake context: £2.00 . Lay Stake context: £2.00 . )
07/06/2018 10:59:39: [AS 1] : £ 2.00 Back bet placed on La Lucia at 3.6. Entirely unmatched when it initially reached the market. Ref: 127767965521 ( Fill or kill bet with 15 seconds delay. )
07/06/2018 10:59:39: [AS 1] : Automation Servant ( ASC simple scalp ) Stopped.
07/06/2018 10:59:39: [AS 1] : £ 2 of unmatched bet (Ref:127767965521) was filled before remainder was killed.
07/06/2018 10:59:39: [AS 1] : £ 2.00 Lay bet placed on La Lucia at 3.6. Entirely unmatched when it initially reached the market. Ref: 127767966030
07/06/2018 10:59:46: [AS 2] : Automation Servant ( ASC simple scalp ) Started ( Selection context: La Lucia. Back Stake context: £2.00 . Lay Stake context: £2.00 . )
07/06/2018 10:59:46: [AS 2] : £ 2.00 Back bet placed on La Lucia at 3.65. Entirely unmatched when it initially reached the market. Ref: 127767971037 ( Fill or kill bet with 15 seconds delay. )
07/06/2018 11:00:02: [AS 2] : £ 2 unmatched bet (Ref:127767971037) was killed.
07/06/2018 11:00:11: [AS 3] : Automation Servant ( ASC simple scalp ) Started ( Selection context: La Lucia. Back Stake context: £2.00 . Lay Stake context: £2.00 . )
07/06/2018 11:00:11: [AS 3] : £ 2.00 Back bet placed on La Lucia at 3.7. Entirely unmatched when it initially reached the market. Ref: 127767989197 ( Fill or kill bet with 15 seconds delay. )
07/06/2018 11:00:15: [AS 3] : £ 2 of unmatched bet (Ref:127767989197) was filled before remainder was killed.
07/06/2018 11:00:16: [AS 2] : £ 2.00 Lay bet placed on La Lucia at 3.7. Entirely unmatched when it initially reached the market. Ref: 127767992737
07/06/2018 11:00:16: [AS 2] : Automation Servant ( ASC simple scalp ) Stopped.
07/06/2018 11:00:16: [AS 3] : Automation Servant ( ASC simple scalp ) Stopped.
07/06/2018 11:00:16: [AS 3] : £ 2.00 Lay bet placed on La Lucia at 3.7. Entirely unmatched when it initially reached the market. Ref: 127767992741
07/06/2018 11:00:26: Cancelling bets 127767992737 127767992741
07/06/2018 11:00:28: £ 2.00 Back bet placed on La Lucia at 3.75. Entirely unmatched when it initially reached the market. Ref: 127768002798
07/06/2018 11:00:32: £ 2.00 Lay bet placed on La Lucia at 3.7. Entirely unmatched when it initially reached the market. Ref: 127768005194
07/06/2018 11:00:37: Cancelling bets 127768005194
07/06/2018 11:00:37: Greened up La Lucia by Laying 3.92 at 3.8
You do not have the required permissions to view the files attached to this post.
User avatar
Dallas
Posts: 22674
Joined: Sun Aug 09, 2015 10:57 pm
Location: Working From Home

Autolearner wrote:
Thu Jun 07, 2018 11:16 am
Hi Dallas

Thanks as always for your help. I had a go at doing as you suggest (by putting the stop servant instruction on this selection at the top of the servant) and it doesn't seem to have resolved the problem

Had a quick go at a South African race to try it out and the resulting log is below. One hypothesis is that the entry at 11:00:15 which says
07/06/2018 11:00:15: [AS 3] : £ 2 of unmatched bet (Ref:127767989197) was filled before remainder was killed.
This implies that there may be a small fraction of the original £2 bet that was still unmatched and it was this small proportion that was "killed". Is it possibly this that is causing erroneous extra lays?

With those sized stakes on UK racing market, you would never have a partially matched bet, it's only because you were running it on an illiquid SA race its happened.

If that was just for testing purposes I wouldn't worry about it, it will be fine come this afternoon, but if you intend to use on less liquid markets there are still some conditions that can be added to resolve it
Autolearner
Posts: 49
Joined: Sat Mar 11, 2017 4:28 pm

Hi Dallas

Tried it briefly on a few UK races for £2 stakes and on the basis of this quick test it seems to be working. So it looks like your hypothesis about poor liquidity on the earlier SA races was to blame.

So should be fine for now I guess? I suppose the issue may come downstream if I start to scale up when there may be occasions when most but not all of the initial back stake is taken before the remainder is killed. I guess I will have to see as and when I get to that stage, and if so may ask again for advice as to additional conditions that might help

But for now am fine - and thank you as always for your speedy and always helpful responses
Post Reply

Return to “Bet Angel - Servants”