访问共同基金报价

发布于 2024-12-07 03:27:13 字数 503 浏览 1 评论 0原文

我一直在寻找如何在 C# 中检索金融报价,在本例中是加拿大共同基金。

似乎有两个主要的信息来源,雅虎和谷歌!似乎还有两种首选方法:API 和 HTML 报废。我更喜欢 API 方法,但我愿意接受任何建议。

我发现 Yahoo api 非常好用,但是尽管它适用于“MSFT”等股票,但无法检索“RBCCANADIANI.TO”等共同基金的数据。由于某种原因,该符号仅适用于网站本身。

Google 的 API 似乎需要设置投资组合并登录才能检索报价,我宁愿避免登录并在可能的情况下使用完全开放的 API。

HTML 抓取引入了一系列全新的复杂性,要​​求用户在 html 页面上找到价格等信息。请注意,Google 的 html (http://www.google.com/finance?q=MUTF_CA:RBF556) 返回正确的页面,但查看 html 源代码会发现价格不是在易于识别的标签中(id 未设置) !)。

有没有人尝试过类似的事情,我感觉我在这里错过了一些东西:)

非常感谢

I have been looking for a while at how to retrieve financial quotes in c#, in this case, Canadian mutual funds.

It seems there are 2 main sources of information for this, Yahoo and Google! Also there seems to be 2 preferred methods, API and HTML scrapping. My preference would be for an API method, but I am open to any suggestion.

I have found the Yahoo api to be very nice to use, however although it works for stocks like "MSFT" it fails to retrieve the data for mutual funds like "RBCCANADIANI.TO". For some reason this symbol only works on the web site itself.

Google's API seems to requires to have a portfolio set up and login in order to retrieve quotes, I would prefer to avoid logins and use a completly opened api if possible.

HTML scraping introduce a totally new set of complications, asking the user to locate on an html page where the price is and such. Note that Google's html (http://www.google.com/finance?q=MUTF_CA:RBF556) returns the right page, but a look at the html source shows that the price is not in an easily identifiable tag (id not set!).

Has anybody tried similar things, I have the feeling I am missing something here :)

Many thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

掌心的温暖 2024-12-14 03:27:14

如果您正在寻找定价数据,我建议您使用 IQFeed 之类的服务。我已经使用他们作为客户一段时间了,他们确实有共同基金数据(尽管我不使用它)。如果你不想付钱,你可能不得不刮掉它。

If you are looking for pricing data I would suggest a service like IQFeed. I have used them as a client for some time and they do have mutual fund data (although I don't use it). If you don't want to pay for it you will probably have to scrape it.

又怨 2024-12-14 03:27:13

我成功执行了以下 YQL 查询:

select LastTradePriceOnly from yahoo.finance.quotes where symbol in ("F0CAN05NGC.TO")

这是针对 Royal Global Precious Metals 基金的。

共同基金有 LastTradePriceOnly 字段,但没有像股票那样的 Bid 字段。我从雅虎财经页面上的符号查找中获取了该符号。

I am having success with the following YQL query:

select LastTradePriceOnly from yahoo.finance.quotes where symbol in ("F0CAN05NGC.TO")

This is for Royal Global Precious Metals fund.

Mutual funds have a LastTradePriceOnly field but no Bid field like stocks have. I got the symbol from the Symbol Lookup on the Yahoo finance page.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文