Coder Social home page Coder Social logo

alpha-compiler's People

Contributors

carstenf avatar pbharrin avatar peterfabakker avatar rooseveltadvisors avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

alpha-compiler's Issues

No bundle registered with the name 'sep'

Hi, I was following the instructions for installing on window, but after running the script load_quandl_sf1.py I got the error "No bundle registered with the name 'sep' "

Updated with zipline ingest, set my quandl key properly but could not solve it.
Thank you for any help.

require argument country_code

Hey @pbharrin, I did all the necessary modifications, and as I ran load_quandl_sf1.py, I got the error below.


Loading Extensions

Traceback (most recent call last):
File "/Users/zukangy/Desktop/Eonum/alpha-compiler/alphacompiler/data/load_quandl_sf1.py", line 218, in
num_tickers = num_tkrs_in_bundle(BUNDLE_NAME)
File "/Users/zukangy/Desktop/Eonum/alpha-compiler/alphacompiler/data/load_quandl_sf1.py", line 181, in num_tkrs_in_bundle
return len(get_ticker_sid_dict_from_bundle(bundle_name))
File "/Users/zukangy/Desktop/Eonum/alpha-compiler/alphacompiler/util/zipline_data_tools.py", line 95, in get_ticker_sid_dict_from_bundle
all_equities = get_tickers_from_bundle(bundle_name)
File "/Users/zukangy/Desktop/Eonum/alpha-compiler/alphacompiler/util/zipline_data_tools.py", line 69, in get_tickers_from_bundle
lifetimes = bundle_data.asset_finder._compute_asset_lifetimes()
TypeError: _compute_asset_lifetimes() missing 1 required positional argument: 'country_codes'

Process finished with exit code 1

do you have any recommendations or what the country_code should be?

Code?

Hi Peter,

I quite enjoy playing with your site http://alphacompiler.com/. I looked through this repo and I don't see any code that actually compiles "101" style alphas to zipline pipeline factors. I suppose that's intentional ๐Ÿ˜„ . I'd like to include an alpha compiler of this sort in my package alphatools. Would you be willing to open source your code? If not, would you provide some general advice on how you did this? Lexer, parser, etc.

Thanks,
Jonathan

sector_etf_data

Hi @pbharrin . It is a wonderful blog and I enjoyed ingesting the fundamental data into zipline. I was wondering how I can access the file sector_etf_data.csv mentioned in risk_data_prep and also factor_loadings.h5?

SEP loader

I've used the sep script to ingest the sep data set from a dump and it works but with some warnings:

a total of 8639 securities were loaded into this bundle
/Users/phil/miniconda3/envs/p3zip/lib/python3.5/site-packages/zipline/data/us_equity_pricing.py:931: FutureWarning: Conversion of the second argument of issubdtype from `float` to `np.floating` is deprecated. In future, it will be treated as `np.float64 == np.dtype(float).type`.
  if not issubdtype(actual, expected):
[2018-03-27 04:38:36.511868] WARNING: UsEquityPricing: Couldn't compute ratio for dividend {'ex_date': numpy.datetime64('2008-01-02T00:00:00.000000000'), 'amount': nan, 'sid': 220}
[2018-03-27 04:38:36.513775] WARNING: UsEquityPricing: Couldn't compute ratio for dividend {'ex_date': numpy.datetime64('2008-01-02T00:00:00.000000000'), 'amount': 0.1, 'sid': 257}
[2018-03-27 04:38:36.514156] WARNING: UsEquityPricing: Couldn't compute ratio for dividend {'ex_date': numpy.datetime64('2008-01-02T00:00:00.000000000'), 'amount': nan, 'sid': 303}
[2018-03-27 04:38:36.514422] WARNING: UsEquityPricing: Couldn't compute ratio for dividend {'ex_date': numpy.datetime64('2008-01-02T00:00:00.000000000'), 'amount': 0.18, 'sid': 538}
[2018-03-27 04:38:36.514710] WARNING: UsEquityPricing: Couldn't compute ratio for dividend {'ex_date': numpy.datetime64('2008-01-02T00:00:00.000000000'), 'amount': 0.24, 'sid': 579}
...

and then when I try to use it with the simple pipeline engine I get this:

~/miniconda3/envs/p3zip/lib/python3.5/site-packages/zipline/data/us_equity_pricing.py in load_adjustments(self, columns, dates, assets)
   1302             list(columns),
   1303             dates,
-> 1304             assets,
   1305         )
   1306 

~/miniconda3/envs/p3zip/lib/python3.5/site-packages/zipline/data/_adjustments.pyx in zipline.data._adjustments.load_adjustments_from_sqlite()

~/miniconda3/envs/p3zip/lib/python3.5/site-packages/zipline/data/_adjustments.pyx in zipline.data._adjustments.load_adjustments_from_sqlite()

TypeError: a float is required

any ideas?

load_quandl_sf1.py did not work with zipline-reloaded

I managed to ingest, see pull request, but than load_quandl_sf1.py did not work.
Th issue is this:

lifetimes = bundle_data.asset_finder._compute_asset_lifetimes(frozenset([str("US")]))
TypeError: _compute_asset_lifetimes() takes 1 positional argument but 2 were given


(ml4t_p8) carsten@MacBook-Pro-2 ~ % python /Users/carsten/Documents/Python/My_Python_Models/ML-Factor_invest/load_quandl_sf1.py
Loading Extensions

Traceback (most recent call last):
File "/Users/carsten/Documents/Python/My_Python_Models/ML-Factor_invest/load_quandl_sf1.py", line 219, in
num_tickers = num_tkrs_in_bundle(BUNDLE_NAME)
File "/Users/carsten/Documents/Python/My_Python_Models/ML-Factor_invest/load_quandl_sf1.py", line 182, in num_tkrs_in_bundle
return len(get_ticker_sid_dict_from_bundle(bundle_name))
File "/Users/carsten/anaconda3/envs/ml4t_p8/lib/python3.8/site-packages/Alpha_Compiler-0.1-py3.8.egg/alphacompiler/util/zipline_data_tools.py", line 96, in get_ticker_sid_dict_from_bundle
all_equities = get_tickers_from_bundle(bundle_name)
File "/Users/carsten/anaconda3/envs/ml4t_p8/lib/python3.8/site-packages/Alpha_Compiler-0.1-py3.8.egg/alphacompiler/util/zipline_data_tools.py", line 70, in get_tickers_from_bundle
lifetimes = bundle_data.asset_finder._compute_asset_lifetimes(frozenset([str("US")]))
TypeError: _compute_asset_lifetimes() takes 1 positional argument but 2 were given
(ml4t_p8) carsten@MacBook-Pro-2 ~ %

Not an issue. A thank you!

Thanks for sharing this with the world!

I'm working on some algos locally using zipline and had trouble reproducing the sector data that is available on quantopian. I spent a decent amount of trying on my own, somehow came across this and was up and running in an hour.

a couple changes/suggestions (take as you wish!)

doesn't require a local hardcoded path

BASE_PATH = "{}/".format(os.path.dirname(os.path.realpath(__file__)))

doesn't require a separate loading of the data. pipeline will load if needed.

    def __init__(self, *args, **kwargs):
        try:
            self.data = np.load(BASE_PATH + SID_FILE)
        except OSError as e:
            # File not found, let's create and try again
            create_sid_table_from_file()
            self.data = np.load(BASE_PATH + SID_FILE)

What is the DUMP_FILE in load_quandl_sf1.py?

Hey, @pbharrin, I was implementing your way of loading the fundamentals data, and after a series of modifications, as I tried to run load_quandl_sf1.py, it says no file named /Users/xxx/.../SHARADAR_SF1_2daa4baaad2a300c166b5c0f7e546bd1.csv'.

In order to fix it, I manually created the csv file and put it into the right folder, but I got another error message saying that

pandas.errors.EmptyDataError: No columns to parse from file

I am wondering what the dump file is in the load_quandl_sf1.py?

best,

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.