Back

New to QuantConnect, some technical questions...

So far, I'm pretty excited about this platform. Keep up the great work. However, I have a number of questions that I haven't seen answered yet in the docs.

1) Is there a way to programmatically initialize my backtest with random stocks?
I'd like to build a portfolio of, say, 50 random stocks, and see if I can write an algorithm to chose intelligently between them. I can always chose the stocks by hand, but testing against random sets seems like a good way to protect against over-fitting.

2) How does the backtester handle Stock splits? Stock delistings? Dividend payments?

2) Can I use multithreading? What kind of CPU resources do the algorithms have? 1 shared core, or more than that?

3) What is the .NET version? Is it Mono, or MS? What OS? There are always differences in implementations and platforms, so I want to make sure I don't use something stupid or unsupported. FWIW, I use Mono on Linux.

4) Is there global exception handling? What happens to unhandled exceptions? I would assume it merely kills that call to OnTradeBar or OnTick, and doesn't bring the algorithm to a crashing halt?

5) How do I cancel a backtest? Ok, this is a simple one, but I didn't see an easy way to do that.

7) Is there a way to cancel orders?

Thanks for any answers you can provide.
Update Backtest








Welcome to QuantConnect @Jonathan, good to have you here.

1 - Currently no, other than making a list of all the symbols we have available and then picking from that list randomly? Thankfully QuantQuote makes this available online. It doesn't show the start-end dates however. We're negotiating with a few fundamental providers now to get stock-screen functionality.

2 - Splits and dividends are backward adjusted into the stock price. A good example if it works properly is tomorrow AAPL should show $94 and go backwards to in time $0. It will never appear as the magic "$700" number. I'm discussion changing this with the data provider because it has its limitations.

3 - Multi-threading - Feel free to use multi-threading. The .NET tasks are beautiful! Our underlying machines are fairly powerful c3.xlarge's, and at the moment they are single threaded. The new build of the backend (ETA 7-10 days) is using 3-4 threads. The algorithm ram usage is capped at 1GB at the moment.

4 - Mono Linux Ubuntu :) Mono version 2.10 I believe, .NET 4.5 coverage to 95% of functions. Everything which is in the "System.dll" is included (LINQ, IO).

5 - There is a "try-catch" around the algorithm execution, so if it fails horrible we can catch it. You can test this with "x = y / 0" and generating a divide by 0 error. I do recommend try-catches around your code though. With runtime errors there isn't much we can do - it halts algorithm and pushes errors back to IDE.

6 - If you hover on a result tab once its shown there's a small trash icon, there you can hide it. We're pushing a major backend update soon and it will include finer grain server controls.

7 - Yes you can cancel and update orders, the underlying source is available on github in the "Transaction" class. Market orders are sent and filled immediately by the order model, but you can override default behaviors to do whatever you want. The order models also define how limit orders are processed etc. The unprocessed limit orders sit in a queue, and if you remove them from there it will "cancel them". This may change as the live system is slightly different. Order() returns an ID which you can use to reference the order.
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.


Thanks for an awesome platform! Are there any updates on #1 above regarding dynamic symbol list generation? I'd like to programmatically backtest with variably changing symbols over iterations, from a large pool that itself changes over time (due to the nature of the market). It seems algorithmically inefficient and fragile to statically add 500 equities during initialize and then filter in OnData, which is the only way I can figure out how to do at this time. Please advise... or sample code appreciated. Cheers and thanks again.
0

No progress to date sorry @Marc; we're finishing live trading and then will do optimization and screening. That forum post above was before we had open sourced - the open source movement put us about 3 months behind schedule :) If you're interested you could help us build the screening at https://lean.quantconnect.com
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.


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