VBNet Sample (Yes really)

Collapse
This is a sticky topic.
X
X
 
  • Time
  • Show
Clear All
new posts
  • betdynamics
    Junior Member
    • Sep 2010
    • 534

    #151
    I don't know VB.NET at all, but wouldn't it be easier just to declare two classes:

    Code:
    class NavRoot
      dim children() as NavItem;
      dim type as string;
      dim name as string;
      dim id as string;
    end class
    
    class NavItem
      dim children() as NavItem;
      dim type as string;
      dim name as string;
      dim id as string;
      dim exchangeId as string;
      dim countryCode as string;
      dim venue as string;
      dim marketType as string;
      dim marketStartTime as string;
      dim startTime as string;
      dim numberOfWinners as string;
    end class
    Any fields that are do not exist for certain node types will just be returned as null values.

    Comment

    • jabe
      Senior Member
      • Dec 2014
      • 705

      #152
      I guess it would!

      Comment

      • SimonN
        Junior Member
        • Dec 2014
        • 71

        #153
        Jaaaaaaaaaaaaaaabe!!!

        This looks absolutely tremendous!

        HOWEVER, just when I was thinking I really need to set aside some time to sit down and get my grey matter round your wicked work, I suddenly realised looking at your objects - wait a sec - where's the actual market prices???

        So I went to my 4.5 M response file and checked there and again can't see any market prices!!

        I thought the whole idea was to get everything in one foul swoop? Either they don't come with this or I've (more likely) totally misunderstood the Data Navigation Service!?

        Confused.com.

        The feeling am gonna be totally embarrassed here lol!

        S

        Comment

        • SimonN
          Junior Member
          • Dec 2014
          • 71

          #154
          Okay it seems that the Data Navigation Service gets everything except the prices and I had been assuming it was all just in one foul swoop with everything in but obviously I have to link to the marketbook with the max of 40 marketID's stipulated in the documentation.

          I had obviously misunderstood the DNS and thought that maybe my JSON request wasnt getting everything it should be getting.

          At ease lol.

          Will look at this shortly Jabe thanks again for outlining your strategy.

          Comment

          • jabe
            Senior Member
            • Dec 2014
            • 705

            #155
            Not to worry! I had, as I said, intended to return to this area. I may have read different things so I didn't have the same expectation as you. To me, it was just a programmatic version of the menu for using to navigate to an event and its markets.

            At what sort of frequency are you hoping to get marketBook data?
            Last edited by jabe; 11-03-2016, 07:41 PM.

            Comment

            • betdynamics
              Junior Member
              • Sep 2010
              • 534

              #156
              As far as I can tell the Data Navigation Service exists as a means of reproducing the event hierarchy on the website.

              It was never meant to include prices.

              The only way to get prices is via the listMarketBook call.

              I'm slightly confused as to what you are trying to achieve. If you are intending to produce a website that displays Betfair prices, then you probably need to make contact with the BDP team, as I think that requires some kind of commercial licence.

              Comment

              • SimonN
                Junior Member
                • Dec 2014
                • 71

                #157
                I want to be able to do this of a sorts

                http://www.oddsmonkey.com/OddsSearch.aspx

                *For my own private use
                Last edited by SimonN; 11-03-2016, 08:40 PM.

                Comment

                • jabe
                  Senior Member
                  • Dec 2014
                  • 705

                  #158
                  Originally posted by SimonN View Post
                  I want to be able to do this of a sorts

                  http://www.oddsmonkey.com/OddsSearch.aspx

                  *For my own private use
                  Are you just scraping the bookie data?

                  Comment

                  • SimonN
                    Junior Member
                    • Dec 2014
                    • 71

                    #159
                    yes thats the idea

                    in terms of frequency - not too sure yet - if I can get it working that will be the major achievement and then can survey the scenery from there...
                    Last edited by SimonN; 11-03-2016, 11:50 PM.

                    Comment

                    • jabe
                      Senior Member
                      • Dec 2014
                      • 705

                      #160
                      Good luck with it.

                      I'd guess that there isn't much movement in odds until at least the match day, and even then perhaps not until close to the game. Perhaps your prog could monitor odds changes at the bookies and on Betfair to get an idea when it happens.

                      If you're betting manually, I'd include a button to get up-to-date odds for a particular match whenever you need it. Which you're probably doing anyway.

                      You might find that Betfair's Match Odds for some less important games take a while to reach the point where the back and lay odds are adjacent. You'll have to excuse me if any of this is too obvious for words...

                      There's a game in the USA starting in a few minutes. The back and lay odds on the Match Odds market are these:
                      Orlando City 2 / 2.02
                      Chicago Fire 3.95 / 4.1
                      Draw 3.9 / 3.95
                      If you sum up (100/odds) for each side, you get, to a couple of decimal places, 100.96 and 99.21. The back ones always add to more than 100 and the lay ones always add to less (if they don't, bet on all of them quickly!).

                      There's a game in Panama that starts in just under 2 hours. The odds are these:
                      Tauro FC 2.18 / 3.2
                      Chorrillo 2.78 / 4.5
                      Draw 3.15 / 950
                      The back side comes to 113.58 and the lay side to 53.58. I'd guess that these odds are not even going to be close by kick off. Whether there's any value for you in this match, I greatly doubt.

                      There's a game in Singapore that kicks off in nearly 9 hours. It's an under 18s game, with these odds:
                      NFA Reds U18 1.04 / 480
                      Tampines Rovers (Res) 1.13 / no current lay odds available
                      Draw 1.11 / 950
                      The back side adds up to 274.74. The lay side is little above nothing (assuming 1000 for the missing lay odds, it comes to 0.41). You can probably ignore games with figures like these. My guess is that they're hoping for people to make a mistake in Betfair and click on something wrong.

                      There are plenty of games in which all the Correct Score runners are available to back at 1.02 and there are no current lay prices.

                      Hope this was some use.

                      Comment

                      • SimonN
                        Junior Member
                        • Dec 2014
                        • 71

                        #161
                        Thank you for the insights, Jabe.

                        There are definitely gonna be some unformed markets that are not worth getting and this could be a way of cutting down on unnecessary requests as you imply.

                        Have started learning Python as a better language to do it all in and the JSON / Python object mapping looks like a synch unless I am mistaken compared with VBA and even maybe VB.Net too.

                        No doubt I'll be back hitting untold brick walls along the way.

                        Comment

                        • jabe
                          Senior Member
                          • Dec 2014
                          • 705

                          #162
                          I'll be along for some Python tips one day!

                          Comment

                          • jabe
                            Senior Member
                            • Dec 2014
                            • 705

                            #163
                            Originally posted by jabe View Post
                            Edit: 24Mar2016: my code to get the navigation file via VB.NET now works, so I'll add the code to the thread in the next few days.
                            03Apr2016: My code successfully retrieves the navigation file (typically 5-6MB), but the Deserialize method is not working. The default maximum size for the Deserialize needed increasing, but all the data fields end up null and the Deserialize does not appear to return any kind of exception (it survives the Try of a Try/Catch). I may well just post the code to retrieve the navigation file into a string, leaving the other problem for others to sort out. I don't need the navigation data myself.

                            Comment

                            • SimonN
                              Junior Member
                              • Dec 2014
                              • 71

                              #164
                              Multiple Markets syntax

                              SOLVED: OVERLOOKED maxResults"":""1"" Doh!

                              Here's my request string for a single market - please help me with how to approach multiple marketTypeCodes

                              GetListMarketCatalogueRequestString = "{""filter"":{""eventIds"":[""" & EventId & """],""marketTypeCodes"":[""MATCH_ODDS""]},""sort"":""FIRST_TO_START"",""maxResults"":""1"" ,""marketProjection"":[""RUNNER_DESCRIPTION""]}"

                              Thank you

                              EDIT: EXCEL VBA
                              Last edited by SimonN; 22-07-2016, 12:06 PM. Reason: Solved

                              Comment

                              • SimonN
                                Junior Member
                                • Dec 2014
                                • 71

                                #165
                                selectionId name?

                                It comes up fine for Match odds ie home team, away team, and draw.

                                But for other markets like Both teams to score or over/under goals I can't seem to get the selectionId market name eg yes/no, under/over.

                                Comment

                                Working...
                                X