From de30daf3016467d633a70a4e246d13763761c291 Mon Sep 17 00:00:00 2001 From: YenChen Date: Sun, 1 Dec 2024 16:07:06 +0800 Subject: [PATCH 1/2] add: TaiwanBusinessIndicator --- docs/tutor/TaiwanMarket/Others.md | 65 ++++++++++++++++++++++++++++++- 1 file changed, 64 insertions(+), 1 deletion(-) diff --git a/docs/tutor/TaiwanMarket/Others.md b/docs/tutor/TaiwanMarket/Others.md index d9cbb34..a4eee2a 100644 --- a/docs/tutor/TaiwanMarket/Others.md +++ b/docs/tutor/TaiwanMarket/Others.md @@ -1,7 +1,8 @@ -在台灣股票新聞面,我們擁有 1 種資料集,如下: +在台灣股票新聞面,我們擁有 2 種資料集,如下: - [相關新聞表 TaiwanStockNews](https://finmind.github.io/tutor/TaiwanMarket/Others/#taiwanstocknews) +- [台灣每月景氣對策信號表 TaiwanBusinessIndicator](https://finmind.github.io/tutor/TaiwanMarket/Others/#taiwanbusinessindicator-backersponsor) #### 相關新聞表 TaiwanStockNews @@ -63,4 +64,66 @@ source: str, title: str } + ``` + +#### 台灣每月景氣對策信號表 TaiwanBusinessIndicator (只限 [backer、sponsor](https://finmindtrade.com/analysis/#/Sponsor/sponsor) 會員使用) + +!!! example + === "Python" + ```python + import requests + import pandas as pd + url = "https://api.finmindtrade.com/api/v4/data" + parameter = { + "dataset": "TaiwanBusinessIndicator", + "start_date": "2024-04-01", + "end_date": "2025-01-01", + "token": "", # 參考登入,獲取金鑰 + } + data = requests.get(url, params=parameter) + data = data.json() + data = pd.DataFrame(data['data']) + print(data.head()) + ``` + === "R" + ```R + library(httr) + library(data.table) + library(dplyr) + + url = 'https://api.finmindtrade.com/api/v4/data' + response = httr::GET(url = url, + query = list( + dataset="TaiwanBusinessIndicator", + start_date= "2020-04-01", + "end_date": "2025-01-01", + token = "" # 參考登入,獲取金鑰 + ) + ) + data = response %>% content + df = do.call('cbind',data$data) %>%data.table + head(df) + ``` +!!! output + === "DataFrame" + | | date | leading | leading_notrend | coincident | coincident_notrend | lagging | lagging_notrend | monitoring | monitoring_color | + |-----:|:------------|-----------:|:-----------------:|:-----------:|:--------------------|:--------|:-----------------|:------------|:------------------| + | 0 | 2024-01-01 | 92.32 | 99.85 | 90.8 | 98.21 | 91.82 | 99.31 | 27 | G | + | 1 | 2024-02-01 | 92.71 | 100.35 | 91.45 | 98.99 | 91.68 | 99.25 | 29 | G | + | 2 | 2024-03-01 | 93.19 | 100.95 | 92.28 | 99.97 | 91.6 | 99.23 | 31 | G | + | 3 | 2024-04-01 | 93.75 | 101.63 | 93.23 | 101.07 | 91.52 | 99.22 | 35 | YR | + | 4 | 2024-05-01 | 94.29 | 102.28 | 94.21 | 102.19 | 91.41 | 99.16 | 36 | YR | + === "Schema" + ``` + { + date: str, + leading: float32, + leading_notrend: float32, + coincident: float32, + coincident_notrend: float32, + lagging: float32, + lagging_notrend: float32, + monitoring: float32, + monitoring_color: str + } ``` \ No newline at end of file From 8795a33ceb63ea6c8317c5ec6454e992036eb537 Mon Sep 17 00:00:00 2001 From: YenChen Date: Sun, 1 Dec 2024 16:08:58 +0800 Subject: [PATCH 2/2] add: TaiwanBusinessIndicator in data lisr page --- docs/tutor/TaiwanMarket/DataList.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/tutor/TaiwanMarket/DataList.md b/docs/tutor/TaiwanMarket/DataList.md index 1a438c5..a8b76a2 100644 --- a/docs/tutor/TaiwanMarket/DataList.md +++ b/docs/tutor/TaiwanMarket/DataList.md @@ -1,4 +1,4 @@ -在台灣金融市場,我們擁有 61 種資料集,如下: +在台灣金融市場,我們擁有 62 種資料集,如下: #### 技術面 Technical @@ -86,5 +86,6 @@ #### 其他 Others - [相關新聞 TaiwanStockNews](https://finmind.github.io/tutor/TaiwanMarket/Others/#taiwanstocknews) +- [台灣每月景氣對策信號表 TaiwanBusinessIndicator](https://finmind.github.io/tutor/TaiwanMarket/Others/#taiwanbusinessindicator-backersponsor) 具體 schemas 請參考 [finmindapi](http://api.finmindtrade.com/docs)