Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

關於Log中憑證錯誤的問題 #1

Open
harryjee1 opened this issue Nov 26, 2022 · 3 comments
Open

關於Log中憑證錯誤的問題 #1

harryjee1 opened this issue Nov 26, 2022 · 3 comments

Comments

@harryjee1
Copy link

在ch7網格機器人執行後log中會出現下列錯誤,請問我可能遺漏了申請哪些?或遺漏了簽署哪些文件?
2022/11/26 20:25:31.875 (PID=5856) ERROR | |--- 驗章失敗, 原因 = ok
2022/11/26 20:25:31.875 (PID=5856) ERROR 內部驗證失敗, 這個憑證鏈捨棄不使用, 無法用來驗憑證鏈

同時程式訊息如下
Response Code: 0 | Event Code: 0 | Info: host '203.66.91.161:80', hostname '203.66.91.161:80' IP 203.66.91.161:80 (host 1 of 1) (host connection attempt 1 of 1) (total connection attempt 1 of 1) | Event: Session up
<SecurityType.Index: 'IND'> fetch done.
<SecurityType.Stock: 'STK'> fetch done.
<SecurityType.Future: 'FUT'> fetch done.
<SecurityType.Option: 'OPT'> fetch done.
Traceback (most recent call last):
File "C:\ProgramData\Anaconda3\lib\site-packages\pandas\core\indexes\base.py", line 3803, in get_loc
return self._engine.get_loc(casted_key)
File "pandas_libs\index.pyx", line 138, in pandas._libs.index.IndexEngine.get_loc
File "pandas_libs\index.pyx", line 165, in pandas._libs.index.IndexEngine.get_loc
File "pandas_libs\hashtable_class_helper.pxi", line 5745, in pandas._libs.hashtable.PyObjectHashTable.get_item
File "pandas_libs\hashtable_class_helper.pxi", line 5753, in pandas._libs.hashtable.PyObjectHashTable.get_item
KeyError: 'code'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "ch7_GridBot.py", line 528, in
GridbotBody()
File "ch7_GridBot.py", line 344, in GridbotBody
bot1.getPositions()
File "ch7_GridBot.py", line 99, in getPositions
quantity=df_positions.loc[df_positions['code'] == self.upperid]['quantity']
File "C:\ProgramData\Anaconda3\lib\site-packages\pandas\core\frame.py", line 3805, in getitem
indexer = self.columns.get_loc(key)
File "C:\ProgramData\Anaconda3\lib\site-packages\pandas\core\indexes\base.py", line 3805, in get_loc
raise KeyError(key) from err
KeyError: 'code'

@WilliamZhuo
Copy link
Owner

WilliamZhuo commented Nov 28, 2022

感覺是憑證的問題,不過能跑到這裡應該是能讀到憑證檔案的,在寫完書之後新增的流程就是以下的api測試
https://www.sinotrade.com.tw/ec/20191125/Docs/Python%20API%E6%B8%AC%E8%A9%A6%E6%B5%81%E7%A8%8B.pdf
如果做完還是無解可以去https://www.facebook.com/groups/2267820226830423/search/?q=api
問問看,這邊有永豐金的人不定期出沒

@harryjee1
Copy link
Author

謝謝您撥空回覆,再請問您安裝的pandas版本是哪一個版本?

@WilliamZhuo
Copy link
Owner

我用pandas.__version__看是 '1.3.2'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants