A Semi-automated system with Python and IB api

Years ago, I ended up creating my own charting solution based on JFreeChart. Then I eventually abandoned JFreeChart after realizing how little is actually needed to chart something, at least in Java. Creating a simple chart with some bars and indicators did not take much time.

yes, you are right.

at this moment. I am using the bokeh package for charting purpose. I can plot candle sticks, and indicators on it, or in a separate grid. But, if I need some more functionality, like plotting a trend line on it. I have to dig into JavaScript. I am not from a programming background. And no more learning of a language. :D
 
C# is a Micro$oft language, as well the operating system it runs on: it runs only on Window$ cr*p!
A double knock-out criteria for me. :)

For more than 15 years now I've stopped using anything by MS, b/c their products are nothing but spying-tools, IMHO.
I've switched to the free and open-source operating system Linux (I'm using the Debian distro with the lightweight desktop LXDE/LXQt).

And imagine I was even a certified Micro$oft Developer (programming) as well a Technician (networks & systems) :D

It's all a big lie by these big corporations like MSFT, INTC, GOOG, much like the social media companies Face$hit/META, TWTR, etc. They just want to grab all of your data and want to know everything about you and your habits and your accounts, subscriptions, and all the details of your digital life!
IMO these companies have become corrupt subsidiaries of the spy agencies CIANSAMOSSAD.

AMD I'm not counting yet to that pack to avoid, not yet... :D

Linux is the future. And Apple's operating system is Linux-like. So, Linux/Unix is the future, and Windows is the dead past :).
The earlier you too make the switch to Linux the better for your future :)

And: soon expect China and Russia (and some more countries) banning Windows from all government, military, and education installations. They already doing this at least partially, IMO.

Cool, I am using a Ubuntu version of Linux
 
Step 1:

I chat with a technical assistant with IB. It is impossible to integrate python code in the back ground of TWS.

So, it can only be done on the python side.

Let's go for it !
 
Yeah, let's not open the can of worms re platform and OS preference.

I bet with you that I can write a professionally looking Wpf UI faster and with better features than most who use QT. To me that's a very crude way to write and design UIs. But as you said, to each his own.

Asp.net is for web applications. I was comparing stuff that runs on local hardware platforms, not web. It seems to be trending down but yes, still very popular.



That stuff is much more elegant and compact in at least the Python versions of Qt. After watching the vid I'm glad to look at clean Python code.
In the end to each their own. I definitely don't want to be stuck on Windows as I only use it for entertainment. Platform dependence is nauseating.
 
It's not even about preference but the availability of choices. I right now can run by backtester on either Windows or Linux without any modifications. That's freedom.

Your bet isn't worth anything as it cannot be objectively tested. Who are these "most who use Qt" and who is judging? Nothing crude about Qt at all, clarity of code and less boilerplate is good as you said yourself.
Qt Quick seems to be the preferred choice for anything mobile but I've yet to try it out myself.

It's an interesting comparison and what I didn't realise that C# WPF is very slow. That's why even the python version of Qt is very fast because underneath it's all C++ calls and the python is just a wrapper, best of both worlds.
 
You can have C++ work under the hood for anything that is performance critical. And what do you mean with WPF slow. Show me a single charting and visualization library, for example, that beats Scichart and a few others, performance wise. It is offered primarily as WPF library. You won't be able to. All backend and essentially non UI stuff in dot net core can run unmodified on windows and any other Linux distribution.

I am happy you found your preferred setup but please don't make factually incorrect claims. If WPF is slow for someone then it's because that person uses poorly designed toolboxes or inefficiently codes. The wpf libraries in scichart can visualize hundreds of millions of data points, allow user interaction to pan, zoom, all that with full support of hardware acceleration and rendering. The library is also used for 3D rendering by mining companies to visualize and model mineral deposits. Sure some routines in that toolbox use C++ and why not. Can you point us to a similar library in QT that does what scichart does? I use that library along with Devexpress and never had a wpf app that was too slow or unresponsive ever.

It's not even about preference but the availability of choices. I right now can run by backtester on either Windows or Linux without any modifications. That's freedom.

Your bet isn't worth anything as it cannot be objectively tested. Who are these "most who use Qt" and who is judging? Nothing crude about Qt at all, clarity of code and less boilerplate is good as you said yourself.
Qt Quick seems to be the preferred choice for anything mobile but I've yet to try it out myself.

It's an interesting comparison and what I didn't realise that C# WPF is very slow. That's why even the python version of Qt is very fast because underneath it's all C++ calls and the python is just a wrapper, best of both worlds.
 
If I were going to create my own specialized trading package, I'd choose python with PyQt (or PySide) mainly for two reasons: faster turnaround in prototyping and ability to run on the 3 major OSes. An alternative to those who don't like Qt could be replacing it with DearPyGui.

Separate out the data/order manager into a separate process and use zeromq to communicate with charts and strategies. Heck, a reasonably priced AMD Ryzen Gen 3 12 or 16 core CPU and 32 gig of 3200 DDR4 memory and fast NVMe would be overkill so each chart and strategy could have its own process communicating with the data/order manager.

Python programming has a fun factor (for me). C++ is so complex these days (to me) that the fun factor is gone.

I like C# a lot. I don't know enough about MAUI yet to comment about the viability of running something like the above across the 3 major OSes. It's super new for everyone right now.

I started the candlestick charting piece in python with the pythonnet package and really enjoyed the prototyping turnaround. But I got to thinking that it's better (for me) to switch over to PyQT to keep my options open across the OSes.

I was thinking the data/order manager process could be coded with either erlang or elixir which would open up some really cool transparent distributed programming possibilities.
 
Last edited:
Some other python libraries that might be useful
- pyqtgraph. Already mentioned by d08 in another thread.
- finplot. built on top of pyqtgraph for financial plotting
I have played with this one. The code is little bit messy.
Other than that, very few issues, quite reliable and stable.
- curio, by David Beazley. An alternative to asyncio and
asynchronous networking
 
If I were going to create my own specialized trading package, I'd choose python with PyQt (or PySide) mainly for two reasons: faster turnaround in prototyping and ability to run on the 3 major OSes. An alternative to those who don't like Qt could be replacing it with DearPyGui.

Separate out the data/order manager into a separate process and use zeromq to communicate with charts and strategies. Heck, a reasonably priced AMD Ryzen Gen 3 12 or 16 core CPU and 32 gig of 3200 DDR4 memory and fast NVMe would be overkill so each chart and strategy could have its own process communicating with the data/order manager.

Python programming has a fun factor (for me). C++ is so complex these days (to me) that the fun factor is gone.

I like C# a lot. I don't know enough about MAUI yet to comment about the viability of running something like the above across the 3 major OSes. It's super new for everyone right now.

I started the candlestick charting piece in python with the pythonnet package and really enjoyed the prototyping turnaround. But I got to thinking that it's better (for me) to switch over to PyQT to keep my options open across the OSes.

I was thinking the data/order manager process could be coded with either erlang or elixir which would open up some really cool transparent distributed programming possibilities.

That's a lot of information in it. Thank you Steve !
 
Back
Top