BA with 2 or more tabs showing the same market

Discuss anything related to using the program (eg. triggered betting tactics)

Moderator: 2020vision

BA with 2 or more tabs showing the same market

Postby ddaann » Tue Sep 07, 2010 3:23 pm

I'm using new beta version which is supposed to share API requests for the same market open in multiple tabs. I have two open tabs (plan to another some more) all linked to the same Excel file (each tab is different sheet). During prerace time I do lot of different things and it can get quite hectic, resulting in me forgetting to change tab2 to the same market as tab1. Autoselect market unfortunately doesn't suit my needs, as i sometimes change to different markets at different times. So my question is how can i make tab2 (and further tabs) show the same market as tab1. If that is currently not possible, are there any plans in future versions.
Many thanks
Dan
ddaann
 
Posts: 53
Joined: Thu Oct 12, 2006 6:39 pm

Postby GaryRussell » Wed Sep 08, 2010 6:42 am

The feature was only designed to shared requests when both tabs are displaying the same market. It does not force all tabs to show the same market. When you say you change to markets at different times, are you doing this manually or with a Q2 trigger?

Here is an example sheet which uses the "GO:" trigger in cell Q2 to change the market on sheet2 to the same as sheet1.
http://www.gruss-software.co.uk/Excel/SyncMarkets.xls

For more markets just edit the code in sheet1 module. For example to add a third sheet the code would read as follows.
Code: Select all
Private Sub Worksheet_Change(ByVal Target As Range)
    If Target.Columns.Count = 16 Then
        If [A1] <> currentMarket Then
            Application.EnableEvents = False
            ThisWorkbook.Worksheets("sheet2").Range("Q2") = "GO:" & [N3]
            ThisWorkbook.Worksheets("sheet3").Range("Q2") = "GO:" & [N3]
            Application.EnableEvents = True
        End If
        currentMarket = [A1]
    End If
End Sub


Unfortunately while testing this I discovered that the Beta version has a bug which causes the GO: trigger to be processed slowly. It sometimes takes up to 10 seconds to change markets. While this delay is occuring it's no longer being refreshed with the old market data though. This bug only exists in the Beta version. I will fix it in the next release.
User avatar
GaryRussell
Site Admin
 
Posts: 9872
Joined: Fri Nov 18, 2005 8:09 pm
Location: Birmingham, UK

Postby ddaann » Wed Sep 08, 2010 3:17 pm

Thanks a lot Gary, this is what I was looking for.
ddaann
 
Posts: 53
Joined: Thu Oct 12, 2006 6:39 pm

Postby ddaann » Wed Sep 08, 2010 6:45 pm

One slight problem Gary, as you can expect from Excel newbie like myself. This worked great on blank excel sheets, however on my sheet I already have one sub Worksheet_Change, and there is error message if i put them together. If i put your code in Sheet1 module nothing happens. Can you suggest something please. BTW I tried putting GO: with market id from sheet1 in q2 of sheet2, but for some reason formula gets deleted from q2 after one market change.
Many thanks
Dan
ddaann
 
Posts: 53
Joined: Thu Oct 12, 2006 6:39 pm

Postby GaryRussell » Thu Sep 09, 2010 2:13 am

dejanuk wrote:One slight problem Gary, as you can expect from Excel newbie like myself. This worked great on blank excel sheets, however on my sheet I already have one sub Worksheet_Change, and there is error message if i put them together. If i put your code in Sheet1 module nothing happens. Can you suggest something please. BTW I tried putting GO: with market id from sheet1 in q2 of sheet2, but for some reason formula gets deleted from q2 after one market change.
Many thanks
Dan

You cannot use a formula to insert GO: in Q2 because it has to clear the cell to prevent it processing the trigger repeatedly. It has to be populated using VBA. There's no reason why you cannot get it to work with your current code, this is your only option. I cannot guess why it doesn't work with your code because I have no idea what the resultant code looks like. If it's not sensitive you can post it on the forum or you could send it to me in a private message and I will check it.
User avatar
GaryRussell
Site Admin
 
Posts: 9872
Joined: Fri Nov 18, 2005 8:09 pm
Location: Birmingham, UK

Postby ddaann » Tue Sep 21, 2010 2:29 pm

The other code I am using is your code for inplay timer. When I try to mix those two I came to this:

Code: Select all
Option Explicit


Dim currentMarket As String
Private Sub Worksheet_Change(ByVal Target As Range)
If updating Then Exit Sub
updating = True
If Cells(2, 5) = "In Play" Then
If Cells(1, 27) = "" Then Cells(1, 27) = Cells(2, 3)
If Cells(1, 27) <> "" Then Cells(1, 28) = DateDiff("s", Cells(1, 27), Cells(2, 3))
End If
If Cells(2, 5) <> "In Play" And Cells(2, 6) <> "Suspended" Then
Cells(1, 27) = ""
Cells(1, 28) = ""
End If
updating = False
    If Target.Columns.Count = 16 Then
        If [A1] <> currentMarket Then
            Application.EnableEvents = False
            ThisWorkbook.Worksheets("sheet2").Range("Q2") = "GO:" & [N3]
            Application.EnableEvents = True
        End If
        currentMarket = [A1]
    End If
End Sub


This works ok except it keeps BA default refresh rate on sheet2 instead of sheet1 refresh rate. Any suggestions Garry. Thanks.
ddaann
 
Posts: 53
Joined: Thu Oct 12, 2006 6:39 pm

Postby GaryRussell » Tue Sep 21, 2010 5:15 pm

The code would be more efficient if it read as follows.

Code: Select all
Option Explicit

Dim currentMarket As String

Private Sub Worksheet_Change(ByVal Target As Range)
   If Target.Columns.Count = 16 Then
      Application.EnableEvents = False
      If Cells(2, 5) = "In Play" Then
         If Cells(1, 27) = "" Then Cells(1, 27) = Cells(2, 3)
         If Cells(1, 27) <> "" Then Cells(1, 28) = DateDiff("s", Cells(1, 27), Cells(2, 3))
      End If
      If Cells(2, 5) <> "In Play" And Cells(2, 6) <> "Suspended" Then
         Cells(1, 27) = ""
         Cells(1, 28) = ""
      End If
      If [A1] <> currentMarket Then
         ThisWorkbook.Worksheets("sheet2").Range("Q2") = "GO:" & [N3]
      End If
      currentMarket = [A1]
      Application.EnableEvents = True
   End If
End Sub

I'm not sure what you you mean regarding the refresh rate. This code does nothing with the refresh rate. Can you explain in more detail what your issue is?
User avatar
GaryRussell
Site Admin
 
Posts: 9872
Joined: Fri Nov 18, 2005 8:09 pm
Location: Birmingham, UK

Postby ddaann » Wed Sep 22, 2010 3:25 pm

Sorted it with VBA code, thanks Gary
ddaann
 
Posts: 53
Joined: Thu Oct 12, 2006 6:39 pm


Return to Discussion

Who is online

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