Giter Site home page Giter Site logo

Comments (9)

SouthernYoda avatar SouthernYoda commented on August 18, 2024 8

The way I solved it is by manually inserting the country_code into the created sqlite database.

Steps to solve the issue

  1. Make sure you still run the !zipline ingest command to import the latest data into your project folder
  2. Open the "assets07.sqlite" file in the directory path using an sqlite client
    .\data\.zipline\data\quandl\<timestamp>
    side note: I used https://sqlitebrowser.org/ as a GUI sqlite client it was really easy to use
  3. In the table 'exchanges'there will be the column named 'country_code' with a Null value, change it to 'US' (See screenshot below)
  4. I don't know if this affected anything but I reloaded zipline with the command %reload_ext zipline before rerunning the trading script

image

Hope this helps, if I missed a step let me know I'm going off of memory!

from machine-learning-for-trading.

jpark0315 avatar jpark0315 commented on August 18, 2024

quantopian/zipline#2517

solution above

from machine-learning-for-trading.

SouthernYoda avatar SouthernYoda commented on August 18, 2024

Can you explain how you managed to solve the issue?

I am encountering the same error in the Chapter 4 notebook "04_single_factor_zipline"

from machine-learning-for-trading.

antkealy avatar antkealy commented on August 18, 2024

I'd also appreciate some help on this issue. I didn't have any issue running the zipline code in chapter 2 but have encountered the below in Chapter 4 notebook "04_single_factor_zipline":

"ValueError: Failed to find any assets with country_code 'US' that traded between 2016-01-13 00:00:00+00:00 and 2016-01-21 00:00:00+00:00.
This probably means that your asset db is old or that it has incorrect country/exchange metadata."

from machine-learning-for-trading.

antkealy avatar antkealy commented on August 18, 2024

Thanks SouthernYoda! Really appreciate the detailed response.

from machine-learning-for-trading.

stefan-jansen avatar stefan-jansen commented on August 18, 2024

I've added a warning and link to the Quantopian GitHub issue that discusses this problem in the installation instructions; sorry, should have done so earlier.

from machine-learning-for-trading.

antkealy avatar antkealy commented on August 18, 2024

Thanks Stefan/Southern Yoda. I am trying this again following the above instructions:

  1. %load_ext zipline
  2. !zipline ingest in the the project
  3. amend the country code in exchanges to US once the ingest is complete, save database
  4. %reload_ext zipline (have also tried not re-loading)
  5. run the main trading script

When running the trading script, the kernel seems to stall/stay busy - I don't receive any errors etc. Any ideas what could be causing this?
5) When I try to run the

from machine-learning-for-trading.

SouthernYoda avatar SouthernYoda commented on August 18, 2024

It takes some time to execute depending on your hardware, give it like 30mins to run.

If it's not throwing errors then it's probably doing something so put some print statements in the code to help you understand what's going on.

I just started going through the book just like yourself so I'd need some more details to be able to help

from machine-learning-for-trading.

antkealy avatar antkealy commented on August 18, 2024

Thanks SouthernYoda - I haven't had a zipline one take so long before so assumed first that something was up! Some progress statements are the way forward.

from machine-learning-for-trading.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.