Welcome to NexusFi: the best trading community on the planet, with over 150,000 members Sign Up Now, It is Free
Genuine reviews from real traders, not fake reviews from stealth vendors
Quality education from leading professional traders
We are a friendly, helpful, and positive community
We do not tolerate rude behavior, trolling, or vendors advertising in posts
We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community. It's free for basic access, or support us by becoming an Elite Member -- see if you qualify for a discount below.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
Feasibility to create alerts in TWS (IB) Charts using APIs
Hi Fellow Traders - I want to create Alert in TWS Charts (Interactive Brokers) at a price point as defined in an Excel Sheet using APIs. Eg. Get an alert created in TWS Charts for ES at price point of 3980 mentioned in Excel Sheet. This way I would be able to create alerts in an automated fashion rather than manually putting the alerts. I do not have any knowledge on Python OR API's but I am happy to go through learning curve to achieve this end objective. But before I take this journey, I want to seek guidance from you if it is technically feasible for creating alerts within charts using APIs. Thanks heaps.
Can you help answer these questions from other members on NexusFi?
With knowledge of one of the major programming languages, this is just not feasible. Ditch Excel, and pick a language to learn. I would recommend Python.
I say this, as someone, who was in your shoes, back in June 2021. My progression was as follows:
1. Learn Python. I started learning Python one year before I even thought about trading using IBAPI.
2. Learn IB's Python API. IB's documentation is meaningless unless you have a deep understanding of Python.
I started off by reading Michael Scarpino's book on the topic. I found it to be a bit dense. Nevertheless, I gave the Python section an initial read. And didn't return to the book.
After that, found two excellent courses on Udemy offered by Mayank Rasu. You need to get both courses (the beginner and advanced). Further, wait for a Udemy sale before purchasing.
Those two steps should be sufficient for now, and should keep you busy for approximately 4 to 9 months.
Thanks for sharing your journey and thoughts as well as guiding on the path to be followed. My initial objective was to use Python to create the alerts in charts, but as it is technically not feasible, I am unsure what benefits would be there for me to learn Python language. Setting some objectives or achievement target from learning of Python would be useful. If you don't mind, can I ask you where all and functionalities you use from accessing IB's API using Python? This will broaden my thoughts and help. Thanks again.
Manually creating alerts on TWS is incredibly clunky ... That being said- I hired a programmer to write an API for me- he wasn't a finance guy- so learning terms was a hurdle-but in the end- it worked- the system wasn't overly complicated, but the coding of the API was pretty intense.
I think an API for alerts could be just as complicated I'm afraid ...
Thanks for sharing your thoughts. As also mentioned by "BA 21" chart alerting would not be feasible in IB TWS, so will not pursue this further. On your mention of getting API written - if you don't mind can you please explain the functionality for which you had got the API programmed? I am trying to set some objective for me so that I can pursue learning of Python language. Thanks.
Sure, my API- actually analyzed data and automatically placed buy and sell stop orders above and below a level that was computed based on that past data. It was written in C# and functionality was good but I abandoned the strategy, the strategy may have actually worked but I abandoned it a few years ago as I went in a different direction. My programmer was very competent and has gone on to work for Google, but as I said it was quite a challenge getting him to understand what I wanted and then getting it coded to do exactly what I wanted ...
The following user says Thank You to OccamsRazorTrader for this post:
Most of the functionality I use is outside of IB's API. As far as signal generation, I use Python's Pandas library to process price data. For technical indicators, I use Python's TALib.
The functionality I use from IB API is to retrieve data and to enter and exit trades. Since I trade different futures contracts against each other, I find it better to use IB API to leg into and out of trades instead of legging manually.
I only use TWS as a conduit, because due to it clunky architecture, I have to open TWS and have it running to enable my Python client to place trades.
In my opinion, and despite its clunky architecture, I find that IB API offers me the greatest amount of flexibility when it comes to creating and executing trading strategies. For example, I find that Python tools (ADF and Johansen tests) to determine whether price action is ranging or trending to be far superior than traditional technical analysis tools such as ADX.
Again, IB API has a notoriously steep learning curve. Whenever I am pulled away from trading for a couple of months (I still have a 9-to-5, and am subject to layoffs), I find myself needing a refresher.
In my opinion, I think you should invest the time to learn Python and IB API. At first, I was reluctant to learn the two. But there aren't any other platforms that offers the flexibility I want to pairs trade (pairs, butterflies, and double butterflies) futures.
PS: Another option is to get familiar with Matplotlib and create alerts on a Python chart vs plotting them on TWS' charts.
Thanks "BA 21" for the detailed explanation. I have heard of some of the terms used for the first time, presumably because of lack of knowledge of Python. I would plan to get into it slowly as I am also in similar boat of working 9 to 5 and then I use the balance hours to do some trading which leaves very small window. But if I need to do things better, I would need to become smarter. Thanks again.
A 9-to-5 can be an impediment. Last August, I took a year off from work to develop my skills. Over the past year, I enrolled in a three month data science boot camp, because data science tools can help with trading. After the data science boot camp, I enrolled in a six month algo trading course. Both courses were Python-intensive; hence, I also got an opportunity to sharpen my Python skills.
Now, it time to start looking for a job.
I have learned a lot in the past year. Sometimes, you have take several steps back to proceed forward.
The following user says Thank You to ZB23 for this post: