Back

Research - Backpropagating neural network using sklearn

This is a research example of using Neural Network to take technical indicators as input to generate binary buy or sell signals. This can be used as a template for creating your own machine learning notebooks. 

The research environment is brand new & in open beta! Let us know your thoughts!

Update Backtest








Thanks for sharing, this looks like a great start!
One issue this might encounter - time/RAM limitations in backtesting. Typically, NN need a fair amount of data to discover all these unobvious relationships, and there is a 10 minute limit on any function call.

0

That's a good point! 

Eventually, we will connect QC/research and QC/backtesting together. At that time, you can save your research results on QC/research and import the results to QC/backtesting directly.

0

Unfortunately, for some reason I am unable to view the cloned notebook: i just get a page that says "Building research environment" (so far it has been well over an hour). Is this to be expected the first time?
0

Karen Chaltikian it normally takes 3sec. We've had reports of some people with firewalls unable to access it. We're trying to debug it now but if you can send us as much information as possible to support@quantconnect.com it would really help! 

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.


Karen Chaltikian
Tony Chang 
Are you both using Windows XP?

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.


Any chances of getting a C# version of this?

 

3

andrestone - Yes! Thankfully Jupyter supports Python, .NET and R. It should be easy to add some more kernals.

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.


Is there a documentation on how to use futures in Research environment? For example, replacing addEquity('SPY') with addFuture('ES') breaks the qb.History function call, and futuresSetFilter function is not found inside any of the imported libraries

0

The Research environment does not support Futures yet.
We will be working on it ASAP.

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.


No problem, thanks for letting us know. Looking forward to this!

0

Just one little gripe.  The timeout on the connection to research environment feels a little short. I often end up having to reload the page and re-run the whole notebook in order to continue working. Can it be increased to something like 15 minutes (right now it feels less than 5)?

0

Karen Chaltikian we increased the timeout period to 15 minutes.

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.


Awesome, thanks very much, Gustavo

0

andrestone 

We do have discussion about a similar C# algorithm here:

https://www.quantconnect.com/forum/discussion/560/machine-learning-for-equity-price-trend-prediction

This uses the Accord framework for SVM rather then sklearn for NN. It would be great for someone to try to adapt this to use a Neural Network.

0

@Xiang Li, Thanks for sharing this good work of research in Python environment. I will look into it in detail. As a Quantopian migrant, it takes some time for me to get familiar with QC's languages. I will catch up soon. Thanks :) 

0

It would be very useful to support libraries in Reseach so that we can share code across different NBs.

0

@Xiang Li: I do have a logic question regarding your excellent post:

As I understand it you feed the NN with same data (technical indictors) you got from your algo.All technical indicators, at least regarding a certain stock/index/etc., are derived from a certain set of timeseries data like stock price (start, end, closing) and volume. 

Wouldn't it be much more interesting (and rewarding) to feed the NN the raw data plus the manually selected points of entry into a trade for the same day (buy, sell, short sell, close position, price, perhaps stop loss) and do this for a certain period of time and then let the NN predict it for the test period.

Perhaps one can feed some more external raw information into the NN that may affect the stock price like other stock market indices, macro indicators and so?

0

Absolutely Andreas - the point of sharing the notebook was to demonstate what was possible =)

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