Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Some questions about Quantopian

Hi everyone,

I recently joined Quantopian and as I directly said to John Fawcett via email I have to congratulate for the great job done. As I said to John it's a pity that the european market is not supported up to now, but I'll patiently wait for it :-).
Now, since I've started to "play" with Quantopian and with the zipline library, some questions arose and, as suggested by John, I repost them here in order to make the answers available for all.

  • Does the backtesting work on intraday data or does it rely only on end-of-day data? the zipline library seems to be based on yahoo, which, as far as I know, does not provide intraday data.
  • Can Quantopian take into account commission costs? If so, can you point me out some references explaining how this can be achieved?
  • Does Quantpian provide a price graph (eg with japanese candlesticks) showing the exact entry and exit points of the backtested algorithm? This could be really useful, in order to have a broader view of how the algortithm behaves and, in case, to correct it using other indicators.

Thanks in advance for all the answers!

9 responses

@Gad82,

Thanks for reposting! The backtester is designed to be agnostic to the duration of the data bars - they are modeled as events so that you can imagine feeding tick data, minute, or daily bars to your simulation. In the Quantopian environment, we provide minute bars and daily bars.

We allow you to model commissions as well as slippage (aka price impact). We provide basic implementations for each, and in the future we will allow you to override with your own implementations.

We do not yet provide a visual indication of entry and exit, but you can see a proof of concept in Thomas' presentation from #pydata: https://www.quantopian.com/posts/hello-from-pydata -- check out the link to his ipython notebook. +1 for this idea -- anyone else want to second it?

thanks,
fawce

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.

Hi Fawce,

Do you actually have daily bars in the data base? I thought it consisted of minutely data only? If you have daily bars, can the full backtest be run on them?

Cheers,

Grant

@Grant, yes we have both minute and day bars. We will be adding a control to the UI so you can use day bars for the full backtest.

Hello Fawce,

Just curious how orders will work in the case of using daily bars for the full backtest. Dan Dunn filled me in on how things work for minutely data here. For daily bars, if I submit an order on day 1, will it get filled on day 2 (assuming that there is trade data for the SID on day 2)? Or in the case of daily bars, does the order get filled the same day as it is submitted?

In the current implementation of daily bars, and order filled on day 1 will be filled on day 2. The backtester thinks of things in events, and each data frame is an event, whether that event is one day or one minute.

We're talking about making it so that daily backtesting can work on same-day orders, maybe using the closing price, but it's just conceptual chat at this point.

Dan

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.

Hi,

Has this order fill one day delay problem been fixed?

Thanks

It's not really something to be fixed. Rather, it is a built-in form of slippage. You can write your own model. For example, see https://www.quantopian.com/posts/trade-at-the-open-slippage-model.

If I wanna place a same day order using daily data, would it work if I set my slippage model as following?

context.slippage = VolumeShareSlippage(volume_limit=1.00, price_impact=0)

Not sure about that one, but if you use Anony's model posted on the link above, you can pick an execution price closer to the open. Alternatively, just run using minute bars.