how to place an offset bet without global settings?

Servants, just tap your bell to call them.
Post Reply
User avatar
Brovashift
Posts: 475
Joined: Tue May 18, 2021 12:35 am

Hi all,

Im just looking to do something really simple for now, and that is I want to place an offset bet using a rule, and not global settings. The reason is I want to only offset a percentage of my stake.

Creating a Place back/lay bet rule, I cannot see any conditions relevant that would help me do this. Looking through the shared auto files the scalping ones come close to what am trying to do but don't quite have what I need. The ASC Spread Exit - Back or Lay file is good, but this requires me to do two tasks, and I'd like to get this to work using one click of my mouse.

Any ideas appreciated.

TIA
eatyourgreens
Posts: 243
Joined: Sun Feb 18, 2018 12:53 am

Hi Brova,
I am no auto expert and I have not used servants much, but could you :-)

Store a value of your stake, maybe called 'stake'

Store another value of 'stake' minus (maybe) 70% (maybe called 'stake-70')

Store another value of 'stake' minus (maybe) 30% (maybe called 'stake-30')

On the place bet rule(s), apply the offset to whichever % you wanted it applied to, and on the parameters tab use a stored value stake (maybe 'stake-70')

The remaing % (stake-30') could then just be left with no offset. (the bet would be placed using a 'stored value stake' on the parameters tab (stake-30)).

I am sure all the above could be combined in one rules file, and assigned to a 'one mouse click' servant.

Hope that all makes sense :-)
Have a nice day! :-)
User avatar
Brovashift
Posts: 475
Joined: Tue May 18, 2021 12:35 am

eatyourgreens wrote: โ†‘
Sun Jul 31, 2022 3:05 pm
Hi Brova,
I am no auto expert and I have not used servants much, but could you :-)

Store a value of your stake, maybe called 'stake'

Store another value of 'stake' minus (maybe) 70% (maybe called 'stake-70')

Store another value of 'stake' minus (maybe) 30% (maybe called 'stake-30')

On the place bet rule(s), apply the offset to whichever % you wanted it applied to, and on the parameters tab use a stored value stake (maybe 'stake-70')

The remaing % (stake-30') could then just be left with no offset. (the bet would be placed using a 'stored value stake' on the parameters tab (stake-30)).

I am sure all the above could be combined in one rules file, and assigned to a 'one mouse click' servant.

Hope that all makes sense :-)
Have a nice day! :-)
Cheers for this mate, I didn't know all these stored values were here, not been past the Conditions tab :lol: Might be able to work something out here. Will have a peep in the User Guide at Stored Values ๐Ÿ‘

Remember... always eatyourgreens ;) ๐Ÿ‘
eatyourgreens
Posts: 243
Joined: Sun Feb 18, 2018 12:53 am

Try the attached (untested!) rules file, it may help to get you up and running using stored values, (practise mode only !!!)

It should store a value of 5 (stake), 5 minutes b4 off time, then seconds later, store two values, stake-70 and stake-30, then it will place bets using these two stakes, one with an offset and one without. (currently placed on the favourite)

All the times, amounts, %'s, selections etc. can be changed to what you want.

As it is it is just a rules file, but I am sure it could easily be converted to a "one mouse click servant"

Hope it works! hope it helps!
Have fun :-)
one for brova.baf
You do not have the required permissions to view the files attached to this post.
User avatar
Brovashift
Posts: 475
Joined: Tue May 18, 2021 12:35 am

Thanks eatyourgreens, I can see what you have done there, but the difference with mine is that I am not setting a specific stake. But I have now "tried" to store a stake value as a Stored Values, but for some reason its not picking it up!
I was hoping to be able to get the stake amount from what ever is selected in my staking area above my ladders, but I dont think thats possible because when I left click a stake on to the ladder as normal, first, then it enters the offset 75% stake when I activate the servant. However, this is me doing the 2 tasks (clicks) that I am trying to make in to a single task. Plus for some reason instead of the servant placing an offset of 75%, it adds it. So is I lay ยฃ10 and use the servant to offset 75% on the back side, it adds ยฃ7.50 to the lay side making my total required back stake ยฃ17.50 in order to close the position lol :?

(1) What I have tried to do is create a stored value rule using Set/Modify a signal only ( not sure it thats right, I pinched it from somewhere lol), also just tried Set/Modify a stored Value Only.
Action: Store value named 'stake' for current selection (servant context selection) with Net stake of selection.

(2) Then I have created another stored value 'offset bet %' with another stored value 'stake', minus 25%

(3) Place a back bet, servant context price, with a stored value stake: 'offset bet %' for the current selection. And a simple condition 'The Net stake of current selection >0.
Type: Stored value condition
Value A: The Net Stake of a selection
is greater than
Value B: An entered amount 0

I've got the trigger rules all set the same, to always be armed, and allow to trigger one time only. Could the trigger times be conflicting I wonder! Maybe the back bet is firing before the stake value has been stored and calculated ๐Ÿค”

I think that'll be tomorrow, Im burnt out lol :ugeek:
You do not have the required permissions to view the files attached to this post.
User avatar
Brovashift
Posts: 475
Joined: Tue May 18, 2021 12:35 am

log file output.. ignore the columns, I had it on my tennis settings
You do not have the required permissions to view the files attached to this post.
eatyourgreens
Posts: 243
Joined: Sun Feb 18, 2018 12:53 am

Hi Brova,
I have a Mk3 for you to try, .......the Mk2 fried my brain and ended up on the scrap heap!

I have tested a few times (in practice mode) and it seemed to work ok, small problem that I will mentioned later.

load a market, or markets, into guardian and apply this rules file to them, then in the ladder screen (top right) ensure the staking method is set to "by liability (lay only)"

If you then use any of the "preset back and lay" boxes above the ladder, you can place either a back or lay bet. If you place a back bet, when it is fully matched, hopefully the rules file will kick in and place a two tick offset lay using 75% of the stake chosen from the preset box, the remaing 25% is left as a bet. Likewise, if you place a lay bet, when it is fully matched, the rules file should kick in and place a two tick offset back bet for 75% of the chosen stake, remaining 25% left as a bet.

The problem I came across was only due to "gappy" markets on US horses,.......When the intial back or lay bet is matched, the rules file stores a value of the "last traded price" , this price is then used for the two tick offset, due to the gappy markets and the odds going up and down like a tarts knickers, this stored last traded price was not always exactly the same as the matched odds, (but usually very close).

As mentioned, I am no auto expert, so I am sure there would be an easier way to do this, but I think this will still work.

Test in PRACTICE MODE !!!!!!

Goodluck,
have fun! :-)
one for brova mk3.baf
You do not have the required permissions to view the files attached to this post.
User avatar
Brovashift
Posts: 475
Joined: Tue May 18, 2021 12:35 am

Thanks eatyourgreens :)

Is that an old project or did you just put that together for me? Thanks either way ๐Ÿ‘ Unfortunately I couldn't get it to work as it wasn't entering a stake, even though the servant was activated. It did give me an idea though, to out put the stored value (stake) in a pop up message box, so I could know for sure if it was being captured or not.

I've actually managed to get most of it working now using just 2 rules, after I wrote it out last night and broke it down into 4 problems I needed to solve. Two really, the other 2 are just bells and whistles. I've only got it working with a back stake however atm. I could just do back and lay on 2 separate buttons, but that doesn't meet my original requirement of one button / one task, so that'll be my next challenge. Although if this morning is anything to go by its probably easier than I think. A good sleep helps lol.

If your interested, all I did was created a "place back bet" rule on Servant context selection, at servant context price, using servant context stake. And stored the stake as a stored value in the same rule.

Then created a temp rule to display 'stake' in a pop up message, just to make sure I was getting the correct amount.

And created my offset "place lay bet" rule on the servant context selection, at 'custom ticks below servant context price (Ticks 1), using 75% of servant context stake, with matched bet amount condition just to wait until the offset and initial stake amount match, to hopefully get them matched at the same time, or as close as possible.

Now I just need to repeat that for the Lay side (reversed), but get it to work on the one servant. Just thinking aloud; if I place a back stake, don't place a lay stake. In the words of Peter Webb (servants academy course) Servant: "Excuse me sir, but how will I place your offset lay bet if you dont want me to place a lay bet after placing an initial back bet?"
My Thoughts: "Humm you make a good point servant. Maybe we need to find a way to differentiate between an initial back/lay stake (main stake), and the secondary offset stake."
Servant: "Ah yes very good sir, your are very clever sir."
My Thoughts: "Get your nose out my arse, and wait for me to come back with a solution."
Servant: "Yes sir, sorry sir."
:lol:
If I spent more time working on the servant, instead of writing this sketch, I'd have had it done by now! :lol: :lol: Sometimes it just flows.
Shout out to Mr. Webb for making a brilliant and very entertaining Servants Academy course ๐Ÿ˜‚๐Ÿ‘Œ
eatyourgreens
Posts: 243
Joined: Sun Feb 18, 2018 12:53 am

:lol: :lol: :lol:

Pleased to hear you are finding a way!........well done Jeeves!

I am surprised the MK3 did not work for you, I have been testing it again this morning and it seems to work ok, regardless of the intial bet being a back or a lay, as soon as initial bet is fully matched using any preset box above ladder, an offset bet is placed immediately (for 75% of preset box liability, 2 tick offset)...... although I will admit it does not seem a very well constructed rules file, ........ :? I was getting tired after scrapping the Mk2, but determined to get it work :-)

Goodluck!
Have a nice day! :-)
eatyourgreens
Posts: 243
Joined: Sun Feb 18, 2018 12:53 am

Hi Brova,
I have just read through this thread again, and I am sure the MK3 does evrything you wanted.
What did you mean by :-
"๐Ÿ‘ Unfortunately I couldn't get it to work as it wasn't entering a stake"

The "stake" will be whatever preset box you have chosen........I just tried it with an obscure amount of ยฃ2.79 that I entered into one of those preset boxes and it worked fine :-)

If you apply the rules to a market, and then go to the ladder screen, you can choose any of the preset boxes above the ladder to place a back or lay bet (your "initial" bet)......when that bet is fully matched, the offset will automatically be place using 75% of the liability of the "intial" bet.

One thing that I did not mention is that it will currently only work on one bet per market (due to set up matched/unmatched etc.), so maybe you tried to run it more than once?

Give it another try, I am sure it does all you asked for with "one mouse click" :-)

I'm off to eat my greens!
User avatar
Brovashift
Posts: 475
Joined: Tue May 18, 2021 12:35 am

Hi mate,

I dont think I read your original post properly this morning... whoops! My bad. ๐Ÿ˜… Was I supposed to add the rules file to a market first e.g.
Guardian/Automation tab/select rules file/Apply to all markets?

I just selected it as a servant and was using Ctrl+right click. The servant was activating but wasn't placing a stake lol. I will go on the computer later and have another go ๐Ÿ‘๐Ÿป

Im not usually a morning person but was awake at 8am this morning thinking about this servant and thought sod it, might as well get up and have a crack at it now lol. Been shattered all day though ๐Ÿ˜ด

***********
* Update *
***********
Hey, I just tried it again like you said, and it works great, good job man! I can place either multiple back bets or lays bets per market. If I do all backs, no problem, all lays no problem, but if I do back lay back lay back lay on one market not all the backs place the offset. Obviously in this scenario none of the lays fire, as expected. This market is currently 11mins to post, none of my orders have been matched yet, but I can still hear periodic "blurp" like its trying to enter another order :?: I like the back and lay on one button, if you don't mind I am going to pick this apart and see if I can work some of it into mine ;) . Although looking at my mouse now there is 2 free buttons that are literally 0.5mm apart, I could, if I really had to, not be to lazy and place the back and lays on separate buttons. It just means I will have to retract my thumb the whole 0.5mm all the way back to a second button. Am I up for the extra work... :lol: One button would be better :mrgreen:

Is it just one stake amount as well?
Here is mine, super simple. Only works on the back side at the moment, but any stake. All the parts are here, just need to retro fit them together lol. If you have time, please try and break mine so I can iron out any flaws ๐Ÿค˜. Remember, its a servant, so just add to servants and Ctrl+mouse click. I don't think servants work if you add them to a market in guardian like "one for brova mk3" do they?

Think I've sussed the back&lay on one servant/button... Signals!
You do not have the required permissions to view the files attached to this post.
eatyourgreens
Posts: 243
Joined: Sun Feb 18, 2018 12:53 am

Hi Brova,
Glad you tried it again and it worked! but I am surprised that it worked (partially) more than once per market :o I would have thought conditions would have conflicted! I did not realise it would be a strategy that you would be repeating. The" initial "stake amount can be anything, I think any amount can be put into the preset boxes above ladder, and whichever box is highlighted will be the "initial" stake amount, and the rules file will do the rest once the initial bet is matched.

I have just downloaded your servant file to have a look but I cant open it because I am running an older version of BA...........and updating involves sooooo many mouse clicks!!(actually, I am on a laptop with a touch pad!)

Just to re-cap, you want to be on the ladder screen armed with your mouse, choose a stake amount from one of the preset boxes above the ladder, place a back or lay bet(s) on the ladder (either taking a price, or waiting as an order to be matched), When a bet is matched for "x" amount of liability, 75% of "x" is offset 1 tick and 25% of "x" is left, and both "initial" back or lay bets are to be placed using the same mouse button? I assume you will be using mouse pointer over back or lay side on the price you want.
If all above is correct I will give it some thought...........even though you seem to be doing better than me so far, getting yours going with just a couple of rules!!!

Have a nice day!
:-)
User avatar
Brovashift
Posts: 475
Joined: Tue May 18, 2021 12:35 am

Hey Greens ๐Ÿฅ— :)

Ahh it's all gone to pot today, not behaving the way I wanted it to. My original reason for creating the servant was actually for a lay strategy at specific prices, and to simply offset my green zone asap, so I've gone a bit off point by trying to get it to do the backing AND laying on one mouse click. I got all excited building something :D

I probably wont be getting in more than once, or at least I probably shouldn't be, but its good to have the option if you find things moving in your favour and the trade turns out to be a Whopper! Mine can enter twice and place the offsets, but it fails if entering a third time, doesn't place the offsets and so leaves you with a straight bet.
When I playing with these I just do random stuff, as well as the task the files are created to do, but also try and really test their limits to see if/when they break to know how robust they are. Better to break them in practice mode than to find they cant do something in a live market :mrgreen:

Yes thats pretty much what I am trying to do, although this morning I have been tinkering with some changes; i.e. 2 offsets 50% @1 tick and 16% @2 ticks, so it closes 66% (2/3) of my stake as it offset more of my green zone quicker while leaving a little more money on the table to manage. I've been playing with signals today trying to get it to only fire a back stake if the lay bet = false (no value), but it looks like the rules are fired in a linear order so Im not sure how to achieve this. But tbh I am only going to spend today on this and then wrap it up into something basic I can use next week, as tomorrow I want to start looking at Tennis data scraping using Python, or similar.

If I get this working with the bells and whistles I'll post a copy and you can take a look if/when you update BA. Thanks for all your help ๐Ÿ‘๐Ÿ’ช
Post Reply

Return to โ€œBet Angel - Servantsโ€