使用图表构建交易平台 - 对 Python GUI 库的建议 [英] Building a trading platform with charts - suggestions for a Python GUI Library

查看:24
本文介绍了使用图表构建交易平台 - 对 Python GUI 库的建议的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在构建一个小程序来从市场中检索数据并实时绘制图表.虽然交易决策将在很大程度上自动化,但图表会不断更新,以便有人可以跟踪决策的制定方式并在必要时手动干预.

I am building a small program to retrieve data from the market and chart it in real time. While the trading decisions will be largely automated, the charts are updated continuously so that someone can keep track of how the decisions are being taken and manually intervene when necessary.

对于任务来说,什么是好的 GUI 库(对于 Python).以下是注意事项 -

What would be a good GUI Library for the task (for Python). Here are the considerations -

编程语言:Python(您认为我应该使用其他语言吗?甚至可以使用不同语言的 GUI 和后端?!!).
操作系统:最好是跨平台的,但如果它必须是特定于平台的,则是 Linux.
速度 + 学习曲线:虽然时间(低延迟)不是一个关键问题,我更喜欢易于使用和快速学习的东西,但该程序必须具有响应性和我不想用速度来换取超过某个点的编码难度.我想这是您的经验可以帮助我的部分.

Programming Language : Python (Do you think I should use something else? May be even do the GUI and backend in different languages?!!).
Operating System : Preferably cross-platform, but if it has to be platform specific, then Linux it is.
Speed + Learning Curve : While time (low latency) is not a critical issue and I would prefer something easy to use and fast to learn, the program has to feel responsive and I would not like to trade speed for ease of coding beyond a certain point. I guess this is the part where your experience could help me out.

我强烈考虑过 WxPython,但有些评论说它设计得不好(例如,不适合 Python!)

I had strongly considered WxPython, but some of the comments said it was not well-designed (as in, doesn't fit well with Python!)

因此,任务的复杂性和元考虑已经摆在您面前.请帮助/建议.

So the complexity of the task and meta-considerations have been laid down in front of you. Please help/suggest.

附言:虽然我们在做,但如果有人也能评论一个合适的图表库,那就太好了.

P.S. : While we are at it, if someone could comment on a suitable charting library as well, it would be nice.

推荐答案

对于在 Python 中绘图,我非常喜欢 Matplotlib (http://matplotlib.sourceforge.net/),它本质上是一个构建在 Pylab 之上的更加用户友好的包装器(http://www.scipy.org/PyLab).它真的很强大,并且有大量的文档和示例.听起来您的图表并不是很复杂,因此您可能不必深入研究包;我认为您获得的 API 越深入,开发就会越复杂,但大多数软件包可能都是如此.

For plotting in Python, I'm a big fan of Matplotlib (http://matplotlib.sourceforge.net/) which is essentially a more user-friendly wrapper built on top of Pylab (http://www.scipy.org/PyLab). It's really powerful and has a TONS of documentation and examples. It doesn't sound like your charts are very complicated, so you probably won't have to dig too deeply into the package; I think the development gets hairier the deeper into the API you get, but that's probably true of most packages.

我碰巧最终使用了 Tkinter 后端,但 matplotlib 也支持 QT、WxPython 等.我不是 Tkinter 或 WxPython 的忠实粉丝,如果有选择,可能会使用 QT,但很高兴所有选项都在那里.我在 Linux 和 Mac OS X 上都使用过 matplotlib,并取得了很大的成功.

I happened to end up using the Tkinter backend, but matplotlib also supports QT, WxPython and others. I'm not a huge fan of Tkinter or WxPython and probably would've used QT instead given the choice, but it's nice that all the options are there. I've used matplotlib on both Linux and Mac OS X with a lot of success.

作为旁注,如果您决定走这条路线,这里有一篇关于在 WxPython 中绘图的有趣相关 SO 帖子:wxPython 最好的实时绘图小部件是什么?

As a side note, here's an interesting related SO post on plotting in WxPython if you decide to go that route: What is the best real time plotting widget for wxPython?

这篇关于使用图表构建交易平台 - 对 Python GUI 库的建议的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆