C++ 我的股票市场程序可以使用什么数据源?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/728126/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-27 16:57:41  来源:igfitidea点击:

What data source could I use for my stock market program?

c++open-sourcestockstrading

提问by Nick Bolton

I would like to make a free open-source C++ application for both Linux and Windows which will create live stock market charts (i.e. they're refreshed frequently).

我想为 Linux 和 Windows 制作一个免费的开源 C++ 应用程序,它将创建实时股票市场图表(即它们经常刷新)。

Please could you give me some pointers on these issues:

请您就这些问题给我一些建议:

  • What should I use as the data source? Are there free services I can implement? I would like to use the same or similar information as companies like Google.
  • I'm not sure what GUI toolkit would be best to use, is there one which has charting built in, or would I need to use a specialized library for this?
  • 我应该使用什么作为数据源?是否有我可以实施的免费服务?我想使用与Google 等公司相同或相似的信息。
  • 我不确定最好使用哪种 GUI 工具包,是否有内置图表的工具包,或者我是否需要为此使用专门的库?

Some things to note:

一些注意事项:

  • This is my first attempt at both cross-platform C++ development, and a GUI application for Linux.
  • I'm based in the UK, so I'd like to use data sources that provide information for the London stock exchange (LON) as well as NASDAQ, etc.
  • 这是我第一次尝试跨平台 C++ 开发和 Linux 的 GUI 应用程序。
  • 我在英国,所以我想使用为伦敦证券交易所 (LON) 以及纳斯达克等提供信息的数据源。

采纳答案by mpen

As of Nov 2014, these links are dead.

截至 2014 年 11 月,这些链接已失效。

回答by Duck

Assuming the rules in the UK are the same as in the US, you basically have 3-tiered choices.

假设英国的规则与美国的规则相同,您基本上有 3 层选择。

You can hack together a lame feed from things like Google or Yahoo but you absolutely are not getting every tick, if that is what you are after.

你可以从谷歌或雅虎之类的东西中破解一个蹩脚的提要,但你绝对不会得到每一个滴答声,如果这是你所追求的。

A step up from the obvious internet sources are some of the online brokers. Their data is more reliable and timely but obviously you need an account and they have to offer some kind of API. Check into something like InteractiveBrokers.com. They are mostly java centric but offer a Window's based C++ DLL as well. Several other brokers offer similar APIs but IB is excellent in that it covers a multitude of exchanges including, I believe, London. They also make it relatively easy to transfer currencies if that is a concern.

一些在线经纪人比明显的​​互联网资源更进一步。他们的数据更可靠和及时,但显然你需要一个帐户,他们必须提供某种 API。检查像InteractiveBrokers.com这样的东西。它们大多以 Java 为中心,但也提供基于 Window 的 C++ DLL。其他几家经纪商也提供类似的 API,但 IB 非常出色,因为它涵盖了包括伦敦在内的众多交易所。如果担心的话,它们还可以使转移货币变得相对容易。

Lastly you have to go to commercial brokers. You can find them easily enough with a search but be prepared to pay a couple of hundred dollars per month minimum.

最后,你必须去商业经纪人。您可以通过搜索轻松找到它们,但要准备好每月至少支付几百美元。

I think Mark's suggestion of QT is a good way to go for a GUI. Java tends to be adequate for putting up a grid of running quotes but tends to fail in the charting area, IMO.

我认为 Mark 对 QT 的建议是使用 GUI 的好方法。Java 往往足以建立一个运行报价网格,但在 IMO 图表区域往往会失败。

回答by John Dibling

You said you wanted "live" market charts. If you mean real-time, you will never get that for free. All the data you see on google etc is delayed, usually at least 15 minutes, and they don't get every tick.

你说你想要“实时”市场图表。如果您的意思是实时,那么您将永远不会免费获得它。你在谷歌等上看到的所有数据都被延迟了,通常至少 15 分钟,而且他们并没有得到每一个滴答声。

回答by Mjaker

If a delay is not a problem and if you are only interested in daily data, you can easily get historical data for free via simple HTTP request using this historical data API.

如果延迟不是问题,并且您只对日常数据感兴趣,那么您可以使用此历史数据 API通过简单的 HTTP 请求轻松免费获取历史数据。