C# The beginnings of a bot

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Macberrypro
    Junior Member
    • Jun 2009
    • 2

    #31
    Of-course !

    Hey Vossie, has then been any updates to this engine ?

    I have started to invest some time in analysing it's architecture. This is a great POC & I am guessing this is how BF would like us to interact with the service ?

    I would like to get an idea of the tolerances of the Betfair system, I understand the data-costs etc, but I want to make sure I do not put any unnecessary load on the system. Whom could I contact ?

    Best

    Clive

    Comment

    • vossie
      BDP Team
      • Sep 2008
      • 40

      #32
      I am looking at reigniting this project in the new year and cleaning up all the quirks and getting it in a source control site. In other words refactor the whole thing to be more genric and capable.

      The application would have been ideal for this guy http://fad.betfair.com/listing/73-Re...velopment.html with minimal coding.

      Anybody that would join in developing/testing/using such a framework should vote here https://forum.bdp.betfair.com/showthread.php?t=653
      Last edited by vossie; 17-12-2009, 10:25 AM.
      "Why don't you just fix your little problem and light this candle?" - Alan B. Shepard, Jr

      Comment

      • vossie
        BDP Team
        • Sep 2008
        • 40

        #33
        Originally posted by vossie View Post
        I am looking at reigniting this project in the new year and cleaning up all the quirks and getting it in a source control site. In other words refactor the whole thing to be more genric and capable.

        The application would have been ideal for this guy http://fad.betfair.com/listing/73-Re...velopment.html with minimal coding.

        Anybody that would join in developing/testing/using such a framework should vote here https://forum.bdp.betfair.com/showthread.php?t=653
        All these projects would have benefit and numerous other I suspect
        http://fad.betfair.com/listing/72-is...ed-for-me.html
        http://fad.betfair.com/listing/64-Au...cking-bot.html
        http://fad.betfair.com/listing/73-Re...velopment.html

        and more...
        "Why don't you just fix your little problem and light this candle?" - Alan B. Shepard, Jr

        Comment

        • Vreljanski
          Junior Member
          • May 2009
          • 16

          #34
          I have developed about 6-7 customised small BF apps in last several months all with short timeframe and for one client. But looking at this code i was delighted... it's organised in a way my project should be one day... its really beautifull. I will enjoy learning from this. regarding helping in further development and testing... I would love to participate and will look at all the links... i hope i will have some spare time and my work goes in line with betfair.

          Cheers!

          Comment

          • n0n0
            Junior Member
            • Aug 2009
            • 1

            #35
            Hi Vossie,

            First of all, thank you for sharing your work. I was working on a similar framework for a while, but due to lake of time, i never finished my work.

            I tried to run your app (firstly converted into VS2010 beta), and i had some exception regarding controls accessed by the wrong thread.
            After a few investigation, I noticed that somtimes you use

            Code:
            if (InvokeRequired)
            {
                BeginInvoke(...);  // or Invoke(...);
            }
            else
            {
                // Controls updating
            }
            and sometimes

            Code:
            if (InvokeRequired)
            {
                BeginInvoke(...);  // or Invoke(...);
            }
                // Controls updating
            In the second situation, Control updating is performed twice, and once on a wrong thread!!

            In such a case, my prefered construction is

            Code:
            if (InvokeRequired)
            {
                BeginInvoke(...);  // or Invoke(...);
                return;
            }
                // Controls updating
            modifying this way MarketView.cs and MarketViewContainer.cs solved my exceptions issue.

            Hope this can help someone else.
            n0n0

            Comment

            • mangopws
              Junior Member
              • Jun 2010
              • 1

              #36
              add reference

              I'm new to use C#. If I want to add a reference target price & get an alart once the back/lay reach the target. Can I modify the program to do so ? And how can I do it ?

              Comment

              • z4887581
                Junior Member
                • Dec 2009
                • 1

                #37
                Vossie, any further updates on Lignite, looks brilliant, doesn't seem to take AUS country code for australian markets though?

                Comment

                • geraintwalesuk
                  Junior Member
                  • Jul 2010
                  • 1

                  #38
                  Hi

                  Great project, any plans on further development?

                  I've made a slight change to LoadMarkets() in AutoMarketLoader.cs

                  Before:

                  Code:
                  		    case QueryOperator.GREATER_THAN:
                  			if (Convert.ToDouble(propertyValue) >
                  			    Convert.ToDouble(query.Value))
                  			{
                  			    loadMarket[x] = false;
                  			}
                  			break;
                  		    case QueryOperator.LESS_THAN:
                  			if (Convert.ToDouble(propertyValue) <
                  			    Convert.ToDouble(query.Value))
                  			{
                  			    loadMarket[x] = false;
                  			}
                  			break;
                  After:

                  Code:
                  		    case QueryOperator.GREATER_THAN:
                  			if (Convert.ToDouble(propertyValue) <
                  			    Convert.ToDouble(query.Value))
                  			{
                  			    loadMarket[x] = false;
                  			}
                  			break;
                  		    case QueryOperator.LESS_THAN:
                  			if (Convert.ToDouble(propertyValue) >
                  			    Convert.ToDouble(query.Value))
                  			{
                  			    loadMarket[x] = false;
                  			}
                  			break;
                  I have added a few lines of code to BetfairAPI.PlaceBets() to allow for paper trading, but I'm not sure where to place the event handler to actually add a new bet so its processed by MarketProcessor? Any pointers would be very welcome.

                  Many thanks

                  Comment

                  • Mapper
                    Junior Member
                    • May 2010
                    • 1

                    #39
                    VS express 2010

                    Could it be this apps recompliled in VS 2010? I cannot complite it again due to errors. Thanks!

                    Comment

                    • Gentlehag
                      Junior Member
                      • Sep 2010
                      • 1

                      #40
                      There are nullable Types.

                      You can fix it with some simple changes in code (note tested and no warranty)

                      in BetFairAPI.cs Line 472 change to

                      request.eventTypeIds = new int?[eventTypeIds.Length];

                      (insert the ? sign)

                      and Line 337 to

                      bfMarket.eventHierarchy.CopyTo(marketToUpdate.even tHierarchy,0);


                      this are just workarounds but it should keep the code running


                      BTW it would be a great way to change the apllication architecture to a kind of EBC Architecture and also it would be great using WPF as GUI :-)


                      If you need any advisory help let me know.

                      Comment

                      • strik50000
                        Junior Member
                        • Oct 2009
                        • 1

                        #41
                        How to make automat bet to Lay 2 euro any market ?

                        Comment

                        • sandstormed
                          Junior Member
                          • Dec 2010
                          • 2

                          #42
                          Erroe

                          When I click on the dropdown next to the yellow light I get the error:
                          "There is no region associated with the Invariant Culture (Culture ID: 0x7F)."
                          The code stops at:
                          public abstract class Helpers
                          public static string GetCurrencySymbol(string currency)
                          var regionInfo = (from c in CultureInfo.GetCultures(CultureTypes.InstalledWin3 2Cultures)
                          let r = new RegionInfo(c.LCID)

                          I'm running Windows 7, which apparently behaves differently to Vista when it comes to invariant cultures.

                          So I changed the code to:
                          var regionInfo = new RegionInfo(System.Threading.Thread.CurrentThread.C urrentUICulture.LCID);
                          foreach (var cultureInfo in CultureInfo.GetCultures(CultureTypes.AllCultures & ~CultureTypes.NeutralCultures))
                          {
                          if (!cultureInfo.Equals(CultureInfo.InvariantCulture) )
                          {
                          var regionCulture = new RegionInfo(cultureInfo.LCID);
                          if(regionCulture.ISOCurrencySymbol == currency)
                          {
                          regionInfo = regionCulture;
                          }
                          }
                          }
                          Last edited by sandstormed; 13-12-2010, 08:32 AM. Reason: Found Fix

                          Comment

                          • stranger77
                            Junior Member
                            • Feb 2010
                            • 1

                            #43
                            klabor bee

                            Originally posted by strik50000 View Post
                            How to make automat bet to Lay 2 euro any market ?
                            Use klabor bee tool to do it,

                            Comment

                            • nmpgaspar
                              Junior Member
                              • Mar 2011
                              • 1

                              #44
                              I tried to compile it and got 4 errors.

                              Error 3 Cannot implicitly convert type 'int?[]' to 'int[]' : Betfair.API.cs line 337
                              Error 4 Cannot implicitly convert type 'int[]' to 'int?[]' : Betfair.API.cs line 472
                              could not load referenced assembly ".../LigniteEngine.dll"
                              Metada file ".../Betfair.API.dll" could not be found

                              I guess the 2 last errors should be gone be fixing the two firsts...
                              How do I fix them?

                              cheers.

                              Comment

                              • aubergine
                                Junior Member
                                • Jan 2010
                                • 19

                                #45
                                Originally posted by nmpgaspar View Post
                                I tried to compile it and got 4 errors.

                                Error 3 Cannot implicitly convert type 'int?[]' to 'int[]' : Betfair.API.cs line 337
                                Error 4 Cannot implicitly convert type 'int[]' to 'int?[]' : Betfair.API.cs line 472
                                could not load referenced assembly ".../LigniteEngine.dll"
                                Metada file ".../Betfair.API.dll" could not be found

                                I guess the 2 last errors should be gone be fixing the two firsts...
                                How do I fix them?

                                cheers.
                                Note, these are quick hack fixes just to get it building, I have no idea of the actual impact of these changes:

                                Line 337:
                                marketToUpdate.eventHierarchy = (int[])bfMarket.eventHierarchy.Clone();

                                Line 472:
                                request.eventTypeIds = new int?[eventTypeIds.Length];

                                Comment

                                Working...
                                X