How do I record all the odds

Please post any questions regarding the program here.

Moderator: 2020vision

How do I record all the odds

Postby eightball » Sun Nov 30, 2014 7:03 pm

In the "F" column at the moment excel opens the next market? Example F5 = 3.2 How do I record this into another cell without it changing when the F5 cell updates? :?
eightball
 
Posts: 80
Joined: Thu Oct 23, 2008 5:26 pm

Re: How do I record all the odds

Postby rourkem » Thu Dec 04, 2014 9:19 pm

Hi EB, have you found anything that works for this by any chance already?
Windows 8 | Framework 2.0 Image
User avatar
rourkem
 
Posts: 166
Joined: Tue Oct 28, 2014 3:20 pm

Re: How do I record all the odds

Postby Captain Sensible » Fri Dec 05, 2014 1:40 pm

Do you know how to use VBA, probably the easiest soltion just to stick in a routine as you can then just expand it as you go along.

I'm assuming you're trying to freeze the first price of the market you opened and not the prices from the prev market? The following should just stick a copy of the F5:F60 prices into AA5:AA60 when the market changes, i.e. the value in A1 changes

Code: Select all
Private Sub Worksheet_Calculate()
Static MyMarket As Variant
Application.EnableEvents = False
Application.Calculation = xlCalculationManual

If [A1].Value = MyMarket Then
GoTo Xit
Else
MyMarket = [A1].Value
Range("AA5:AA60").Value = Range("F5:F60").Value = ""
End If
Xit:
Application.EnableEvents = True
Application.Calculation = xlCalculationAutomatic
End Sub
User avatar
Captain Sensible
 
Posts: 2923
Joined: Sat Nov 19, 2005 2:29 pm

Re: How do I record all the odds

Postby eightball » Mon Dec 08, 2014 8:03 pm

Captain Sensible wrote:Do you know how to use VBA, probably the easiest soltion just to stick in a routine as you can then just expand it as you go along.

I'm assuming you're trying to freeze the first price of the market you opened and not the prices from the prev market? The following should just stick a copy of the F5:F60 prices into AA5:AA60 when the market changes, i.e. the value in A1 changes

Code: Select all
Private Sub Worksheet_Calculate()
Static MyMarket As Variant
Application.EnableEvents = False
Application.Calculation = xlCalculationManual

If [A1].Value = MyMarket Then
GoTo Xit
Else
MyMarket = [A1].Value
Range("AA5:AA60").Value = Range("F5:F60").Value = ""
End If
Xit:
Application.EnableEvents = True
Application.Calculation = xlCalculationAutomatic
End Sub

Thanks for the your help, but it is having a problem with the following line. Range("AA5:AA60").Value = Range("F5:F60").Value = ""
eightball
 
Posts: 80
Joined: Thu Oct 23, 2008 5:26 pm

Re: How do I record all the odds

Postby Captain Sensible » Mon Dec 08, 2014 8:20 pm

Sorry about that just cut and pasted some code, it should have read as

Range("AA5:AA60").Value = Range("F5:F60").Value

So when the market changes it just put's the value of the F columns into AA column, probably wise to add Range("AA5:AA60").Value ="" before so it deletes any residual data from markets where there's more or less runners. I have something similar that just logs from a few minutes before the off so it's easy to tweak to your needs


Code: Select all
Private Sub Worksheet_Calculate()
Static MyMarket As Variant
Application.EnableEvents = False
Application.Calculation = xlCalculationManual

If [A1].Value = MyMarket Then
GoTo Xit
Else
MyMarket = [A1].Value
Range("AA5:AA60").Value =  ""
Range("AA5:AA60").Value = Range("F5:F60").Value
End If
Xit:
Application.EnableEvents = True
Application.Calculation = xlCalculationAutomatic
End Sub
User avatar
Captain Sensible
 
Posts: 2923
Joined: Sat Nov 19, 2005 2:29 pm

Re: How do I record all the odds

Postby Captain Sensible » Mon Dec 08, 2014 8:22 pm

Actually no need for that line, Range("AA5:AA60").Value =""

I was just wondering why I'd pasted it in but must have just been cos I'd cut and pasted stuff
User avatar
Captain Sensible
 
Posts: 2923
Joined: Sat Nov 19, 2005 2:29 pm

Re: How do I record all the odds

Postby eightball » Mon Dec 08, 2014 8:59 pm

Captain Sensible wrote:Sorry about that just cut and pasted some code, it should have read as

Range("AA5:AA60").Value = Range("F5:F60").Value

So when the market changes it just put's the value of the F columns into AA column, probably wise to add Range("AA5:AA60").Value ="" before so it deletes any residual data from markets where there's more or less runners. I have something similar that just logs from a few minutes before the off so it's easy to tweak to your needs


Code: Select all
Private Sub Worksheet_Calculate()
Static MyMarket As Variant
Application.EnableEvents = False
Application.Calculation = xlCalculationManual

If [A1].Value = MyMarket Then
GoTo Xit
Else
MyMarket = [A1].Value
Range("AA5:AA60").Value =  ""
Range("AA5:AA60").Value = Range("F5:F60").Value
End If
Xit:
Application.EnableEvents = True
Application.Calculation = xlCalculationAutomatic
End Sub

That works OK but, when a new event is loaded it still showing the odds from the previous one.
eightball
 
Posts: 80
Joined: Thu Oct 23, 2008 5:26 pm

Re: How do I record all the odds

Postby Captain Sensible » Mon Dec 08, 2014 10:31 pm

Have you checked macros are enabled etc maybe try with worksheet change instead

Code: Select all
Private Sub Worksheet_Change(ByVal Target As Range)
Static MyMarket As Variant

Application.EnableEvents = False
Application.Calculation = xlCalculationManual



If [A1].Value = MyMarket Then
GoTo Xit
Else
MyMarket = [A1].Value

Range("AA5:AA60").Value = Range("F5:F60").Value
End If
Xit:
Application.EnableEvents = True
Application.Calculation = xlCalculationAutomatic
   
   


End Sub
User avatar
Captain Sensible
 
Posts: 2923
Joined: Sat Nov 19, 2005 2:29 pm

Re: How do I record all the odds

Postby MiniBlueDragon » Tue Dec 09, 2014 9:52 pm

Hey Cap, you reckon this would be able to combine with the Excel "next market" cell (Q2?) to record odds, swap to next market and repeat (with range defined as a variable and a quick if check like IF Cell("AA5").Value = "" THEN range = "AB5") as an example?
MiniBlueDragon
 
Posts: 130
Joined: Tue Jul 05, 2011 1:14 pm
Location: London

Re: How do I record all the odds

Postby Captain Sensible » Tue Dec 09, 2014 10:40 pm

MiniBlueDragon wrote:Hey Cap, you reckon this would be able to combine with the Excel "next market" cell (Q2?) to record odds, swap to next market and repeat (with range defined as a variable and a quick if check like IF Cell("AA5").Value = "" THEN range = "AB5") as an example?


Everythings possible , I think there's a sheet somewhere on the forum that logs the markets in a loop.

You just need to think through exactly what you're hoping to acheive then look at the best way to accomplish that. Not sure what you're trying to do looping thru the markets, are you trying to gather data at set points or all market moves etc Are you looping once or continually to catch certain times? If you have a sheet continually looping to catch certain points it's actually better to log the data under the runner names rather than as a market cos you can just use thing like VLOOKUP to put the data back into the sheet once that market comes round again if you see what I mean.
User avatar
Captain Sensible
 
Posts: 2923
Joined: Sat Nov 19, 2005 2:29 pm

Re: How do I record all the odds

Postby MiniBlueDragon » Tue Dec 09, 2014 11:07 pm

Nothing complex actually; the plan is to click a button to move through all races in the Quick Pick list and record the current back odds for that race, then move to the next race and record those odds either underneath or to the side of the odds from that last race. Basically a snapshot of all markets at whatever time of day I run the script.

I don't think the implementation will be hard as I've done far more complicated VBA (I currently have a spreadsheet I coded which starts a timer for the day and then at the predefined time it stops the timer, goes off to a website, gathers all race times, names and web addresses for the day and then each time the market changes it looks up the correct race from that list, goes to the website again and pulls in all relevant racecard info for that race)

Do you know off hand what cell is used for "select next race" and how it's used perchance?
MiniBlueDragon
 
Posts: 130
Joined: Tue Jul 05, 2011 1:14 pm
Location: London

Re: How do I record all the odds

Postby Captain Sensible » Tue Dec 09, 2014 11:41 pm

That should be simple enough, I have something that just loops thru the markets and deletes certan types of markets, then dumps the the market names in a list.

The special triggers for moving thru markets go into Q2 (if A1 is your starting cell)
-1 goes to the next race
-2 the previous race
-5 goes to the first market in the list
-8 deletes athe market from the quick pick list

Guess the easiest way would be for you to have your routine within any Worksheet change or calculate routines already on the sheet and just have a macro button switch a cell to Yes then an if statement to trigger the copy macro routine. That'd allow you to have the macro run and reset , then just let the routine run and exit before any other coding, that way you can always reset the cell to No once it's reached the last market (when J3="L") and stick -5 in Q2 to send it back to the start. Dumping the data should be easy enough to a separate worksheet as you can just use something like this to find the last cell and dump the data under each other

Dim LastCell As Long
Worksheets("Sheet2").Range("A655").End(xlUp).Offset(1, 0).Row
Worksheets("Sheet2").Range("A" & LastCell) = Worksheets("Sheet1").Range("A1").Value
User avatar
Captain Sensible
 
Posts: 2923
Joined: Sat Nov 19, 2005 2:29 pm

Re: How do I record all the odds

Postby MiniBlueDragon » Thu Dec 11, 2014 2:38 am

Cheers Cap!

Am I being vacant here? I can't seem to get Q2 working in Betting Assistant for BetDaq:

Sheets("Gruss").Range("Q2").Value = "-5"
MiniBlueDragon
 
Posts: 130
Joined: Tue Jul 05, 2011 1:14 pm
Location: London

Re: How do I record all the odds

Postby Captain Sensible » Thu Dec 11, 2014 11:24 am

Not sure if the Betdaq version is as advanced as the Betfair one tbh, someone else will need to answer whether the special triggers work on the Betdaq one
User avatar
Captain Sensible
 
Posts: 2923
Joined: Sat Nov 19, 2005 2:29 pm

Re: How do I record all the odds

Postby MiniBlueDragon » Thu Dec 11, 2014 12:01 pm

It's going to be just my luck isn't it? lol :D
MiniBlueDragon
 
Posts: 130
Joined: Tue Jul 05, 2011 1:14 pm
Location: London

Next

Return to Help

Who is online

Users browsing this forum: Majestic-12 [Bot] and 53 guests

Sports betting software from Gruss Software


The strength of Gruss Software is that it’s been designed by one of you, a frustrated sports punter, and then developed by listening to dozens of like-minded enthusiasts.

Gruss is owned and run by brothers Gary and Mark Russell. Gary discovered Betfair in 2004 and soon realised that using bespoke software to place bets was much more efficient than merely placing them through the website.

Gary built his own software and then enhanced its features after trialling it through other Betfair users and reacting to their improvement ideas, something that still happens today.

He started making a small monthly charge so he could work on it full-time and then recruited Mark to help develop the products and Gruss Software was born.

We think it’s the best of its kind and so do a lot of our customers. But you can never stand still in this game and we’ll continue to improve the software if any more great ideas emerge.