Announcement

Collapse
No announcement yet.

Timed bets

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Timed bets

    Hi guys, I have sorted my previous problems and have a running app now. I am looking at automating the bets, to take away human error / weaknesses.
    What i have been searching for is selecting the days qualifying races from a list and then triggering the bets at the marketStartTime. Any help appreciated. Keep it as simple as you can for an old noobie.

  • #2
    One idea is to make an array of todays marketids and another with the starttimes. then loop through the starttimes checking against the current time. If current time is greater than the start time then place the bet. Note you may wish to subtract some time from the starttime to allow some variation between different clocks. Control is needed to make sure you don't keep repeating bets.

    Comment


    • #3
      Ive set up a clock with TimeOfDay and compare with MarketStartTime.

      Used the following code.

      If MarketStartTime >= TimeOfDay
      Print "something"
      End If

      To test the code but get no output.

      Comment


      • #4
        Put in a print to a test file so you can 'see' exactly what is happening, before during and after your test, in your code, what language are you using?
        The variables may not be of the same type.

        Code:
        From my VB code
        For i = 1 To TodaysRaceCount
           If Date.Now > StartTimes(i).AddMinutes(-3) And Date.Now < StartTimes(i) Then
              If TodaysBetsMade(i) Then 'TodaysBetsMade boolean becomes true when bet placed
              Else
                Print("Make A Bet")
                marketId = TodaysIds(i)
                Placebets(marketId, i) 'pass marketId to function along with array row if other arrays information needed.
              End If
           End If
        Next

        Last edited by MarcusMel; 08-12-2020, 03:00 AM.

        Comment


        • #5
          I think you perhaps ought to check whether the race has actually started, rather than assuming. Delays happen.

          Comment


          • #6
            The code above makes bets 3 minuites before the stated start time.One could keep fetching data until the event is declared closed.

            Comment


            • #7
              My program now takes a selection from a datagridview and places a bet using a form to place the bet. I am only loading one race into the datagrid and once the bet is placed i want the datagrid to clear and load the next race. I can clear the datagrid but cant get to load the next race, without closing the program. Any suggestions appreciated.

              Comment


              • #8
                Originally posted by tippete View Post
                My program now takes a selection from a datagridview and places a bet using a form to place the bet. I am only loading one race into the datagrid and once the bet is placed i want the datagrid to clear and load the next race. I can clear the datagrid but cant get to load the next race, without closing the program. Any suggestions appreciated.
                Check out refreshing the datagrid after you've done the updates. It's a while since I've done much coding, but my program regularly refreshes controls. If you're still stuck, show us your code.

                Comment

                Working...
                X