0% found this document useful (0 votes)
133 views4 pages

Hkex Api

This package provides functions to retrieve stock market data from the Hong Kong Stock Exchange including Hong Kong Hang Seng Index options data and short selling turnover data. It also includes a function to generate SQL insert statements from a dataframe. The package depends on other packages like XML, RCurl, and httr to retrieve and handle the data from HKEX.

Uploaded by

Max Chen
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
133 views4 pages

Hkex Api

This package provides functions to retrieve stock market data from the Hong Kong Stock Exchange including Hong Kong Hang Seng Index options data and short selling turnover data. It also includes a function to generate SQL insert statements from a dataframe. The package depends on other packages like XML, RCurl, and httr to retrieve and handle the data from HKEX.

Uploaded by

Max Chen
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Package ‘hkex.

api’
June 3, 2016
Title API to Retrieve Data from Hong Kong Stock Exchange
Version 0.1
Author Kimman Lui [aut, cph]
Maintainer Kimman Lui <[email protected]>
Description A set of functions helps to retrieve data from HKEX (Hong Kong Stock Ex-
change), see <https://www.hkex.com.hk/> for more information. In addition, a function gener-
ates insert SQL statements from a dataframe.
Depends R (>= 3.0.0), XML, RCurl, httr
License GPL-3
Encoding UTF-8
LazyData true
RoxygenNote 5.0.1.9000
NeedsCompilation no
Repository CRAN
Date/Publication 2016-06-03 21:58:50

R topics documented:
getHSIOptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
getLastShortSelling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
prepInsertSQL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

Index 4

getHSIOptions An API to Download HSI Options Data

Description
getHSIOptions returns HSI options in dataframe.

1
2 getLastShortSelling

Usage
getHSIOptions()

Details
The function is to retrieve HSI options data from the HKEX website.

References
https://www.hkex.com.hk

Examples
## Not run:
getHSIOptions()

## End(Not run)

getLastShortSelling An API to Download Short Selling Turnover on Main Board

Description
getLastShortSelling returns a data frame.

Usage
getLastShortSelling()

Details
The function is to retrieve short selling turnover on main board

References
https://www.hkex.com.hk

Examples
## Not run:
getLastShortSelling()

## End(Not run)
prepInsertSQL 3

prepInsertSQL A Function to Generate a List of SQL statements from Dataframe.

Description
prepInsertSQL returns a list of insert SQL statements

Usage
prepInsertSQL(tableName = "", df = NULL, quote = NULL)

Arguments
tableName a table name
df dataframe that provides data
quote (Optional) it is a vector indicates whether a data element should be quoted or
not. 1 means quoted while 0 means not.

Details
The function is to generate insert SQL statements with data.frame data

Examples
## Not run:
testData=data.frame(name=c("peter","john"), age=c(18,23))
sqlStatement=prepInsertSQL(tableName="student", testData, quote=c(1,0))

## End(Not run)
Index

∗Topic hkex.api
getHSIOptions, 1
getLastShortSelling, 2
prepInsertSQL, 3

getHSIOptions, 1
getLastShortSelling, 2

prepInsertSQL, 3

You might also like