Forums

General Betting

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?

Post your reply

Text Format: Table: Smilies:
Forum does not support HTML
Insert Photo
Cancel
sort by:
Show
per page
Replies: 18
By:
dave1357
When: 27 Sep 14 12:19
Have you tried putting =Market!G20 in a separate column to the right and then linking that cell to the price cell?
By:
Gin
When: 27 Sep 14 13:20
I tried that Dave but it didn't make any difference.
By:
Ghetto Joe
When: 27 Sep 14 17:38
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
By:
dave1357
When: 27 Sep 14 20:14
Or try =ROUNDUP(Market!G20,0) that will round to whole numbers (obv no use for going to war, but might identify the problem)
By:
IanP
When: 27 Sep 14 23:05
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.
By:
IanP
When: 27 Sep 14 23:07
I presume you are not typing the quotes around “=Market!G20” - that would be treated as text.
By:
dave1357
When: 27 Sep 14 23:25
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
By:
Gin
When: 28 Sep 14 13:53
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.................
By:
Latalomne
When: 28 Sep 14 17:13
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...)
By:
Gin
When: 29 Sep 14 11:49
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.
By:
dave1357
When: 29 Sep 14 12:01
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?
By:
Gin
When: 29 Sep 14 12:32
No, that doesn't work Dave.

The problem is, why will it only accept manual input?
By:
dave1357
When: 29 Sep 14 13:10
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.
By:
Gin
When: 29 Sep 14 15:03
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.
By:
dave1357
When: 29 Sep 14 15:26
Cheers please update this thread if you find out the problem as it does seem odd
By:
mja
When: 29 Sep 14 16:48
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 ?
By:
Ghetto Joe
When: 29 Sep 14 17:32
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
By:
Gin
When: 29 Sep 14 20:05
mja
Your fixed cell reference solution has worked! Cheers!

Thanks agian for all the other replies.
sort by:
Show
per page

Post your reply

Text Format: Table: Smilies:
Forum does not support HTML
Insert Photo
Cancel
‹ back to topics
www.betfair.com