[R Language] Quantmod package get domestic stock data

Source: Internet
Author: User

2016/05/09 Append: corresponding QUANTMOD package related instructions reference http://www.quantmod.com/

The Quantmod package defaults to access to Yahoo Finance data, including SSE and Shenzhen stock data, as well as Hong Kong equities.

The SSE code is SS, deep Proof code is SZ, Hong Kong stock code is HK

such as Maotai: 6000519.SS, Vanke 000002.sz, Changjiang industrial 0001.hk

Use the following command in the R console:

> Library (QUANTMOD)

> Setsymbollookup (wk=list (name= ' 000002.sz ', src= ' Yahoo '))
> Getsymbols ("WK")
[1] "WK"
> ChartSeries (WK)



The test of Guizhou Maotai is as follows:

> Setsymbollookup (gzmt=list (name= ' 600519.ss ', src= ' Yahoo '))
> Getsymbols ("GZMT")
[1] "GZMT"
> ChartSeries (GZMT)



The test of Changjiang industry is as follows:

> Setsymbollookup (cjsy=list (name= "00001.hk", src= "Yahoo"))
> Getsymbols ("Cjsy")

> ChartSeries (cjsy, up.col= ' Red ', dn.col= ' green ', Ta= "Addvo (); ADDMACD (); Addsma (n=10)")



Shanghai:

> Getsymbols ("^ssec")

> ChartSeries (SSEC, up.col= ' Red ', dn.col= ' green ', Ta= "Addvo (); ADDMACD (); Addsma (n=10)")


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.