Learn R Programming

StockChina (version 0.3.1)

stock.CN: Grab Real-Time Stock Price & Volume Information in China Market

Description

With `stock.CN` function, users can obtain the real-time information about the price and volume of the stocks in China market, including Shanghai Stock Exchange (SSE) and Shenzhen Stock Exchange (SZSE).

Usage

stock.CN(stock.code)

Arguments

stock.code
The code of the stock (in character string). The format should be like "600016" or "000034".

Value

code
The code of the stock
open
The open price
prev.close
The close price of the previous market day
current
The current price of the stock
high
The highest price within the day
low
The lowest price within the day
volume
The volume traded within the day (the unit here is 'share' instead of 'hand')
amount
The amount traded within the day (The unit is Chinese Yuan)
bid.volume.1
The volume of bidding (unit: share)
bid.price.1
The latest price of bidding
ask.volume.1
The volume of asking (unit: share)
ask.price.1
The latest price of asking
date
The data on which the information obtained
time
The exact of the information obtained

Details

There are two stock exchanges in China, Shanghai Stock Exchange (SSE) and Shenzhen Stock Exchange (SZSE). The trading hours are 9:30 to 11:30, and 13:00 to 15:00 (Beijing time, i.e. UTC+08:00), Monday to Friday, excluding public holidays in China).

Examples

Run this code
symbol <- "601898"
symbols <- c("601898", "000001")

stock.CN(symbol)
sapply(symbols, stock.CN)

Run the code above in your browser using DataLab