Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sqlite3 | |
import datetime | |
import tejapi | |
stocks = tejapi.get('TWN/EWNPRCSTD',paginate=True) | |
# 上市所有普通股代碼 | |
code = stocks[(stocks.market=='TSE')&(stocks.stypenm == '普通股')].coid.values | |
# 連接資料庫 | |
conn = sqlite3.connect('example.db') | |
for stock in code: |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
""" | |
Created on Wed Apr 7 14:52:38 2021 | |
@author: 2021011903 | |
""" | |
return_=pd.DataFrame() | |
dates = result['財報年月'].astype(str).apply(lambda x: x.split(' ')[0]).unique() | |
step = 0.2 | |
for date in dates: |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 調整畫圖模組 | |
plt.style.use('seaborn-darkgrid') | |
# 調整字體 | |
plt.rcParams['font.sans-serif']=['Microsoft YaHei'] | |
# 可自行輸入股票代號 | |
stock =input() | |
title = stock+' '+stk['證券名稱'][stk['證券碼']==stock].to_list()[0] | |
fig, FI1 = plt.subplots(figsize=(10,5)) | |
plt.title(title,{'fontsize' : 20}) | |
plt.xlabel('Date', fontsize=14) |
OlderNewer