Be careful using async when placing bets

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • IGtrader
    Junior Member
    • Apr 2012
    • 18

    #1

    Be careful using async when placing bets

    I just cracked a bug in my code which was stopping me using async when placing bets. async usage is not in the c# sample code by the way. It is really useful when placing bets in running horse markets.. The bug was that when placing a bet without async a BetId is returned. I was using this BetId later in the code.
    When placing bets using async the return value for betId is null. This created an exception which I was not handling.

    Im still not sure why but the knock on effect was that the system kept placing the same bet over and over until I ran out of cash. I remember this from 2016 and since that happened I stopped using async.

    Finally reexamined it today and saw the problem.
    Still nervous though.
  • bfexplorer
    Senior Member
    • Sep 2018
    • 212

    #2
    This is so wrong!

    Comment

    • IGtrader
      Junior Member
      • Apr 2012
      • 18

      #3
      and why would that be ?

      Comment

      • LetsGo
        Senior Member
        • Oct 2018
        • 112

        #4
        I think you have a bug in your software otherwise others would have noticed it if it was in the api.

        Comment

        • IGtrader
          Junior Member
          • Apr 2012
          • 18

          #5
          i agree and thats what I said

          Comment

          • bfexplorer
            Senior Member
            • Sep 2018
            • 212

            #6
            You really should learn how to use async.

            Have a look at on my test:

            https://youtu.be/Xq1Z5KGiXXc

            The concept of async operation is supported by all programing languages, so do not be confused by my F# code.

            I placed back bet using my app in async, and as you can see bet id was correctly returned/processed.

            So once again what you do and suggest to others is totally wrong!

            Comment

            • LetsGo
              Senior Member
              • Oct 2018
              • 112

              #7
              Stefan, I find your videos too difficult to follow:-
              No sound
              No text to explain what's happening.
              To quick, no idea what's going on. If you could slow them down a bit it would help.

              Comment

              • IGtrader
                Junior Member
                • Apr 2012
                • 18

                #8
                I cant follow the video either but what I can say is that if you place an async bet the report returns a null vale for the bet Id. I have double checked this. after the in play delay the bet id is not null.

                Comment

                • WTPooh
                  Member
                  • May 2012
                  • 88

                  #9
                  You are discussing different topics. IGtrader talks about async parameter in placeOrders. bfexplorer talks about async keyword in F#/C#.

                  Comment

                  • bfexplorer
                    Senior Member
                    • Sep 2018
                    • 212

                    #10
                    Originally posted by LetsGo View Post
                    Stefan, I find your videos too difficult to follow:-
                    No sound
                    No text to explain what's happening.
                    To quick, no idea what's going on. If you could slow them down a bit it would help.
                    We are here all software developers, right?

                    Ok, you maybe program in different programming language or use different IDE. In my daily job, I use 2 different programming languages, and as well different IDE like I show in my video, but all IDEs offers debugging so all should be familiar for us software developers.

                    So in my video the main point I wanted to show is that calling bet place method in async works, and not like other developer here is saying "betId is null", and that we should be: "Be careful using async when placing bets"

                    In my video I show QuickWatch dialog in Visual Studio, when debugging my app code, showing betfair api result returned betId, and you can see it, that it is not null.

                    This is the proof showing that what IGtrader claims is not truth, actually he just misleads others, therefor I replied here and presented video as the proof.

                    Funny, but you can pause video whenever you want or reply the video in any part that interest you.

                    Comment

                    • LetsGo
                      Senior Member
                      • Oct 2018
                      • 112

                      #11
                      Originally posted by bfexplorer View Post

                      We are here all software developers, right?

                      Ok, you maybe program in different programming language or use different IDE. In my daily job, I use 2 different programming languages, and as well different IDE like I show in my video, but all IDEs offers debugging so all should be familiar for us software developers.

                      So in my video the main point I wanted to show is that calling bet place method in async works, and not like other developer here is saying "betId is null", and that we should be: "Be careful using async when placing bets"

                      In my video I show QuickWatch dialog in Visual Studio, when debugging my app code, showing betfair api result returned betId, and you can see it, that it is not null.

                      This is the proof showing that what IGtrader claims is not truth, actually he just misleads others, therefor I replied here and presented video as the proof.

                      Funny, but you can pause video whenever you want or reply the video in any part that interest you.
                      Just giving you some very useful feedback on your product.

                      All your videos are completely useless! I shouldn't have to pause them, they should be more user friendly.

                      If you want to be successful in selling your product then improve it.

                      I don't know of any successful business that criticises user feedback.

                      Comment

                      • bfexplorer
                        Senior Member
                        • Sep 2018
                        • 212

                        #12
                        Originally posted by LetsGo View Post

                        Just giving you some very useful feedback on your product.

                        All your videos are completely useless! I shouldn't have to pause them, they should be more user friendly.

                        If you want to be successful in selling your product then improve it.

                        I don't know of any successful business that criticises user feedback.
                        This really is funny. I am software developer, and I do not try to boost sells of my app, it is just hobby project, and big opportunity to test on this project anything I want, because in my daily job I do develop boring stuff, or maintain more than 15 years old winform projects. Nothing interesting.

                        With my betfair hobby project I try to use the latest technology, and learn more programming languages I would had never chance to learn on my daily job, because actually without coding, you cannot learn new programming language, you need some project to build.

                        Lastly you really forgot on what forum you are, this is called developer betfair forum, here it is all about programming using betfair api. I really do not care about marketing, and here it would be useless, as all developers here prefer to write their own software.

                        I did not criticise you, just said my opinion, why would I need to explain in my short video other developers what they actually see in my short video of debugging my code in Visual Studio, as all they know Visual Studio already. Just browse this forum to learn that most projects here are built on .net platform, and so Visual Studio is main IDE (Integrated Development Environment), even IGtrader develops his betfair project in C# and so using Visual Studio.

                        I do not think he needs my comment in that video, saying him what he already knows, how to put break point in the code, and how to watch local variables when program pause its execution at set breakpoint.


                        Last edited by bfexplorer; 25-04-2019, 07:30 PM.

                        Comment

                        • bfexplorer
                          Senior Member
                          • Sep 2018
                          • 212

                          #13
                          Originally posted by WTPooh View Post
                          You are discussing different topics. IGtrader talks about async parameter in placeOrders. bfexplorer talks about async keyword in F#/C#.
                          Async/await are keywords in C# as well, and I did discuss about the same, using asynchronous execution model in any programming language which supports such expression in code.

                          It does not matter that F# uses computation expression for what you would have to express in C# code by async/await keywords, it is the same expressed different way in C# and F#.

                          My app is able to open hundreds of markets for monitoring and concurrently place bets on many markets, if I would use synchronous execution in placing bets, then any bet placing would block app execution, and so bet operation/s on other markets.



                          Comment

                          • IGtrader
                            Junior Member
                            • Apr 2012
                            • 18

                            #14
                            As WTPooh says I am talking about the async parameter in placeOrders.-NOT- the c# keyword async. So bfexplorer you have jumped on the "I am right you are wrong bus" at 100 mph. Laughed heartily Im sure thinking I know nothing if I don't know what async is.

                            Its Ok you can apologise in your own time.

                            I will certainly think twice before posting helpful things if people like you are going to jump on me like a ton of shit


                            I presume you work on your own because if you display that kind of attitude to fellow workers no matter how bright and clever you may think you are ... Im just glad I don't work with you but Ive certainly worked with a few people like you.

                            Good luck in your business
                            Last edited by IGtrader; 25-04-2019, 08:08 PM.

                            Comment

                            • bfexplorer
                              Senior Member
                              • Sep 2018
                              • 212

                              #15
                              Originally posted by IGtrader View Post
                              As WTPooh says I am talking about the async parameter in placeOrders.-NOT- the c# keyword async. So bfexplorer you have jumped on the "I am right you are wrong bus" at 100 mph. Laughed heartily Im sure thinking I know nothing if I don't know what async is.

                              Its Ok you can apologise in your own time.

                              I will certainly think twice before posting helpful things if people like you are going to jump on me like a ton of shit


                              I presume you work on your own because if you display that kind of attitude to fellow workers no matter how bright and clever you may think you are ... Im just glad I don't work with you but Ive certainly worked with a few people like you.

                              Good luck in your business
                              I see, so I was confused, because documentation exactly says:

                              "... Orders can be tracked via the Exchange Stream API or or the API-NG by providing a customerOrderRef for each place order.
                              An order's status will be PENDING and no bet ID will be returned. ..."

                              and no bet ID will be returned

                              And it is clear that no bet ID will be returned, so bet Id will be null in the response. I thought you have got problems with async execution in you code and not async parameter in place orders/bets request.

                              English is foreign language for me, but I am able to understand what is written in documentation, so my conclusion went the wrong way.

                              Comment

                              Working...
                              X