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.
另外 api.update_status(api.stock_account) 這函數需要代參數嘛? api.stock_account? 因為看到有些範例是沒有帶
可以不帶參數,但如果你一個帳戶底下,有多個 stock_account 帳戶,就需要帶參數,一般人應該只有一組 stock/future account
請問收盤後我下單 status 顯示是 PreSubmitted~ 我去cancal 這個 trade 出現下面錯誤訊息~ 請問是因為PreSubmitted 無法去 cancel?
"status": {
"id": "xxxxx",
"status": "PreSubmitted",
"status_code": "R",
"order_datetime": "2020-12-18 14:58:36",
"msg": "",
"modified_time": null,
"modified_price": 10.3,
"deal_quantity": 0,
"cancel_quantity": 1,
"deals": []
}
python3.8/site-packages/shioaji/shioaji.py", line 428, in cancel_order
trade = self._solace.cancel_order(trade, timeout, cb)
│ │ │ │ │ │ └ None
│ │ │ │ │ └ 5000
│ │ │ │ └ Trade(contract=Stock(exchange=<Exchange.TSE: 'TSE'>, code='2890', symbol='TSE2890', name='永豐金', category='17', limit_up=12.3, li...
│ │ │ └ <bound method SolaceAPI.cancel_order of <shioaji.backend.solace.api.SolaceAPI object at 0x7f00a0752400>>
│ │ └ <shioaji.backend.solace.api.SolaceAPI object at 0x7f00a0752400>
│ └ <shioaji.shioaji.Shioaji object at 0x7f00c1e27cd0>
└ Trade(contract=Stock(exchange=<Exchange.TSE: 'TSE'>, code='2890', symbol='TSE2890', name='永豐金', category='17', limit_up=12.3, li...
File "shioaji/backend/solace/api.pyx", line 522, in shioaji.backend.solace.api.SolaceAPI.cancel_order
File "shioaji/backend/solace/api.pyx", line 495, in shioaji.backend.solace.api.SolaceAPI._cancel_order_cb
File "/home/shihyu/anaconda3/lib/python3.8/site-packages/shioaji/utils.py", line 49, in raise_resp_error
raise Exception(resp)
│ └ {'status': {'status_code': 500}, 'response': {'detail': 'Internal Server Error'}}
└ <class 'Exception'>
Exception: {'status': {'status_code': 500}, 'response': {'detail': 'Internal Server Error'}}
Sentry is attempting to send 2 pending error message
api.cancel_order(trade), 刮號裡面的 trade 是指具體要輸入什麼?還是這行的上面要再跑什麼產生 trade, 這是要刪單的功能。
可以參考這篇 https://sinotrade.github.io/tutor/order/Stock/#place-order-rod-lmt
大家好 我是新手 想請問 pip install shioaji 一直出現錯誤 問題是出在哪呢? 謝謝
ERROR: Could not find a version that satisfies the requirement shioaji
ERROR: No matching distribution found for shioaji
按照前面的討論串,應該是python安裝成32bit,要安裝64bit python。另外,如果使用windows,那python要安裝3.8以下,不然會有DLL的問題,我是安裝WIN7 (64bit) 安裝python 3.7.8 (64bit)可以正常安裝執行
大家好我也是剛接觸shioaji的新手,覺得python使用起來確實方便許多非常感謝大大們的開發!另外想請問各位大大目前是不是暫時還沒有提供盤後零股下單的api功能呢? 還是說api.Order IntradayOdd或有甚麼function可以辦到嗎?
如果我沒弄錯,odd應該就是盤後零股,這是保留舊有的設定,去年年底才多加了intraday odd