Auto staking based on hedged outcome

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.
tico
Posts: 49
Joined: Fri Sep 20, 2024 9:18 pm

Hi All,

Concerning VBA ,providing you know where to place the code in Excel ,and how to run a macro ,you can just get Perplexity ai or better still Deepseek ai to write the code for you .
This is great because VBA code is extremely verbose ,and writing the stuff makes fingers and brain ache :lol:
Kind Regards
Tico
User avatar
ShaunWhite
Posts: 10354
Joined: Sat Sep 03, 2016 3:42 am

tico wrote:
Fri Jan 31, 2025 12:09 pm
Hi All,

Concerning VBA ,providing you know where to place the code in Excel ,and how to run a macro ,you can just get Perplexity ai or better still Deepseek ai to write the code for you .
This is great because VBA code is extremely verbose ,and writing the stuff makes fingers and brain ache :lol:
Kind Regards
Tico
Or record the macro with Excel to do the bulk of the code and mod if necessary.
User avatar
Blondie
Posts: 159
Joined: Mon Dec 23, 2024 2:34 pm

Dallas wrote:
Tue Jan 21, 2025 1:24 pm
Blondie wrote:
Tue Jan 21, 2025 1:02 pm
tico wrote:
Sun Jan 19, 2025 5:03 pm
Hi Blondie,

I was just wondering if this could be done in Excel (using VBA perhaps) I used to do something similar year ago on other software ,but similarly BA also facilitates the use of Excel . I Have used excel with software(BA) to say things like 'If a price falls below a certain level then lay/bet it in relation to volume etc etc blah blah ad infinitum '.So there is a possibility that you could automate most other stuff.
Kinders
tico
Title of the thread wasn't a good choice! I am not looking at any automation stuff, just want to get my P&L tracking soon to see which race types win/lose me the most. But looks like you need to be an Excel guru to do that!
Try this method, no excel skill needed just a bit of copy/pasting at the end of each day
viewtopic.php?t=12327
Sorry, bit confused. That spreadsheet/thread you suggested - Do I have to actually punch data in manually after each trade? It doesn't pull data from Betfair?
User avatar
Blondie
Posts: 159
Joined: Mon Dec 23, 2024 2:34 pm

Have to ask again as its bothering me. i have a few ideas for trading strategies. I want to test one at a time. I can do it on any ladder - whichever one suits best. But i am having big mental struggle with how to get a fair test where it doesnt get affected by the odds.

I am using auto staking 'by tick size'. But that doesnt include greening. So i am trying to click enough times to make it 50p per tick on whatever ladder but that varies a lot. i dont want to find the test suggests it works on runners priced lower than 3 but doesnt make as much on runners priced over 6 or over 10. Its going to end up misleading me when it may work fine on bigger price ladders but its just the staking making the profit and loss look worse on the higher prices.

I cant think of any way to LEVEL everyhing out which is what I want to do. So no matter which price/ladder i try it on, x number of ticks equals the same amount of profit or loss. so if i do it at 2.2 and get 10 green ticks, i want the PandL to show the same if i did it at price of 10.5 and got ten green ticks.

Is this levelling out possible somehow?
User avatar
ShaunWhite
Posts: 10354
Joined: Sat Sep 03, 2016 3:42 am

Liability staking (back and lay) is your best option.

It's impossible to get a precise hedged amount per tick across the ladder as the hedge bet price is an unknown when you placed it's opening bet. Try it with a pencil and paper and you'll see the issue. Ie do a few paper examples and work out what you'd want the stake to be if you say, backed at 4 but closed at either 3.5 or 2.5.

You could also adjust the actual stake amounts to your theoretical staking when you're breaking down you bet history, and put your own 'clean' market subtotals in.
User avatar
Blondie
Posts: 159
Joined: Mon Dec 23, 2024 2:34 pm

Not sure I understood. Here's why:

If I choose ungreened in profit and loss column, after I open a trade that column shows all the figures I would win or loss if i close at that price. I dont understand why that cant be done with greening turned on. I know I am probably missing something obvious, but if it can do it without greening why cant it do it with greening?

But forgetting about that, if i assume it just cant be done, whats the next closest way?

you saiid to use liability staking. Not sure why that is better than my option to stake by tick size? would that somehow bring me closer to what i want to do?

I wish i could just have my P&L show how many TICKS (green or red), and ignore pouinds and pence altogether. that would be way easier to use for working out the success or failure of what im trying to do
User avatar
ShaunWhite
Posts: 10354
Joined: Sat Sep 03, 2016 3:42 am

Blondie wrote:
Mon Mar 24, 2025 3:54 pm
Not sure I understood. Here's why:

If I choose ungreened in profit and loss column, after I open a trade that column shows all the figures I would win or loss if i close at that price. I dont understand why that cant be done with greening turned on. I know I am probably missing something obvious, but if it can do it without greening why cant it do it with greening?
The scales icon at the top of the screen toggles between hedge and unhedged figures,

If you're looking for the same gain or loss per tick then you can't do that, if you back then the hedged amount per tick gets smaller as you go up the ladder and bigger as you go down.

So you want to see the hedged col showing the same £/tick difference up and down the ladder?

Are you able to do that with your pencil and paper workings out? If you could show that it would be helpful. Eg a back bet, then several lay hedges that have an equal amount per tick of difference to the original back.
User avatar
ShaunWhite
Posts: 10354
Joined: Sat Sep 03, 2016 3:42 am

Try to reproduce this... the only slightly tricky column is the hedged figure so i left that calc visible.
Screenshot_25.jpg
You do not have the required permissions to view the files attached to this post.
User avatar
Blondie
Posts: 159
Joined: Mon Dec 23, 2024 2:34 pm

I think i have a piece missing inside my brain! I find it very hard to understand the above. Grateful for your time and effort tho.

"So you want to see the hedged col showing the same £/tick difference up and down the ladder?"

That's not what I want to do no. But maybe it would do that if I got what I want.

What I want is to test a strategy with known quantities of ticks, win or lose, across say 100 trades.

So lets say I come up with a strategy i hope to try learning to automate one day. Lets say my strategy is to back every ladder when it breaks 2 ticks outside its range, and vice versa with laying if it goes up out of range 2 ticks.

I want to see the win/loss ratio of 100 trades. But if I am judging it by profit and loss - in pounds and pence - then it the judgement will be skewed because if i use flat stakes across all ladders at all prices, the hedged amounts are much smaller on bigger prices.

This is why I am using auto staking based on tick size. That works fine with hedging turned off but i obviously hedge before the race runs so my PandL might show I made £5 on ladder 4 in a race, but made £20 on ladder 1 in another race - even though the number of ticks gained was the same!

I wish there was a way to automate stake sizes by a levelled out PandL outcome, so if i get 10 green ticks on ladder 1 at prices of 2.x, and 10 green ticks on ladder 4 at prices of 10.x - the net hedged profit is the exact same amount.
I think you're saying it can';t be done and i dont doubt that if you say so.

If thayts the case then I wonder if the next best thing might be to try and find a way to record the number of TICKS green and red for all trades, and use those numbers to judge a strategy rather than pounds and pence.

Does that make more sense?
User avatar
Blondie
Posts: 159
Joined: Mon Dec 23, 2024 2:34 pm

PS I notice that I can do this sort of thing manually which is whats making me reckon it prob can be done automatically somehow.

If i set staking to By Tick Size, the stakes vary from about £20 down to £2 depending on ladder prices. But if I have greening turned on, I can sort of manually do it by watching the differences between the tick sizes in pounds and pence. So if a ladder is at price of 24 it will enter a £2 stake automatically when i click, but i can wait til its matched, see that the pounds and pence between theticks is not enough and then add another stake or two, sometimes more until it shows the amounts i want.

So one click on price of 2.2 may give me the required amount per tick in money - lets call it £1, but a click on ladder at price of 24 using £2 stake might only be 20p difference per tick (greened) so i just have to click 5 times. This clicking is difficult because the price will usually move before i get enough stakes in. that affects the strategy and profit and loss.

I just thougt because i can manualy click enough times to get the same amount on a 24 ladder as a 2.2 ladder, maybe the software can do this magically with settiings
Post Reply

Return to “Bet Angel for newbies / Getting started”