Shioaji is sinopac provide the most pythonic api for trading the taiwan and global financial market. You can use your favorite Python packages such as numpy, scipy, pandas, pytorch or tensorflow to build your own trading model with intergrated the shioaji api on cross platform.
ts | amount | average_price | buy_price | buy_volume | change_price | change_rate | change_type | close | code | exchange | high | low | open | sell_price | sell_volume | tick_type | total_amount | total_volume | volume | volume_ratio | yesterday_volume |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
2020/12/28 01:30:00 PM | 1.1E+09 | 513.47 | 514 | 131 | 4 | 0.78 | Up | 515 | 2330 | TSE | 515 | 509 | 512 | 515 | 299 | Buy | 9.71E+09 | 18917 | 2130 | 14.15 | 1337 |
2020/12/28 01:30:00 PM | 2.57E+08 | 92.28 | 91.8 | 652 | 0 | 0 | Unchanged | 91.8 | 2317 | TSE | 93 | 91.8 | 92.4 | 91.9 | 58 | Sell | 6.18E+09 | 66999 | 2796 | 3.73 | 17956 |
2020/12/28 01:45:00 PM | 28874 | 14394.15 | 14436 | 2 | 133 | 0.93 | Up | 14437 | TXFA1 | TAIFEX | 14444 | 14320 | 14329 | 14437 | 6 | Buy | 1.18E+09 | 81663 | 2 | 11.58 | 7053 |
import shioaji as sj
import pandas as pd
# account info
SIMULATION_ID = "PAPIUSER01"
SIMULATION_ID_PASSWORD = "2222"
# login
api = sj.Shioaji(simulation=True)
accounts = api.login(person_id=SIMULATION_ID, passwd=SIMULATION_ID_PASSWORD, contracts_cb=print)
# snapshots
contracts = [api.Contracts.Stocks['2330'], api.Contracts.Stocks['2317'], api.Contracts.Futures["TXF"]["TXF202101"]]
snapshots = api.snapshots(contracts)
# convert to DataFrame
df = pd.DataFrame(snapshots)
df.ts = pd.to_datetime(df.ts)
df.set_index('ts', inplace=True)
# save as csv file
filename = "snapshots.csv"
df.to_csv(filename)
請問一下 我當初申請憑證 好像沒打密碼 這樣憑證密碼要填什麼
身分證試試
請問有辦法透過api拿到每分鐘的成交筆數(非成交量)與買賣家數嗎?
kbars 嗎?
請問一下在Linux 要如何生成 Sinopac.pfx 呢? 感謝~
https://sinotrade.github.io/misc/CA/
請先在這下載 Sinopac.pfx,之後你可以搬到你 linux 目錄,一樣可以使用
請問要如何獲取盤中零股搓合成功的前幾筆歷史紀錄呢? 透過哪個API呢?
你是指歷史 tick 嗎?