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

"There is no issue with obtaining daily data from Binance, but minute data is not working." #9

Open
mogu2023 opened this issue Aug 22, 2024 · 0 comments

Comments

@mogu2023
Copy link

mogu2023 commented Aug 22, 2024

"The error is as follows:"

BINANCE_SYM_LST=BTCUSDT,ETHUSDT zipline ingest -b binance_min
[2024-08-22T10:42:21+0800-INFO][zipline.data.bundles.core]
Ingesting binance_min
Merging minute equity files: [------------------------------------] 0---] 0% BTCUSDT
Traceback (most recent call last):
File "/Users/mogu/miniconda3/envs/ml4t/lib/python3.10/site-packages/pandas/core/indexes/base.py", line 3802, in get_loc
return self._engine.get_loc(casted_key)
File "pandas/_libs/index.pyx", line 516, in pandas._libs.index.DatetimeEngine.get_loc
File "pandas/_libs/index.pyx", line 540, in pandas._libs.index.DatetimeEngine.get_loc
KeyError: Timestamp('2024-07-02 00:00:00+0000', tz='UTC')

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

Traceback (most recent call last):
File "/Users/mogu/miniconda3/envs/ml4t/lib/python3.10/site-packages/pandas/core/indexes/datetimes.py", line 736, in get_loc
return Index.get_loc(self, key, method, tolerance)
File "/Users/mogu/miniconda3/envs/ml4t/lib/python3.10/site-packages/pandas/core/indexes/base.py", line 3804, in get_loc
raise KeyError(key) from err
KeyError: Timestamp('2024-07-02 00:00:00+0000', tz='UTC')

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

Traceback (most recent call last):
File "/Users/mogu/miniconda3/envs/ml4t/bin/zipline", line 8, in
sys.exit(main())
File "/Users/mogu/miniconda3/envs/ml4t/lib/python3.10/site-packages/click/core.py", line 1157, in call
return self.main(*args, **kwargs)
File "/Users/mogu/miniconda3/envs/ml4t/lib/python3.10/site-packages/click/core.py", line 1078, in main
rv = self.invoke(ctx)
File "/Users/mogu/miniconda3/envs/ml4t/lib/python3.10/site-packages/click/core.py", line 1688, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/Users/mogu/miniconda3/envs/ml4t/lib/python3.10/site-packages/click/core.py", line 1434, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/Users/mogu/miniconda3/envs/ml4t/lib/python3.10/site-packages/click/core.py", line 783, in invoke
return __callback(*args, **kwargs)
File "/Users/mogu/miniconda3/envs/ml4t/lib/python3.10/site-packages/zipline/main.py", line 397, in ingest
bundles_module.ingest(
File "/Users/mogu/miniconda3/envs/ml4t/lib/python3.10/site-packages/zipline/data/bundles/core.py", line 445, in ingest
bundle.ingest(
File "/Users/mogu/miniconda3/envs/ml4t/lib/python3.10/site-packages/zipline/data/bundles/ingester.py", line 431, in call
minute_bar_writer.write(self._read_and_convert(calendar, show_progress), show_progress=show_progress)
File "/Users/mogu/miniconda3/envs/ml4t/lib/python3.10/site-packages/zipline/data/bcolz_minute_bars.py", line 658, in write
write_sid(*e, invalid_data_behavior=invalid_data_behavior)
File "/Users/mogu/miniconda3/envs/ml4t/lib/python3.10/site-packages/zipline/data/bcolz_minute_bars.py", line 690, in write_sid
self._write_cols(sid, dts, cols, invalid_data_behavior)
File "/Users/mogu/miniconda3/envs/ml4t/lib/python3.10/site-packages/zipline/data/bcolz_minute_bars.py", line 780, in _write_cols
latest_min_count = all_minutes.get_loc(last_minute_to_write)
File "/Users/mogu/miniconda3/envs/ml4t/lib/python3.10/site-packages/pandas/core/indexes/datetimes.py", line 738, in get_loc
raise KeyError(orig_key) from err
KeyError: Timestamp('2024-07-02 00:00:00+0000', tz='UTC')

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

1 participant