logging a price at 2 different time intervals

Please post any questions regarding the program here.

Moderator: 2020vision

logging a price at 2 different time intervals

Postby nhmaster » Wed Apr 23, 2008 2:34 pm

does anyone know what formula I would use to to record a price 15 mins before the off and another 2 minutes before the off

cheers Shaun
User avatar
nhmaster
 
Posts: 29
Joined: Sat Nov 19, 2005 8:49 am
Location: Tenerife

Postby phrenetic » Wed Apr 23, 2008 8:51 pm

I think you need to rely on VBA to achieve what you want.

Alistair
phrenetic
 
Posts: 142
Joined: Tue Oct 16, 2007 8:44 pm

To Alistar..........Phonetic

Postby nhmaster » Thu Apr 24, 2008 8:57 am

Hi Alistar

Must admit not my strong point OK with excel not done much VBA can you throw any light?? Oh how are you getting on with the Safebet plan I sent??

Shaun
User avatar
nhmaster
 
Posts: 29
Joined: Sat Nov 19, 2005 8:49 am
Location: Tenerife

Postby Captain Sensible » Thu Apr 24, 2008 12:41 pm

Heres some code I used once to log the odds prices at various intervals


Private Sub Worksheet_Change(ByVal Target As Range)
lastrow = Target.Rows.Count
If Target.Columns.Count <> 16 Then Exit Sub
Application.EnableEvents = False
If Cells(2, 4) > Cells(4, 35) Then
If Cells(2, 4) < Cells(3, 35) Then
For i = 5 To 35
Cells(i, 30) = Cells(i, 6)
Next i
Else
Cells(1, 31) = "Done 10"
End If
Application.EnableEvents = True

Else

Application.EnableEvents = True
End If


If Target.Columns.Count <> 16 Then Exit Sub
Application.EnableEvents = False
If Cells(2, 4) > Cells(6, 35) Then
If Cells(2, 4) < Cells(5, 35) Then
For i = 5 To 35
Cells(i, 31) = Cells(i, 6)
Next i
Else
Cells(1, 32) = "Waiting to log"
End If
Application.EnableEvents = True

Else

Application.EnableEvents = True
End If


End Sub


Basically you just press Alt + F11 ad paste it into the excel visual basic page.

I'd had it set to have a first logging start time and end time in AI3 and AI4
and the second logging start times in AI5 & AI6

The prices from the available to back column F then get pasted into AD first log and AE respectively. Just play around with it to change the data you want to log i.e. last price matched or lay columns and the columns you want it pasted into remembering Cells(2, 4) refers to D2 i.e first number is row number and second number column letter so Cells(6,35) is AI6 etc
User avatar
Captain Sensible
 
Posts: 2923
Joined: Sat Nov 19, 2005 2:29 pm

Postby Shaun » Tue May 13, 2008 6:03 am

Glad i did a search of this forum, this is the code i have been trying to work out for days, nobody on other forums seam to understand exactly what i need.

Thanks Shaun
Shaun
 
Posts: 435
Joined: Fri May 09, 2008 11:11 pm
Location: Kellerberrin, Western Australia

Postby drewrell » Fri Mar 05, 2010 1:27 pm

Captain Sensible wrote:Heres some code I used once to log the odds prices at various intervals


Private Sub Worksheet_Change(ByVal Target As Range)
lastrow = Target.Rows.Count
If Target.Columns.Count <> 16 Then Exit Sub
Application.EnableEvents = False
If Cells(2, 4) > Cells(4, 35) Then
If Cells(2, 4) < Cells(3, 35) Then
For i = 5 To 35
Cells(i, 30) = Cells(i, 6)
Next i
Else
Cells(1, 31) = "Done 10"
End If
Application.EnableEvents = True

Else

Application.EnableEvents = True
End If


If Target.Columns.Count <> 16 Then Exit Sub
Application.EnableEvents = False
If Cells(2, 4) > Cells(6, 35) Then
If Cells(2, 4) < Cells(5, 35) Then
For i = 5 To 35
Cells(i, 31) = Cells(i, 6)
Next i
Else
Cells(1, 32) = "Waiting to log"
End If
Application.EnableEvents = True

Else

Application.EnableEvents = True
End If


End Sub


Basically you just press Alt + F11 ad paste it into the excel visual basic page.

I'd had it set to have a first logging start time and end time in AI3 and AI4
and the second logging start times in AI5 & AI6

The prices from the available to back column F then get pasted into AD first log and AE respectively. Just play around with it to change the data you want to log i.e. last price matched or lay columns and the columns you want it pasted into remembering Cells(2, 4) refers to D2 i.e first number is row number and second number column letter so Cells(6,35) is AI6 etc


Have just started using this and works great but how do I clear the data from the excel sheet when the next race loads?
I have them to auto load but the recorded data from the earlier race is still there.

Thanks
drewrell
 
Posts: 28
Joined: Tue Sep 25, 2007 1:30 pm

Postby Captain Sensible » Fri Mar 05, 2010 8:44 pm

Try this code, hopefully it'll work as I haven't tested it

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("AD5:AE50").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


Return to Help

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 41 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.