Back

Any Guide On How To Take an Algo From Backtesting to Paper Trading?

Hi there,

So I've got a few algo's that I have been working with and they are backtesting great.

I want to take these algo's and start moving forward in time and paper trade them.

One thing that comes to mind, my resolution is daily. How do I check and see what my holdings are the next day to determine how my algo should react?

Do I run the algo once a day, or do I just leave it on forever?

Any guidance would be appreciated. Maybe I missed a good guide in the documentation somewhere?
Update Backtest








Hey Jack,

1. Create a project on QC web site.
2. Copy your main algorithm code into main.cs
3. Copy any additional code into files of the same name.
4. Change all the namespaces to QuantConnect.
5. Compile the code and correct any errors and warnings.
6. Run a back test. I recommend a short one, say a week or two at most.
7. Click Deploy and follow the instructions for logging into your account at whatever brokerage you are using. One of the brokerages is paper trade. I have an IB paper trade account so I use that.
8. Let it run. Things get better as your indicators warm up, so it is better not to start fresh every day unless you have some specific reason. Also, once the algorithm is running, QC keeps track of your holdings. They show up in the Unrealized portion of the UI.

If your algorithm Fatal Exceptions out on you, and it probably will at some point, you could still have holdings and QC will not know about them the next time it starts. At least that has been my experience. They could have fixed that. With paper trade that is not a problem, but when you go live it can give you margin problems. With the algorithm stopped, you can go into your account at the broker and trade to flat by hand and that will solve the problem. If you log into trading at IB or with TWS while the algorithm is running, IB stops the algorithm. Only one login is allowed at a time. I do not know what Tradier does.

If you need to stop the algorithm, click the Liquidate button, not the Stop button to get rid of anything you have in your portfolio.

Good Luck!

Nick
1

Thanks @Nick! It should be even simpler than that :) Please let me know when you have margin problem via the support@quantconnect.com email address. It would be good to analyse it.

@Jack, Algorithms should work identically in live and backtesting. You shouldn't need any changes to the code. Just click the big yellow buttons "Go Live" or the switch at the top of the screen.

- Your algorithm stays signed in unless there is an issue (e.g. internet collapse). If there's an error we'll email you with the cause / stack trace.

- You should warm up your indicators using the History function or SetWarmup() which will ensure your algorithm is ready to start trading as soon as its deployed. You can see examples of History here: https://www.quantconnect.com/forum/discussion/813/feature-history-and-warmup#Item_14
1

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 QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect 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. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.


Update Backtest





0

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 QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect 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. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.


Loading...

This discussion is closed