- Code: Select all
 Sub Reset()
Application.EnableEvents = True
Application.Calculation = xlCalculationAutomatic
'etc
End Sub
Moderator: 2020vision
by Captain Sensible » Wed Jul 26, 2017 5:44 pm 
Sub Reset()
  Application.EnableEvents = True
  Application.Calculation = xlCalculationAutomatic
  'etc
End Sub
by mak » Wed Jul 26, 2017 7:14 pm 
by Captain Sensible » Wed Jul 26, 2017 7:24 pm 
If Target.Columns.Count <> 16 Then Exit Sub'If Target.Columns.Count <> 16 Then Exit Sub
by mak » Wed Jul 26, 2017 7:52 pm 
by Captain Sensible » Wed Jul 26, 2017 8:09 pm 
                .Range("U1").Value = Application.WorksheetFunction.Min(.Range("F5:F" & rowFindLast).Value)
                .Range("U2").Value = Application.WorksheetFunction.max(.Range("H5:H" & rowFindLast).Value)
by mak » Wed Jul 26, 2017 8:17 pm 
by mak » Wed Jul 26, 2017 8:20 pm 
by Captain Sensible » Wed Jul 26, 2017 9:22 pm 
mak wrote:thanks!
tomorrow I would like to try to add something like Al code
to move to the next market and alter the FULL-STREAM on off..
what I have noticed until now regarding speed and cpu usage everything is almost identical
by mak » Thu Jul 27, 2017 12:07 pm 
Option Explicit
    Private Sub Worksheet_Change(ByVal Target As Range)
    Dim rowFindLast As Long
    Dim readArray() As Variant
    Dim i As Long
    Dim BetUntilOdds As Double
    Dim marketChanging As Boolean, currentMarket As String
    Dim MyQ2 As Variant
    
    Application.EnableEvents = True
        If Target.Columns.Count <> 16 Then Exit Sub
        Application.EnableEvents = False
        
       
          With Target.Parent
            
            rowFindLast = LastRow(.Range("A:AD"), 0) 'get the last row
            readArray = .Range("A1:AD" & rowFindLast).Value 'put our data into an array
            
            
            
            For i = 5 To UBound(readArray, 1) 'using 5 rather than LBound(readArray, 1) because we only want price data now
                
            If GetTicks(CCur(readArray(i, 6)), CCur(readArray(i, 8))) >= 5 _
            And readArray(i, 6) >= 5 And readArray(i, 6) <= 3000 _
            And .Range("E2").Value = "Not In Play" Then
            readArray(i, 19) = 2
            readArray(i, 18) = plusTicks(CCur(readArray(i, 8)), 1) 'display ticks
            readArray(i, 17) = "LAY"
            Else
            If readArray(i, 20) = "CANCELLED" Then
            readArray(i, 19) = "" ' stake
            readArray(i, 18) = "" ' odds
            readArray(i, 17) = "" ' trigger
            readArray(i, 20) = "" ' betref
        
            End If
            End If
            
            Next i
           
           .Range("A1:Z" & rowFindLast).Value = readArray 'dump our amended arrayback to the sheet
         End With
        
       ' End If
        Application.EnableEvents = True
    End Sub
by Captain Sensible » Thu Jul 27, 2017 1:34 pm 
by mak » Thu Jul 27, 2017 2:08 pm 
by mak » Thu Jul 27, 2017 2:21 pm 
by Captain Sensible » Thu Jul 27, 2017 2:40 pm 
by mak » Thu Jul 27, 2017 5:35 pm 
Private Sub Worksheet_Change(ByVal Target As Range)
    Dim rowFindLast As Long
    Dim readArray() As Variant
    Dim i As Long
    Dim BetUntilOdds As Double
    Dim NoRunners As Double
    Dim marketChanging As Boolean
    Dim currentMarket As String
    Dim TriggerInQ2 As Variant
    Dim MyQ2 As Variant
    
    
    Application.EnableEvents = True
        If Target.Columns.Count <> 16 Then Exit Sub
        Application.EnableEvents = False
          With Target.Parent
          
            If .Range("E2").Value = "In Play" And Range("F2").Value = "" Then
            MyQ2 = 0.2
            ElseIf .Range("E2") = "In Play" And .Range("F2") = "Suspended" Or .Range("F2") = "Closed" Then
            '.Range("Q2").Value = 0.5
           
            If Not marketChanging Then
            marketChanging = True
            currentMarket = .Range("A1")
            MyQ2 = -1
            Else
            If .Range("A1") <> currentMarket Then marketChanging = False
            End If
            Else
            MyQ2 = 0.5
            End If
            If TriggerInQ2 <> MyQ2 Then
            .Range("Q2").Value = MyQ2
            TriggerInQ2 = MyQ2
            End If
            
            
            rowFindLast = LastRow(.Range("A:AD"), 0) 'get the last row
            readArray = .Range("A1:AD" & rowFindLast).Value 'put our data into an array
            
            For i = 5 To UBound(readArray, 1) 'using 5 rather than LBound(readArray, 1) because we only want price data now
                
            If GetTicks(CCur(readArray(i, 6)), CCur(readArray(i, 8))) <= 5 _
            And readArray(i, 6) >= 2 And readArray(i, 6) <= 4 _
            And .Range("E2").Value = "In Play" _
            And readArray(i, 20) = "" _
            And readArray(i, 26) = "N" _
            And BetUntilOdds >= 2 Then
            readArray(i, 19) = 0.2
            readArray(i, 18) = plusTicks(CCur(readArray(i, 8)), 1) 'display ticks
            readArray(i, 17) = "LAY"
            Else
            
            readArray(i, 19) = "" ' stake
            readArray(i, 18) = "" ' odds
            readArray(i, 17) = "" ' trigger
            readArray(i, 20) = "" ' betref
            
        
            End If
            End If
            
            Next i
           
           .Range("A1:Z" & rowFindLast).Value = readArray 'dump our amended arrayback to the sheet
         End With
        
       ' End If
        Application.EnableEvents = True
End Sub
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.


