Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Newbie need help.

Is there any algo that we can clone.. that lets you choose say 12 stocks or 20 stocks and package them into an Index or ETF and compete them against the index as a whole.. newbie here.. in pyton and dont hav to implement those simple concept. tnxs

6 responses

All you need to buy 12 or 20 stocks is to use the order function within handle_data().
Is your plan to pick out 12 or 20 pre-selected stocks and buy and hold? If so then your plan goes against the spirit of quantitative backtesting since you would pick only stocks that you know have done well and thus your backtest is not be generalizable to other stocks and past performance of these stocks cannot predict future performance.

If your strategy is more complex, you'd really need to describe to us what you want.

yes its that simple picking out 20 stocks which I deem... highly volitile or make an s&p 100 index see how it perform against s&p 500 or russel 5000 and mayb I can add another variable into the mix like invest in this hours only or specific day or dont invest on friday... something for me to play with and see the graph on how it perform overtime against certain index can do you know how to structure that?

@John, this is certainly do-able, to point you in the right direction:

picking out 20 stocks

You can use fundamentals to choose your stocks based on certain criteria, and here's a template.

add another variable into the mix like invest in this hours only or specific day or dont invest on friday

Use schedule_function to choose when you want to trade (at market open, at market close, what day of the week, etc)

something for me to play with

If you want to simply plug-and-play try out the AlgoBuilder which lets you create your own basket of stocks and choose when to trade

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 @Alisa .. really appreciate it... :)

@Alisa are Forex included here or any plans.. in the future.. to include forex... as a back test for algo day trading?

We have US equities for backtesting, paper trading, and live trading. We're working on adding futures to the platform right now. There aren't current plans to add forex, but we are interested in expanding the tradeable assets for more uncorrelated algorithms in the fund.