A Semi-automated system with Python and IB api

Discussion in 'Automated Trading' started by Warren, Aug 16, 2022.

  1. Warren

    Warren

    Hi elite traders,

    Some 3 years ago, I am informed by a guru here to learn some Python and do the research and trading, as this is "what the professionals are doings". Now, I am done with the research work, and seem to find a pattern in the ES 1 mins intra-day data.

    So, now I am looking forward to deploy a semi-automated system using Python and IB api. Probably starting with ib_insync. As I have just started, there is another steep learning curve ahead(not from a programming related background). And I have envisioned two ways to realize this: 1) one is to realize all this on the python side, whether it is an interactive environment such as jupyter notebook/lab, or an IDE like pyCharm; but this way, I have to code everything including the charting, which seems daunting; 2) or, I can realize all this on the TWS side, so that I can take advantage of the charting ability, meanwhile integrating the system in the background. But at this moment I do not even know whether this is possible.

    I guess there are traders already doing something similar. So, any advice that can shorten the learning curve is welcomed.

    Meanwhile, I will also record every step how I resolve the problems encountered. As a way to contribute back to the community and deliver some information for those who are struggling to achieve similar things.
     
  2. 2rosy

    2rosy

    do you need charts for a semi automated system? Just use TWS charts and automate what needs automating
     
    d08 likes this.
  3. RedDuke

    RedDuke

    To shorten the curve learn c# and program all in NinjaTrader. They have all Libraries like charting, trading, memory and etc. “ all you need to code” is your actual system, the rest is taken care off.
     
  4. Are you saying he wasted the last 3 years learning Python? :)
    My favorite computer language is C/C++ :D It's very low level, just a step above Assembler language, or machine code writing :)
     
    ET180 likes this.
  5. Warren

    Warren

    yes, I need the chart. And it will be great if I can code my strategy in the background.
     
  6. Warren

    Warren

    Well, I switched from C# and NinjaTrader (bought their life long license). It is a long story. Ninja can not give all the flexibility I need. And I encountered some error that the support team can not debug.
     
    earth_imperator likes this.
  7. Pattern in the 1min ES found ? Really ? Did you check out-of-sample meaning rolling walk forward results, are you sure you found something consistent profitable ? And I mean not only 1 trade every (second) week ?
     
  8. rb7

    rb7

    What do you mean by 'semi-automated'?

    Which part(s) is (are) automated and which one(s) isn't (aren't)?

    Usually, in an automated system, you have the following parts:
    - Real-time data management (connect, disconnect, subscribe, receive, archive, conversion/transformation, etc.)
    - Entry/exit signals
    - Risk management (qty, %allocation, margin, etc.)
    - Order management (select instrument/price/qty, send order, cxl order, receive trades, etc.)
    - Portfolio/account management
     
  9. A possible pattern could be: at lunch time (NY time) significantly less orders get filled as well submitted to the orderbook :D
     
    jbusse and TrAndy2022 like this.
  10. If you still want to use c# I put together this repo that I use on a daily basis:
    https://github.com/AnAlgoTrader/IB.Csharp.Api.Client

    In case you still want to shoot yourself on a foot with Python I can recommend (Edit: I just saw on your original post that this is the repo you are planing to use) :
    https://github.com/erdewit/ib_insync

    It wasn't painful to use for a non-believer.
     
    #10     Aug 16, 2022
    peechu and Warren like this.