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

How to add fundamentals data columns? #4

Open
ericng-tx opened this issue Mar 18, 2020 · 3 comments
Open

How to add fundamentals data columns? #4

ericng-tx opened this issue Mar 18, 2020 · 3 comments
Labels
question Further information is requested

Comments

@ericng-tx
Copy link

Other than ohlcv columns ('open', 'high', 'low', 'close', 'volume') and adjustments columns ('ex-dividend', 'split_ratio'), how do we add fundamentals data columns? Thanks a lot

@Heerozh
Copy link
Owner

Heerozh commented Mar 18, 2020

ohlcv and adjustments just tell the engine what the name of price columns are, you can have extra columns in your data source (such as csv files) as you want.

OHLCV.close is sugar way represents spectre.factors.ColumnDataFactor (inputs = ['close']),
so you can use this method to read any columns:
spectre.factors.ColumnDataFactor (inputs=['col_name'])

Good question btw, I will add to the document.

@Heerozh Heerozh added the question Further information is requested label Mar 18, 2020
@rajach
Copy link

rajach commented Apr 10, 2020

Can the ColumnDataFactor also be used for adding something like sector code (that is specific to a symbol) after the data have been loaded?

@Heerozh
Copy link
Owner

Heerozh commented Apr 10, 2020

Can the ColumnDataFactor also be used for adding something like sector code (that is specific to a symbol) after the data have been loaded?

Static data needs to be included in your DataLoader in order to maximize performance.
But there is a low-performance but convenient method for your needs:
spectre.factors.AssetClassifierDataFactor({'AAPL': 1, ...}, default=-1)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants