Skip to content

Commit

Permalink
fix: async document
Browse files Browse the repository at this point in the history
  • Loading branch information
samlin17 committed Jan 5, 2025
1 parent bce0ae7 commit d87bed9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
9 changes: 6 additions & 3 deletions docs/tutor/TaiwanMarket/Chip.md
Original file line number Diff line number Diff line change
Expand Up @@ -1392,10 +1392,13 @@
from loguru import logger
import datetime

api = DataLoader()
token = ""

data_loader = DataLoader()
data_loader.login_by_token(token)

date = '2024-12-20'
taiwan_stock_price_df = api.taiwan_stock_daily(start_date=date)
taiwan_stock_price_df = data_loader.taiwan_stock_daily(start_date=date)
# 只拿取當天交易量大於 0 的股票
taiwan_stock_price_df = taiwan_stock_price_df[
["stock_id", "Trading_Volume"]
Expand All @@ -1405,7 +1408,7 @@
]
# 拿取當天上市櫃,industry_category 非大盤, index, 所有證券的股票 ID
# 因為這些股票沒有分點
stock_info_df = api.taiwan_stock_info()
stock_info_df = data_loader.taiwan_stock_info()
stock_info = stock_info_df[stock_info_df["type"].isin(["twse", "tpex"])]
cate_mask = stock_info["industry_category"].isin(
["大盤", "Index", "所有證券"]
Expand Down
9 changes: 6 additions & 3 deletions docs/tutor/TaiwanMarket/Technical.md
Original file line number Diff line number Diff line change
Expand Up @@ -1505,10 +1505,13 @@
from loguru import logger
import datetime

api = DataLoader()
token = ""

data_loader = DataLoader()
data_loader.login_by_token(token)

date = '2024-12-20'
taiwan_stock_price_df = api.taiwan_stock_daily(start_date=date)
taiwan_stock_price_df = data_loader.taiwan_stock_daily(start_date=date)
# 只拿取當天交易量大於 0 的股票
taiwan_stock_price_df = taiwan_stock_price_df[
["stock_id", "Trading_Volume"]
Expand All @@ -1518,7 +1521,7 @@
]
# 拿取當天上市櫃,industry_category 非大盤, index, 所有證券的股票 ID
# 因為這些股票沒有分點
stock_info_df = api.taiwan_stock_info()
stock_info_df = data_loader.taiwan_stock_info()
stock_info = stock_info_df[stock_info_df["type"].isin(["twse", "tpex"])]
cate_mask = stock_info["industry_category"].isin(
["大盤", "Index", "所有證券"]
Expand Down

0 comments on commit d87bed9

Please sign in to comment.