TWS API: Excel vs Python

Discussion in 'Interactive Brokers' started by Garrus, Sep 27, 2020.

Should a newbie with ToS custom indicator code try using IBKR Excel or Python?

  1. Excel DDE / RTD

    40.0%
  2. Python

    60.0%
  1. Garrus

    Garrus

    Hi,

    I'm a frustrated newbie with a simple thinkorswim strategy written in thinkscript for penny stocks, but my broker platform IBKR does not allow me to create my own custom indicators or autotrade for me based on my strategy. And writing this here cos another precious weekend is coming to a close and I did not have any fruitful headway into my problem. Very little time to do this during working days.

    I've tried trading my own using ToS as the alert/backtesting and IBKR as my broker with real-time data subscription, but I learned the following:
    • I'm just not a good/disciplined day trader. My thoughts & emotions still get the better of me.
      • Opening a position which I thought was a good price
      • Closing a position too late. Often times I see that price going into the green zone in ChartTrader and I did not close, thinking it should still go up based on EMA / Ichi / KVO, but crashes soon after.
      • My coded "me" strategy is just a better daytrader, based on the awesome backtesting tool in ToS
    • BUT ToS is just getting too slow in the alerts, and I'm not fast enough to Alt-Tab btw IBKR and ToS to see what ticker ToS 'pinged' as a good buy, then Alt-tab into IBKR to execute. I'll be three-five 1min candles late.
      • ToS alerts are unreliable... sometimes I get it, sometimes I dont. But backtesting in ToS says I should have got the alert
      • ToS is not giving me pre-market data, although I have checked EXT in my scanner.
    The current issue with my workflow is the following:
    • picking up tickers which meets my custom buy/sell indicators fast enough
    • getting reliable alerts
    • executing the buy/sell orders fast enough
    So with a close associate of mine, we tried looking up different platforms to solve these three problems.

    Closest candidate we found was MultiCharts, but that platform's market scanner involves me MANUALLY filling up the symbols I want to scan for, and there is no way to auto-fill the scanners, even by code. Ultimate facepalm. Trade-ideas is too expensive at this stage, and does not allow me to code custom indicators.

    So back to square one. I have the following workflow need a corresponding platform

    1) Use market scanner to find the top gainers / losers (IBKR TWS)
    2) then have these top / bottom 10 listed in a watchlist. This list is dynamic, tickers may be added/removed throughout the day. (export my TWS Mosiac to Excel via DDE?)
    3) have custom indicators run for any tickers in this watchlist, alerting me to buy/sell signals. For e.g. using Ichimoko cross over lines... candlestick types...etc (code this custom in Excel?)

    Looking at the IBKR TWS API documentation, there's Excel DDE / RTD available, and there's Python.

    I have basic programming experience, writing VBA macros years ago in school & previous job. No experience with Python. I'm open to learning but I'm a digital marketer by trade, so no hardcore programming for me.

    Which path is suitable for me based on my needs above? Excel DDE / RTD with VBA to build the custom indicators? or going the Python route?

    Please advise!
     
  2. terr

    terr

    You would need to do *some* programming.

    If you can do (or you can find someone to do) do an async websocket connection and JSON (or XML) parsing, in Python or in any other setup, PM me I will help you with a solution.
     
    zeek5 likes this.
  3. Use the software language that you are most familiar and comfortable with. Be it Excel, Java, C or Python. IB's API offers the same functionality for each of the languages they support.

    In my case (FWIW): I don't like Python and have coded my stuff in Java. Most others now laugh at me as Python is the "language in vogue".
     
    zeek5 and ValeryN like this.
  4. Bad_Badness

    Bad_Badness

    For you I would prototype in Excel first since you are more familiar, then see if this is indeed the work flow you want. Also Excel updates method might not be sufficient for what you want, or be too clumber-some. That being said, it does sound like a lot of what Py offers as a language, over VBA is not relevant to your plan. Lastly, VBA may not scale as well, but performance and scale requirements are something you would know best.
     
    zeek5 likes this.
  5. katty888

    katty888

    Excel. You can use use python in or with Excel. I just downloaded a Python add-in yesterday, and you can also interact with Excel through a CLI. Excel can do a lot of (probably most of, if not more of) what Python can, but without the 100000 bugs, and you'll probably have to run your code in Jupyter too. Jupyter is cool-looking, but it's seriously kind of a pain.
     
  6. El Trado

    El Trado

    Python is easy to learn. Just go for it. Excel will be a dead-end anyways, and if you want to get anywhere near remotely serious about this, you need something more powerful.
     
  7. d08

    d08

    Excel most definitely cannot do more or even the same as python. Analyzing more than a few hundred thousand rows in Excel is close to impossible speed wise. It's requires not much effort with python and pandas. Excel is for accounting and basic spread sheets. Proper analysis is for python.
    What python bugs are you talking about?
     
  8. d08

    d08

    I think python is out of style now with Rust and other cool new languages. Practicality wise python is still great though, especially now when most data related modules rely on C/C++ for speedups.
     
  9. El Trado

    El Trado

    Python out of style? That has been said since 2005, but is not more true today than it was back then....
     
    d08 likes this.
  10. El Trado

    El Trado

    And if Pandas is not enough, one can just upgrade to Dask....
     
    #10     Sep 29, 2020