zipline icon indicating copy to clipboard operation
zipline copied to clipboard

AssertionError when loading csv data

Open cemal95 opened this issue 4 years ago • 5 comments

Schermafbeelding 2020-05-06 om 20 54 31 Dear Zipline Maintainers,

Before I tell you about my issue, let me describe my environment:

Environment

  • Operating System: Mac Catalina
  • Python Version: python for my venv is 3.5.6
  • Python Bitness: 64 bits
  • How did you install Zipline: conda
  • Python packages: - see my previous issue

Description of Issue

I want on ingest personal data, on the screenshot you see that it does work for several stocks but then I get this AssertionError regarding the data. What does it mean, how can I fix this?

What steps have you taken to resolve this already?

It works, but then I have to keep deleting the csv file. But I dont want to do that/

Sincerely, Cem.

cemal95 avatar May 06 '20 18:05 cemal95

It is probably because of the trading calendar. According to the calendar you specified in "extension.py" it is expected that 7606 non-holiday days are existed, but there are 8949 rows (days) in your data source file.

kazemimehdi avatar May 08 '20 18:05 kazemimehdi

Thats the thing, when i compare the indicies of my stocks and compare them with the NYSE trading days, almost all match up.

cemal95 avatar May 09 '20 22:05 cemal95

@cemal95 It looks like the start date for all the built-in trading calendars is '1990-01-01', so the zipline ingestion is complaining that your csv has data prior to that date (including e.g. 1984-09-07). Can you remove those rows from your csv file?

richafrank avatar Jul 22 '20 00:07 richafrank

@richafrank I think I could, however, I have more than 12.000 securities. Wouldnt be more feasible if I change the setting in Zipline to 1984-01-01?

cemal95 avatar Jul 22 '20 11:07 cemal95

Good question. That might take some workarounds. @llllllllll What do you think about the csv bundle ingest clipping the data at the calendar bounds (with a warning)?

richafrank avatar Jul 22 '20 14:07 richafrank