Skip to content

Commit

Permalink
feat(hk-company): obtain interconnectivity data
Browse files Browse the repository at this point in the history
  • Loading branch information
tanchangde committed Feb 4, 2024
1 parent 9014ba9 commit 12a7d01
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 1 deletion.
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ export(lxr_hk_company_hot_ss)
export(lxr_hk_company_hot_tr_dri)
export(lxr_hk_company_indices)
export(lxr_hk_company_industries)
export(lxr_hk_company_mutual_market)
export(lxr_hk_company_operation_revenue_constitution)
export(lxr_hk_company_profile)
export(lxr_hk_company_repurchase)
Expand Down
7 changes: 7 additions & 0 deletions R/hk-company.R
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
#' * `lxr_hk_company_hot_tr_dri()` obtain dividend reinvestment yield data.
#' * `lxr_hk_company_hot_mm_ah()` obtain interconnectivity data.
#' * `lxr_hk_company_hot_ss()` get the short-selling data.
#' * `lxr_hk_company_mutual_market()` obtain interconnectivity data.
#'
#' @return A string of the API endpoint.

Expand Down Expand Up @@ -232,3 +233,9 @@ lxr_hk_company_hot_mm_ah <- function() {
lxr_hk_company_hot_ss <- function() {
"https://open.lixinger.com/api/hk/company/hot/ss"
}

#' @rdname lxr_hk_company
#' @export
lxr_hk_company_mutual_market <- function() {
"https://open.lixinger.com/api/hk/company/mutual-market"
}
3 changes: 2 additions & 1 deletion R/query-params.R
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ lxr_query_params <- function(endpoint) {
hk_company_fs_other_financial = fs_params,
hk_company_hot_tr_dri = min_params,
hk_company_hot_mm_ah = min_params,
hk_company_hot_ss = min_params
hk_company_hot_ss = min_params,
hk_company_mutual_market = common_params
)
}
4 changes: 4 additions & 0 deletions man/lxr_hk_company.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions tests/testthat/test-hk-company.R
Original file line number Diff line number Diff line change
Expand Up @@ -308,3 +308,14 @@ test_that("test hk_company_hot_ss", {
expect_s3_class(result, "tbl_df")
expect_true(nrow(result) > 0)
})

test_that("test hk_company_mutual_market", {
result <- lxr_query(
endpoint = lxr_hk_company_mutual_market(),
start_date = "2023-02-04",
end_date = "2024-02-04",
stock_code = "00700"
)
expect_s3_class(result, "tbl_df")
expect_true(nrow(result) > 0)
})

0 comments on commit 12a7d01

Please sign in to comment.