I'm new to BA and am having some typical newbie issues.
I'm using excel, and using the IF function to BACK.
I want to simultaneously place multiple bets on the same horse when a trigger is met: e.g 1 bet at the market price, and another bet at market +5%. and another bet at market +10%.
I've searched without finding an answer, although I'm sure this is a common problem.
Would appreciate a link / some guidance.
Thanks.
Excel: place multiple bets at different prices on same selection
-
- Posts: 575
- Joined: Wed Apr 19, 2017 5:12 pm
Is your IF function the sole trigger for all three bets? I.e. IF(A1="Yes","BACK","")?
If this is the case you could just look at one of the readily available spreadsheets that clears the contents of the PLACED cell when your first bet (at market price) bet reaches the market and run a quick bit of code that immediately does the following:
Clear PLACED
Trigger 2nd Bet at Market +5%
Clear PLACED
Trigger 3rd Bet at Market +10%
The bets would only be going in milliseconds apart which even on quick moving markets would be fine as the price 'shouldn't' move all the way up to +5/10% as quick as you can get your bet there so you 'should' comfortably be at the front of the queen waiting.
If this is the case you could just look at one of the readily available spreadsheets that clears the contents of the PLACED cell when your first bet (at market price) bet reaches the market and run a quick bit of code that immediately does the following:
Clear PLACED
Trigger 2nd Bet at Market +5%
Clear PLACED
Trigger 3rd Bet at Market +10%
The bets would only be going in milliseconds apart which even on quick moving markets would be fine as the price 'shouldn't' move all the way up to +5/10% as quick as you can get your bet there so you 'should' comfortably be at the front of the queen waiting.
-
- Posts: 575
- Joined: Wed Apr 19, 2017 5:12 pm
PM me if you'd like.
By all means have a go first as it's a great skill to learn but if you get stuck I now consider myself slightly above the beginner level
It's such a wide field this coding stuff, especially if like me you are completely new to it before discovering BA.
By all means have a go first as it's a great skill to learn but if you get stuck I now consider myself slightly above the beginner level

If anyone is interested, I finally found a reasonable working solution to this, 3 months later, using DoWhile & DoEvents & a quick refresh rate:
For j = 9 To 55 Step 2
If (conditions are met)
Range("L" & j).Formula = "=""BACK"""
Do While Range("O" & j).Value = ""
DoEvents
Loop
Range("O" & j).Value = ""
(Add subsequent bets)
End If
Next j
There are probably tidier more efficient ways, but this works for me atm.
The DoWhile waits for PLACING or PLACED, then clears that, so you can proceed to the next task, and the DOEvents means that Excel doesnt freeze.
The problem I was having was I couldnt find a way to tell excel to Do Nothing and Wait until it could clear the Status cell. This fixes that, clumsily, and now I dont have to keep calling other macros to check that everything is in place.
For j = 9 To 55 Step 2
If (conditions are met)
Range("L" & j).Formula = "=""BACK"""
Do While Range("O" & j).Value = ""
DoEvents
Loop
Range("O" & j).Value = ""
(Add subsequent bets)
End If
Next j
There are probably tidier more efficient ways, but this works for me atm.
The DoWhile waits for PLACING or PLACED, then clears that, so you can proceed to the next task, and the DOEvents means that Excel doesnt freeze.
The problem I was having was I couldnt find a way to tell excel to Do Nothing and Wait until it could clear the Status cell. This fixes that, clumsily, and now I dont have to keep calling other macros to check that everything is in place.
After 5 years is there an update on how to do this?
I have started using Excel and would like to place opposing bets at a certain % above and below the Average prices. Excel only allows to place 1 bet so how do you clear the status cell only once and then place an opposing bet.
I have cells that calculate the odds and liability stakes at which i would like place the bets and depending on where the price is to these possible 4 price levels I would like to place the bets at (but only 1 above and 1 below).
So there are 4 scenarios:
If LTP at 2mtp is >=AVG+20% price then place a Back bet at Best Market Price using liability stake for the BMP on the Back side
If LTP at 2mtp is <AVG+20% price then place a Back bet at AVG+20% Price using liability stake for AVG+20% price
If LTP at 2mtp is <=AVG-20% price then place a Lay bet at BMP using liability stake for the BMP on the Lay side
If LTP at 2mtp is >AVG-20% price then place a Lay bet at AVG-20% Price using liability stake for AVG-20% price
Hedge at 0mtp
I have cells for these odds and stakes I just need to get BA/Excel to place the relevent bets at the relevent prices using the relevent stakes. Its easy to manually do this but I'd like to automate it, and just need this extra step to complete.
Maybe there is an easier way using BA automation, but I cannot get the absolute highs and lows as there isnt a choice in the automation store value options, only a choice to store the high and low so many mintues before and I dont want to keep my PC on all the time to get that data when it is available on the Overview but not in the BA stored values.
I have started using Excel and would like to place opposing bets at a certain % above and below the Average prices. Excel only allows to place 1 bet so how do you clear the status cell only once and then place an opposing bet.
I have cells that calculate the odds and liability stakes at which i would like place the bets and depending on where the price is to these possible 4 price levels I would like to place the bets at (but only 1 above and 1 below).
So there are 4 scenarios:
If LTP at 2mtp is >=AVG+20% price then place a Back bet at Best Market Price using liability stake for the BMP on the Back side
If LTP at 2mtp is <AVG+20% price then place a Back bet at AVG+20% Price using liability stake for AVG+20% price
If LTP at 2mtp is <=AVG-20% price then place a Lay bet at BMP using liability stake for the BMP on the Lay side
If LTP at 2mtp is >AVG-20% price then place a Lay bet at AVG-20% Price using liability stake for AVG-20% price
Hedge at 0mtp
I have cells for these odds and stakes I just need to get BA/Excel to place the relevent bets at the relevent prices using the relevent stakes. Its easy to manually do this but I'd like to automate it, and just need this extra step to complete.
Maybe there is an easier way using BA automation, but I cannot get the absolute highs and lows as there isnt a choice in the automation store value options, only a choice to store the high and low so many mintues before and I dont want to keep my PC on all the time to get that data when it is available on the Overview but not in the BA stored values.
gstar1975 wrote: ↑Thu Mar 21, 2024 11:59 amAfter 5 years is there an update on how to do this?
I have started using Excel and would like to place opposing bets at a certain % above and below the Average prices. Excel only allows to place 1 bet so how do you clear the status cell only once and then place an opposing bet.
I have cells that calculate the odds and liability stakes at which i would like place the bets and depending on where the price is to these possible 4 price levels I would like to place the bets at (but only 1 above and 1 below).
So there are 4 scenarios:
If LTP at 2mtp is >=AVG+20% price then place a Back bet at Best Market Price using liability stake for the BMP on the Back side
If LTP at 2mtp is <AVG+20% price then place a Back bet at AVG+20% Price using liability stake for AVG+20% price
If LTP at 2mtp is <=AVG-20% price then place a Lay bet at BMP using liability stake for the BMP on the Lay side
If LTP at 2mtp is >AVG-20% price then place a Lay bet at AVG-20% Price using liability stake for AVG-20% price
Hedge at 0mtp
I have cells for these odds and stakes I just need to get BA/Excel to place the relevent bets at the relevent prices using the relevent stakes. Its easy to manually do this but I'd like to automate it, and just need this extra step to complete.
Maybe there is an easier way using BA automation, but I cannot get the absolute highs and lows as there isnt a choice in the automation store value options, only a choice to store the high and low so many mintues before and I dont want to keep my PC on all the time to get that data when it is available on the Overview but not in the BA stored values.
Can you write VBA at all gstar?
It is easy to write cell functions for what you want using cell formulas, however there is a major hiccup using the BA countdown timer to the event in Excel, in that the BA countdown timer can miss actual times and may not count every second. So if you set a cell to do something when the timer hits 2 minutes to go, if the timer jumps from 2 minutes and 1 second to go to 1 minute and 59 seconds to go, your cell formula will not activate.
There are ways around it, but it gets very complicated very quickly.
I have it set to trigger if the cell with the timer is less than 2mins and it works. So no problem there. I just need to place 2 opposing bets and need to know how to clear the cell automatically, and place an opposing bet at a specific price worked out in formula from the workbook.conduirez wrote: ↑Thu Mar 21, 2024 1:10 pmgstar1975 wrote: ↑Thu Mar 21, 2024 11:59 amAfter 5 years is there an update on how to do this?
I have started using Excel and would like to place opposing bets at a certain % above and below the Average prices. Excel only allows to place 1 bet so how do you clear the status cell only once and then place an opposing bet.
I have cells that calculate the odds and liability stakes at which i would like place the bets and depending on where the price is to these possible 4 price levels I would like to place the bets at (but only 1 above and 1 below).
So there are 4 scenarios:
If LTP at 2mtp is >=AVG+20% price then place a Back bet at Best Market Price using liability stake for the BMP on the Back side
If LTP at 2mtp is <AVG+20% price then place a Back bet at AVG+20% Price using liability stake for AVG+20% price
If LTP at 2mtp is <=AVG-20% price then place a Lay bet at BMP using liability stake for the BMP on the Lay side
If LTP at 2mtp is >AVG-20% price then place a Lay bet at AVG-20% Price using liability stake for AVG-20% price
Hedge at 0mtp
I have cells for these odds and stakes I just need to get BA/Excel to place the relevent bets at the relevent prices using the relevent stakes. Its easy to manually do this but I'd like to automate it, and just need this extra step to complete.
Maybe there is an easier way using BA automation, but I cannot get the absolute highs and lows as there isnt a choice in the automation store value options, only a choice to store the high and low so many mintues before and I dont want to keep my PC on all the time to get that data when it is available on the Overview but not in the BA stored values.
Can you write VBA at all gstar?
It is easy to write cell functions for what you want using cell formulas, however there is a major hiccup using the BA countdown timer to the event in Excel, in that the BA countdown timer can miss actual times and may not count every second. So if you set a cell to do something when the timer hits 2 minutes to go, if the timer jumps from 2 minutes and 1 second to go to 1 minute and 59 seconds to go, your cell formula will not activate.
There are ways around it, but it gets very complicated very quickly.
also looking to do similar re back and lay at same time with conditions included.
i get the VB part to remove 'placed' so that next iterative set of bet orders can come in; but to do at basic level first, e.g. excel sheets with formulas + VB then can this not be done by having 2 worksheets set up for: 1. lay and 2. back?
still needs to remove the placed with VB but easier to do at worksheet level?
next query, if speed of execution of orders is key, then should this be developed into VBA, or use betangel api and code into 'lower' language e.g. c#?
thanks in advance.
r
i get the VB part to remove 'placed' so that next iterative set of bet orders can come in; but to do at basic level first, e.g. excel sheets with formulas + VB then can this not be done by having 2 worksheets set up for: 1. lay and 2. back?
still needs to remove the placed with VB but easier to do at worksheet level?
next query, if speed of execution of orders is key, then should this be developed into VBA, or use betangel api and code into 'lower' language e.g. c#?
thanks in advance.
r
Untested but have a look.
On sheet 2 I have the name of the runner that I am trading. The formula next to it just identifies which row it's on in the Bet Angel sheet.
You can see that I want to back it at odds of 5.0 for a stake of £10. I'm just waiting for the 'placed' confirmation and the back bet info to show '1'
Put 'PLACED' into O9 and '1' into AB10.
A message box will pop up (Don't forget to delete this line!), confirming that the bet has been accepted.
It will now show 'LAY' and the odds and stake cells are now empty, waiting for you to enter the offset bet details.
Note: All 3 conditions ( THE BACK BET, THE PLACED CONFIRMATION AND BET COUNT HAVE TO BE MET) for it to work.
On sheet 2 I have the name of the runner that I am trading. The formula next to it just identifies which row it's on in the Bet Angel sheet.
You can see that I want to back it at odds of 5.0 for a stake of £10. I'm just waiting for the 'placed' confirmation and the back bet info to show '1'
Put 'PLACED' into O9 and '1' into AB10.
A message box will pop up (Don't forget to delete this line!), confirming that the bet has been accepted.
It will now show 'LAY' and the odds and stake cells are now empty, waiting for you to enter the offset bet details.
Note: All 3 conditions ( THE BACK BET, THE PLACED CONFIRMATION AND BET COUNT HAVE TO BE MET) for it to work.
You do not have the required permissions to view the files attached to this post.