Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Comparing 1m and 1d price data

Hi everyone,

Please excuse me for my ignorance as I am new to quantopian and coding in python in general.

So as far as I know Quantopian offers only 1m and 1d price data, right?

What would be the best way to compare the data against each other for trend biases e.g. looking at the trend bias of the daily and minutely 200 SMA in one query?

Also, is there any way to aggregate the minutely price data to hourly?

Thanks in advance,

R

1 response

Welcome to Quantopian! As far as I'm concerned 'ignorance' just means opportunity to learn. You are correct in your statement that Quantopian offers minute and daily level OHLCV data. When backtesting on Quantopian you have to specify the resolution of data you want to test with, currently the two options are minute and daily. What this means is that if you want to say use the history() function for the last x minutes of data you also need to be backtesting in minute mode, but if you want to get the last x days of data while backtesting in minute mode you can do that too. The basic rule is you can't call history for a higher resolution than the one you are backtesting in. Moving on, the best way to compare two time series of different resolutions would be to use two separate history() calls, one for each resolution of data. From there you can compare the data in anyway you like.

For your second question, what do you mean by aggregate? The Pandas data manipulation library has quiet a few functions for performing operations/grouping on windowed data and will almost definitely help.

Hopefully that begun to answer some of your questions.

Disclaimer

The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by Quantopian. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. No information contained herein should be regarded as a suggestion to engage in or refrain from any investment-related course of action as none of Quantopian nor any of its affiliates is undertaking to provide investment advice, act as an adviser to any plan or entity subject to the Employee Retirement Income Security Act of 1974, as amended, individual retirement account or individual retirement annuity, or give advice in a fiduciary capacity with respect to the materials presented herein. If you are an individual retirement or other investor, contact your financial advisor or other fiduciary unrelated to Quantopian about whether any given investment idea, strategy, product or service described herein may be appropriate for your circumstances. All investments involve risk, including loss of principal. Quantopian makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances.