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

run_algorithm時出現NotSessionError #12

Closed
Ricky05250525 opened this issue Nov 29, 2023 · 0 comments
Closed

run_algorithm時出現NotSessionError #12

Ricky05250525 opened this issue Nov 29, 2023 · 0 comments
Labels

Comments

@Ricky05250525
Copy link
Collaborator

Ricky05250525 commented Nov 29, 2023

Description of Issue:

run_algorithm時出現NotSessionError: Parameter session_label takes a session label although received input that parsed to '2023-12-27 00:00:00+00:00' which is earlier than the first session of calendar 'XTAI' ('2023-12-21 00:00:00+00:00').

截圖_2023-12-27_上午9 30 06

Solution:

這個錯誤大概是說zipline中的交易日期最晚只到12/21,但使用者卻試圖取得12/27的資料所導致的錯誤。restart jupyter kernel後再重新執行就可以解決,不需要重新ingest。

  • 在import zipline時,程式會自動抓取tej資料庫(交易資料- 交易日期表 TWN/TRADEDAY_TWSE)中的交易日期,抓取的迄日是import時的日期。
  • 抓取後該交易日曆資料會存在jupyter的cache中。
  • restart jupyter kernel,目的是要讓jupyter釋放記憶體,而後再import zipline,程式就會再去重新抓取交易日期。抓取的迄日是restart jupyter kernel時的日期。
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant