What is difficult about IBKR APIs?

Discussion in 'App Development' started by lime, May 23, 2024.

  1. If I am lucky enough I won't need to use Python for anything anymore, that is all I can say.
     
    #11     May 26, 2024
    lime likes this.
  2. lime

    lime

    Virtual functions refer to Abstract methods in super classes?
    Can you share your C# Github for reference? I use Java, C# codes are more or less the same, right
     
    #12     May 26, 2024
  3. lime

    lime

    Wrappers can only sugercoat the original IBKR APIs, so can only make its use easier, not add functionality. So my confusion is, what is so problematic about its APIs (which many people seem to use) to the extent that large-scale simplification is warranted.
     
    #13     May 26, 2024
  4. I don't think that the API is problematic to use.
    My "wrapper" adds functionality that's applicable to me. But what's applicable to me, is most likely not applicable to all API users. So the API functions are made more generic.
     
    #14     May 26, 2024
  5. The problem comes with the EWrapper class, an abstract class that has every single method in it.

    The result is that every time you want to use one method, because is part of the abstract super class, you are forced to implement the rest of them.

    What I have done is to implement them into separate classes so if I want to get market data I don't have to implement methods for getting news, for example.

    The guy that developed ib_sync did exactly that, he implemented every single method into separate classes.

    What you normally end up, if you use the code coming from IBKR is with an implementation that has plenty of empty methods. Because you don't want to implement everything.

    Now, if you want clean code and use code checkers like Sonar Cloud, you get so many errors everywhere about that your class is not implementing the super class properly. Good look trying to get a quality gate keeper to pass.

    IBKR forces you to write shit code. Just look at the examples they provide. They trigger a never ending loop that blocks the main thread. A horrible way to develop your algorithms.

    It is code from the 90s and no one cared to fix it. That's is why every single developer writes a wrapper on top of it. Just look for an example in Java on GitHub instead of using mine in c#.

    My GitHub is this one anyway.
    https://github.com/veritacodex/IB.Api.Client
     
    #15     May 26, 2024
    globalarbtrader and lime like this.
  6. lime

    lime

    So your saying the necessary EWrapper class includes many unnecessary abstract methods, so concrete subclasses are forced to implement many useless functions or make them empty (trivial implementation)?

    I thought IBKR APIs were considered advanced, given its focus on algo trading
     
    #16     May 26, 2024
  7. Correct. The API already contains such a wrapper, implementing all abstract methods with an empty implementation to make this job easier for you. In their Java API it is called EWrapperImpl. You can either take this implementation and modify it to your needs, or make a separate wrapper on top of this to implement your needs.
     
    #17     May 26, 2024
  8. lime

    lime

    Any retail brokers offer better APIs than IBKR then?
     
    #18     May 31, 2024
  9. rb7

    rb7

    Better in what sense?

    I've been using the IB API for the last 15 years without much problem.
    It's not that complicated to use.
    And it has no effect on my ability to make money (or not!).
     
    #19     May 31, 2024
    lime likes this.
  10. It is worth spending a bit of time with the IB API, it has access to almost everything you want to trade. Other brokers are easier to handle but don't have many symbols available, so it is a trade-off.

    If you are stuck with something, let us know. I've already written examples for a few common tasks.
     
    #20     May 31, 2024
    rb7 and lime like this.