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

--If I backtest on daily data and then launch the algorithm into paper trading, will it execute on daily data? Or will it use minute data?

--Once the paper trading is launched and running, I see that the code cannot be edited. Yet, I can still modify the original algorithm and continue to backtest it (a green "Currently live trading" indicator is displayed). What if I want to modify the paper trading algorithm? If I click the "Stop Algorithm" button, I get:

This algorithm will be permanently shut down.

No new orders will be placed. Your positions will not be liquidated.
To resume trading, you will have to deploy a new version of this
algorithm.

I'd like to be able to edit the code that was running under paper trading, and then re-launch it. Is this possible?

--What are the differences between the data available to the algorithm for backtesting and the data for paper trading? Are missing data filled as Fawce describes in https://www.quantopian.com/posts/thinly-traded-stocks-why-no-gaps?

--Is the 15 minute delay in the data exact? If I compare the datetime stamps of the trade data to the wall clock time, will it be 15 minutes plus-and-minus N milliseconds?

--Will the same data used for paper trading be used for live trading with Interactive Brokers (with the 15 minute delay removed)? Will there be any filling/aggregation/filtering/screening/checks by Quantopian prior to making the data available to the algorithm?

Grant

7 responses

Hi Grant,

Great questions, below are the answers. Keep them coming!

thanks,
fawce

-- all live trading, paper or real money, is minutely. As a best practice, you should only deploy to live trading from a minutely backtest.

-- The code in Live trading is copied from the backtest you used to launch the algo into live trading. It is immutable. Editing the algo in the IDE will not affect any code in prior backtests or in previously launched live trading deployments. We don't yet support modify/redeploy for an algo in live trading, you have to stop and relaunch.

-- The only difference in the data is that live trading is coming from the exchanges to our environment, and the historical backtest data has been cleaned. There will be minor differences in prices and volumes if you compare the two. Behavior for the data management of empty bars and everything else should be the same.

-- It is not exact. We use the exchange time stamps to build the bars, and there is delivery latency on the data to us, and then time to construct the bar.

-- It is the identical data, the only difference is the time delay. The behavior of the bars for illiquid stocks and other wrinkles should be identical in backtesting, paper trading, and real trading.

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.

Thanks Fawce,

I'll need to rejigger and re-test some algorithms for minutely data..no problem.

You might consider adding a note/warning regarding the minutely data stream for paper/live trading (or just not allow daily backtests to launch). I may be an exception, but I'd assumed that since the paper trading launch was tied to the backtest run on daily data, the paper trading would run on daily data.

One comment on the paper trading is that there is no accounting for commissions. The money just evaporates; it'd be nice to track it. Something similar could be said for slippage (although I suppose by looking at open orders and fills, one could sort it out).

Grant

Also, given that any algorithm for paper/live trading will need to be written for minutely data, you might just save yourselves some user support headaches and turn off the ability to backtest on daily data. This would force everyone to write code and test at the minutely level. At one point, Jean had mentioned that the paradigm is for users to be able to transition smoothly from backtesting to paper/live trading, so allowing backtesting at the daily level but not supporting it in paper/live trading may be problematic for you down the road. --Grant

We've been thinking quite a bit about the daily/minutely problem as we're rolling out live trading.

We will shortly make it so that live trading follows a good minute backtest. I'm not quite ready to get rid of daily mode - it has too many other benefits - but I agree that there is too much room for confusion with the current configuration.

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.

Hello Dan,

If I understand you correctly, the user would only be offered the option to live trade after a minute backtest; the button would not be present after a daily backtest. This would at least preclude someone from making the same mistake that I did.

Grant

That's the plan, Grant. Though technically the button will be there, grayed out, with hovertext about how to make it an active button.

Hi Dan & Fawce,

Why did you decide not to support daily bars and trading under live trading? I would think that especially for beginners, this would be an attractive mode of trading. Do you anticipate a lot of users wanting to make multiple trades per day? I thought that it is really hard to keep expenses in check as an individual trader when there are frequent transactions?

On a related note, it appears that under live trading, the algorithm stops when the market closes. Why? It might be nice to run the algorithm after hours and prepare orders so that they could be checked prior to filling at market open (or later in the day, if scheduled). If something goes haywire, then presumably one could manually block/cancel the orders before they get submitted to the broker. Generally, I don't see any provision for a "human in the loop" in the Quantopian/IB scheme...kinda scary.

Grant