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

Time slicing directly from db #455

Closed
markm00001 opened this issue Nov 26, 2017 · 7 comments
Closed

Time slicing directly from db #455

markm00001 opened this issue Nov 26, 2017 · 7 comments

Comments

@markm00001
Copy link

markm00001 commented Nov 26, 2017

Hi- Is there a way to query selected times from the tick store or version store across multiple symbols? Obvious usecase is to store all ticks and then simply call midday, or EOD from the db. I am sure this is a core functionality somewhere but I couldn't find any documentation on it. Thanks

@markm00001 markm00001 reopened this Nov 26, 2017
@markm00001 markm00001 changed the title Error on installation Time slicing directly from db Nov 26, 2017
@bmoscon
Copy link
Collaborator

bmoscon commented Nov 26, 2017

tickstore takes a list of symbols as an argument. Version Store does not support this. there is already a ticket for that - #413

@markm00001
Copy link
Author

markm00001 commented Nov 26, 2017

Thanks Bryant. I saw that ticker and by 'symbols' I took it to mean querying from tickstore is currently able to slice by columns (settles, open, whatever). I am actually wondering if it is possible to query data at different frequencies (so sliced by rows) e.g. taking a library which contains data by the second and only getting back EOD (or a certain time) from it rather than doing this natively in np or pd? If this is nooby question, apologies I have been toying with Arctic for about half a day but maybe I need to spend more time on it. Thanks again!

@bmoscon
Copy link
Collaborator

bmoscon commented Nov 27, 2017

yes. These are the params you care about for tickstore:

def read(self, symbol, date_range=None, columns=None

symbol here is an arctic symbol, which is just a key/name you give to a dataframe. (It can also be a list of symbols). Its the name you use when you write the data to arctic. date_range is how you indicate which dates (i.e. rows) you specifically want, and columns allows you to read back specific columns

@markm00001
Copy link
Author

OK I think I get it. So if the dataframe in the database had 10000 days of minute data and but I wanted to return daily data, based on the daily value at midday, then the date_range could be an index array of daily timestamps with each timestamp set to midday? Clearly this would save loading up a large dataframe and then resampling. Or have I misunderstood? Thanks

@bmoscon
Copy link
Collaborator

bmoscon commented Nov 27, 2017

you dont give it an array of dates, you use the arctic DateRange object and you set upper and lower bounds (they can be open ended).

@markm00001
Copy link
Author

Thanks Bryant.

If enter this object: DateRange('20160101', '20116231'), I get back every minute in the year 2016. If I wanted to get only the values at midday on each day in 2016 (i.e excluding all other minutes), where would I enter the midday parameter? Perhaps there is a worked example somewhere you can point me to? Thanks

@bmoscon
Copy link
Collaborator

bmoscon commented Nov 27, 2017

i dont think there is a way to do that unless you store the data in a symbol that only has mid day data. Could be wrong; maybe @jamesblackburn has a better idea

@bmoscon bmoscon closed this as completed Nov 17, 2018
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

2 participants