Problem Running Zipline on Research Platform

I was attempting to port a minute mode algo from the IDE to zipline on the Research Platform. I encountered this 'IncompatibleHistoryFrequency' error. I made this small notebook in an attempt to isolate the error. Any ideas what might be wrong? I'm concerned that minute mode might not be working properly in zipline on the research platform.

5
Notebook previews are currently unavailable.
9 responses

This issue has already been discussed in another forum post. The conclusion appeared to be that zipline should function correctly in minute mode on the research platform. Any thoughts?

P.S. I could not seem to get a link to the other forum posting to work in my original posting when sharing my notebook.

Hey Rob,

The frequency incompatibility in Zipline is very similar to what you experience in the IDE If you ask for minute history you should also be backtesting in minute mode, however you can ask for daily history in both minute and daily mode.

James

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.

@James
Thanks for the response. That is exactly what I thought was happening.

I suppose that my precise question is how do I run the research environment zipline backtester in minute mode? I was hoping that by posting that notebook that someone might be able to tell me what I'm missing.

Since I couldn't find a solution to that issue myself, I have been pursuing another route. I have been patching together my own development environment using Ipython notebooks for proofing my algo concepts. I don't need fundamental data for now and I'm using a limited selection of ETFs at this time. So, I've downloaded the minute data from IB. Then I wrote some code to massage the database to look similar to the Quantopian data format and timeframes. I've ported the algo that I am working with over and created a rudimentary simulated backtesting framework. I believe that I'm almost at a point where I can resume algo development. The advantages of this solution are that I can do proof of concept with minute mode data and utilize a debugger. My thought was that I could then adapt any prospective algo to the rigorous Quantopian IDE after rudimentary proof of concept to verify that it really works.

I'll bet that you are going to tell me that there is something really obvious that I'm missing which would allow me to run zipline in the research environment in minute mode. Can you point me in the right direction?

So yeah if I understand your question correctly, you are missing one line that will allow you to run a Zipline backtest in Quantopian Research. It is data_frequency="minute" and in context...

my_algo = TradingAlgorithm(
initialize=initialize,
handle_data=handle_data,
data_frequency="minute"
)


That will have your algo run in minute mode similar to in the IDE. Zipline is the backtesting engine that the Quantopian IDE runs on so there is a lot of similarities between code you write in Zipline in Research and what you can write in the IDE. In the IDE we take care of a lot of the lower level stuff e.g. add_history, importing modules, etc. so you can focus on writing your algo.

J

@James
Thanks. That is what I needed.

Awesome! Sometimes threads like yours can get buried in the current forum system, if that happens again shoot me a message. If you post during the weekday it is very very likely you'll get a reply from someone at Quantopian.

Happy coding!

In research, is there a way to test the algorithm with minutely frequency using daily data like you can in the IDE?
For example, if I wanted to use the current day's high price do I need to calculate the max of the minutely prices since open or can I just check the daily high price at that given minute?

Hey Robby,

Can you explain your question a little more? I'm confused, perhaps you just mistyped, but you when you run a backtest in the IDE in minute mode, it uses minutely data. Did you perhaps mean to ask about getting daily history() while in minute mode?

Yes, using daily history in minute mode. Can you replicate that sort of functionality when backtesting minutely algorithms in the Research Environment or do you need to "manually" determine the day's high/low another way?