Help with multiple trigger PLEASE!

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

Moderator: 2020vision

Help with multiple trigger PLEASE!

Postby Conrad1971 » Fri Feb 17, 2012 2:35 pm

Hi,
I am using a three stage trigger at the moment which seems to work fine 90% of the time, but occasionally the second part of my trigger triggers multiple times (if the odds on that particular horses go up and down very quickly a number of times). Is there a simple comand i can add after the second trigger has gone the first time to stop it repeating?
Any help would be greatly appreciated,
Conrad.
Conrad1971
 
Posts: 13
Joined: Sun Jul 17, 2011 4:27 pm

Postby osknows » Tue Feb 21, 2012 4:06 pm

Hello,

You are probably better off moving your conditions to VBA so you can track when triggers have fired. Eg the below example shows a very simple formula in cell AA5

[AA5]=IF(E6>5,TRUE,FALSE)

The code checks for when AA5 is true then overwrites the formula as a value locking it. When the market changes then the formula is re-applied.

This is just one of many ways to achieve similar. It may be easier to do away with cell formula and do it all with VBA

Code: Select all
Option Explicit

Dim currentMarket As String
Dim trigger1 As Boolean

Private Sub Worksheet_Change(ByVal Target As Range)

If Target.Columns.Count = 16 Then
    Application.EnableEvents = False

    With Target.Parent

        If .Range("A1").Value <> currentMarket Then
            currentMarket = .Range("A1").Value
            trigger1 = False
            'reapply formula
            .Range("AA5").Formula = "=IF(E6>5,TRUE,FALSE)"
        End If
       
        'fire only if trigger not fired/False
        If Not trigger1 And .Range("AA5").Value = True Then
            trigger1 = True
            'lock formula as value
            .Range("AA5").Value = .Range("AA5").Value
        End If
    End With

   Application.EnableEvents = True
End If

End Sub
User avatar
osknows
 
Posts: 946
Joined: Wed Jul 29, 2009 12:01 am

Postby Conrad1971 » Tue Feb 21, 2012 9:40 pm

Thanks osknows :)

Code: Select all
What i am trying to do i dont think is that complicated, all i want to do is  back a horse when it reaches certain odds (lets say 10), then if the same horses odds go down (lets say to 8) then i want to lay it, then if the same horses odds go back up (lets say to 14) i want to back it again. My trigger for the above senario would be:-

=IF(AND(X6=0,F6=10),"BACK",IF(AND(X6>1,F6=8),"LAY",IF(AND(X6=10,F6=14),"BACK","CLEAR")))

What is happening is the second part of the bet (the lay bet @8) is trigering multiple times, i.e if the odds go up to 8 then down to 7, then up to 8, down to 7........., then i end up with up to 5 lay bets and a huge loss on that horse.


I hope you can understand my explanation :)
Is there just a simple fix for this, like adding something after the second trigger formula so that once it has triggered it places the second bet then waits for the 3rd trigger criteria to be matched?

Thanks for all your help,
Conrad.
Conrad1971
 
Posts: 13
Joined: Sun Jul 17, 2011 4:27 pm

Postby Conrad1971 » Tue Feb 21, 2012 9:42 pm

Sorry osknows, everywhere i typed the number eight, the number seems to have been replaced with a smily face and glasses!!!!
Conrad1971
 
Posts: 13
Joined: Sun Jul 17, 2011 4:27 pm

Postby osknows » Wed Feb 22, 2012 11:46 am

If I've understood correctly you want to BACK, then LAY, then BACK again in an ordered cycle based on your criteria. One way is to use column Y as an indication of where you are in the cycle.

The formula in [Q5] would update to i

Code: Select all
=IF(AND(X5=0,F5=10,Y5=""),"BACK",IF(AND(X5>1,F5=8,Y5="BACK1"),"LAY",IF(AND(X5=10,F5=14,Y5="LAY1"),"BACK",IF(T5<>"","CLEAR",""))))


And this code will track the order of the cycle and write to column Y

This goes in the sheet object
Code: Select all
Option Explicit

Dim currentMarket As String

Private Sub Worksheet_Change(ByVal Target As Range)
Dim i As Long

If Target.Columns.Count = 16 Then
    Application.EnableEvents = False

    With Target.Parent
   
        If .Range("A1").Value <> currentMarket Then
            currentMarket = .Range("A1").Value
            .Range("Y5:Y55").ClearContents
        End If
   
        For i = 5 To 55
       
            If .Range("Q" & i).Value = "BACK" And .Range("Y" & i).Value = "" Then
                .Range("Y" & i).Value = "BACK1"
            ElseIf .Range("Q" & i).Value = "LAY" Then
                .Range("Y" & i).Value = "LAY1"
            ElseIf .Range("Q" & i).Value = "BACK" And .Range("Y" & i).Value = "LAY1" Then
                .Range("Y" & i).Value = "BACK2"
            ElseIf .Range("Y" & i).Value = "BACK2" Then
                .Range("Y" & i).ClearContents
            End If
               
        Next i

    End With

   Application.EnableEvents = True
End If

End Sub


One other thing to consider, you are checking for odds matching exact odds, eg F5 = 10, F5 = 8, F5 = 14 what about if they are 10.2, 8.4 & 13.8?
User avatar
osknows
 
Posts: 946
Joined: Wed Jul 29, 2009 12:01 am

Postby 2020vision » Wed Feb 22, 2012 12:01 pm

Conrad1971 wrote:Sorry osknows, everywhere i typed the number eight, the number seems to have been replaced with a smily face and glasses!!!!


Hi Conrad :)

Hope you don't mind but I have edited your post above just slightly to get
rid of the smiley faces. When you are posting formulas and suchlike then you
need to use the "code" and then" /code" buttons above the comment window
around any Excel code, this will avoid the smileys and make it readable to all.

Regards - Michael :wink:
User avatar
2020vision
Moderator
 
Posts: 605
Joined: Sun Feb 17, 2008 10:24 pm
Location: Nottingham

Thanks!

Postby Conrad1971 » Wed Feb 22, 2012 12:44 pm

Thanks very much osknows for all your help, it is much appreciated.
Thanks Michael for editting my post, i will know about the code box for next time.
Conrad1971
 
Posts: 13
Joined: Sun Jul 17, 2011 4:27 pm


Return to Discussion

Who is online

Users browsing this forum: No registered users and 47 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.