Forums

General Betting

Welcome to Live View – Take the tour to learn more
Start Tour
There is currently 1 person viewing this thread.
Gin
27 Sep 14 10:45
Joined:
Date Joined: 02 Jun 03
| Topic/replies: 5,143 | Blogger: Gin's blog
I am using a spreadsheet to trigger lays into a market but have come up against a weird problem.

The price is taken from a cell in a separate worksheet – If I type a price into the correct cell in the worksheet the trigger works fine and fires the lay in. However, if I make that cell get the price from another worksheet (by typing in “=Market!G20”) it fires the lay in but in the “Bet Ref” column it shows as INVALID_PRICE and is rejected.

I have tried formatting the cells in different ways with no luck. Also if I simply copy and paste the value in it works fine.

Any suggestions?
Pause • Switch to Standard View Gruss – Excel problem
Show More
Loading...
Report dave1357 • September 27, 2014 12:19 PM BST
Have you tried putting =Market!G20 in a separate column to the right and then linking that cell to the price cell?
Report Gin • September 27, 2014 1:20 PM BST
I tried that Dave but it didn't make any difference.
Report Ghetto Joe • September 27, 2014 5:38 PM BST
Are you sure the price is a valid price within the Betfair increments, if so maybe try +Market!G20 as that should force it to be treated as a number
Report dave1357 • September 27, 2014 8:14 PM BST
Or try =ROUNDUP(Market!G20,0) that will round to whole numbers (obv no use for going to war, but might identify the problem)
Report IanP • September 27, 2014 11:05 PM BST
I have a sheet that does exactly what you are trying to do but I use VLOOKUP to get the price from the other sheet. The price doesn't need to be in Betfair increments , Gruss sorts that out , mine have three decimal places.
Report IanP • September 27, 2014 11:07 PM BST
I presume you are not typing the quotes around “=Market!G20” - that would be treated as text.
Report dave1357 • September 27, 2014 11:25 PM BST
The price doesn't need to be in Betfair increments , Gruss sorts that out , mine have three decimal places.  Interesting, I'm sure I tried something like "back 1.1 x last price matched" and it didn't work, must've messed up elsewhere
Report Gin • September 28, 2014 1:53 PM BST
Thanks for the replies – have tried/checked all suggestions to no avail.

So I then tried to make the trigger price cell fetch the price using the same VLookup formula as the original cell. It populates the cell with the correct price but then fires the lay in at the wrong price! (which appears to be the current odds price).

I originally based the spreadsheet on one that I downloaded from Gruss (“multiple Triggers” sample spreadsheet) so I didn’t write the code. Although it is simple looking, I am not very good with these things so it is obviously doing something that I didn’t realise.Blush

Not sure if the above makes sense! All I am trying to do is fire in a series of multiple lays at prices taken from another worksheet - I am obviously making it more difficult than it should be.................
Report Latalomne • September 28, 2014 5:13 PM BST
So the odds are still "current" per the Market sheet when it fires the bet?  Or is the Market sheet being constantly updated too?  (thus what were the odds you wanted to lay no longer are...)
Report Gin • September 29, 2014 11:49 AM BST
I realise on re-reading this that I haven’t made what I am trying to do very clear.

I am using the sample “multiple Triggers” spreadsheet from the Gruss website.

This has two worksheets, “Market” and “Triggers”.

The “Market” worksheet logs the usual market information from Gruss and has column Y labelled as “Trigger Step”.

The “Triggers” worksheet has three columns, “Trigger”, “Odds” and “Stake” with each following row showing your intended bet (eg. A2= “LAY”, B2= “1.41” and C2= “100” – so the first bet would be to Lay @ the price of 1.41 for £100).

The code is written so that when you enter a “1” in the Y column it fires in the bets from the “Triggers” worksheet for that team.

The code is as follows:

Private Sub Worksheet_Change(ByVal Target As Range)
    Dim r As Integer, triggerRow As Integer
    If Target.Columns.Count = 16 Then
        Application.EnableEvents = False
        With ThisWorkbook.Worksheets("Triggers")
            For r = 5 To 54
                If Cells(r, 25)  "" Then
                    triggerRow = Cells(r, 25) + 1
                    .Range(.Cells(triggerRow, 1), .Cells(triggerRow, 3)).Copy Range(Cells(r, 17), Cells(r, 19))
                    If Cells(r, 17) = "CANCEL-ALL" Then Cells(r, 20) = "ALL" Else Cells(r, 20) = ""
                    If Cells(r, 17) = "" Then Cells(r, 25) = "" Else Cells(r, 25) = triggerRow
                End If
            Next
        End With
        Application.EnableEvents = True
    End If
End Sub


If I simply type the odds into the “Triggers” worksheet and then trigger the code, the bets are placed with no problem. However, If I try to populate the “Odds” column in a different way by either making the cell = a different cell (=Market!G20) or directly entering the VLOOKUP formula that Market!G20 uses in the first place then the bets are not placed with the Bet Ref column showing “INVALID_PRICE” when trying to enter the bets.

The table used for the VLOOKUP only contains valid Betfair increments.
Report dave1357 • September 29, 2014 12:01 PM BST
does it work if you just put eg = aa20 in the cell and write 2.5 in aa20?  If it doesn't it would appear that the cell will only accept manual input ie it always reads "=aa20" and not the value that us humans can see?
Report Gin • September 29, 2014 12:32 PM BST
No, that doesn't work Dave.

The problem is, why will it only accept manual input?
Report dave1357 • September 29, 2014 1:10 PM BST
btw on the standard gruss spreadsheet with last price in the O column, trigger in the Q column and odds in the R, I have put =05 in the odds cell and it works fine.
Report Gin • September 29, 2014 3:03 PM BST
I have found a small workaround for now by writing a macro to copy and paste the cell values into the appropriate cells on the “Triggers” worksheet – all it means is an extra button press before triggering the LAYS which is still much quicker and I only want to use the spreadsheet when I am actually sat in front of it so its no problem.

It still seems strange though so I will post the problem on the Gruss forum (the reason I posted on here first was that there doesn’t seem much activity over there.

Thanks for the replies.
Report dave1357 • September 29, 2014 3:26 PM BST
Cheers please update this thread if you find out the problem as it does seem odd
Report mja • September 29, 2014 4:48 PM BST
Looks like the trigger code is copying cells in columns A, B and C to Q, R and S so the Odds values that are considered invalid would actually be in column R. I suspect that the copy is modifying the formula - have you tried using "=Market!$G$20" in column B so it always points to a fixed cell reference ?
Report Ghetto Joe • September 29, 2014 5:32 PM BST
Haven't seen the full sheet but does it use VBA to populate the odds columns, if they're blank when it triggers it'd give the error or even if it's taking that data as text rather than numbers. Might just need the code amend to things like .Cells(triggerRow, 1).value . Hard to see where it's going wrong without the actual sheet but becuase figures are being gathered and entered by VBA it's not as simple as it first seemed
Report Gin • September 29, 2014 8:05 PM BST
mja
Your fixed cell reference solution has worked! Cheers!

Thanks agian for all the other replies.
Post Your Reply
<CTRL+Enter> to submit
Please login to post a reply.

Wonder

Instance ID: 13539
www.betfair.com