Back to Community
Baby steps - A novice quant’s adventure begins.

Hi all, I am completely new to algo investing, and since I know that there are probably going to be a few other people here that are also new, I’d like to try a little experiment in this community.

What I am planning to do is to document the process here on how I go about learning about algo investing, the steps that I take, my thoughts, the resources that I use and the results. The hope is that other people can look at what I do and compare it to their own strategies, offer advice or try something similar themselves.

Ultimately, I’d like it to be a collaborative effort, aimed at helping very new algo investors like me learn the ropes and I am hoping that any public successes or (eek!) failures that I have will at least be interesting!

Firstly, a little about me and my current experience / skills(?) with investing, programming and algos:

  • Programming - I don’t have any programming skills as such. I have built websites using HTML and CSS, so I understand the principles and concepts of structured languages but have never used C, Python or anything like that.
  • Investing - I am very much a traditional investor. When I pick stocks I tend to do it based on a company’s financial performance (EBITDA), likely future performance, P/E, social responsibility and the like.
  • Signals - I don’t really know anything about the more subtle signals that algos use to track stocks; things like moving averages, bollinger bands, split investing, PEG are all alien to me.
  • Analysis / logical thinking - I am pretty good at analysis, math and logical thinking. I am (almost) never happier than when messing around in spreadsheets and exposing the interesting things that numbers do to each other!

I will also share what my aims are from investing, since they will guide my strategy and your aims could be different:

  • Previously, I have tended to prefer longer term, buy and hold strategies rather than buying and selling all the time (that will change though!).
  • I like algo trading because I don’t have time to track the stock market every day, so having an algo that can do that for me and make emotion-free decisions is extremely helpful.
  • I like to diversify risk vs. reward, so I will probably have an investing strategy of thirds - One third lower risk / Blue Chip buy and hold / rebalance, one third medium risk buy and sell over the medium term to make capital gains, one third high risk where I use signals to buy and sell stock relatively quickly.
  • Financially, I am expecting to start live-trading around $20,000 over the next month and am looking for decent returns over a two to three year period.
  • I’m an ethical investor, so that does play a part in the stocks that I choose.

In the next post, I will share what I think I need to do to get up to speed on Quantopian and into live trading.

14 responses

With all of the above in mind, I believe that learning algo investing will take six main steps.

  1. Programming - Learn Python so that I have an understanding of how algos function and perform and specifically how Python is used on Quantopian. This means getting a good grounding in the language and also studying some of the more subtle ways that it is implemented.
  2. Learn the various different signals that algos detect and use to make decisions. I will need to get smarter about investing and security signals like MAVs etc.
  3. Start to build algos and test, refining them until I find something I am happy with. Using a combination of programming, signals, analysis and math to create reasonable algorithms that outperform the market.
  4. Deploy algos into a paper trading environment. Test algos for a period of time before committing with real money.
  5. Live trade. Put the money out there and hope for the best!
  6. Refine, tweak, iterate and learn. Track performance, make algo changes and so on.

Step 1 - Learn Python

Having looked around, the place that most people recommend for learning programming is Code Academy - It’s free and has a good reputation. I’ve started going through the Python course here: http://www.codecademy.com/en/tracks/python

So far, it’s been very interesting; Python is a nice, logical language with easy to understand concepts and seems to be very well supported, I’ll let you know how things go!

The other thing that I did that’s important to me is to research and create a list of socially responsible and ethical businesses in the US. I will use the stocks and securities on this list in my algos, and you are very welcome to do the same; more here: https://www.quantopian.com/posts/resource-for-quantopians-a-list-of-businesses-that-have-good-corporate-social-responsibility-and-ethical-standing-ready-to-be-dropped-into-your-algorithms

That’s it for now, any experience you have learning Python, tips, techniques and tricks are gratefully received!

One thing that may help you learn python is to contribute to a project. This is a great way to go about learning a new language for a lot of reasons. For starters, it allows you to see how the language is being used by other people so that you may learn from their code. Also, if you submit a fix, you will most likely have someone look over your code and potentially give you advice or reccomendations. Finally, at the end of the day, you will have contributed something back to the project, as opposed to building a lot of toy applications.

If you are looking for projects, you could take a look at https://github.com/quantopian/zipline, the backtester that Quantopian uses. This might be particularly helpful because the things in zipline will be directly related to writing algorithms for trading.

For something a little easier, take a look at the issues list of pygments. A lot of these are simple fixes that you can do in an afternoon.

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.

http://www.kevinsheppard.com/images/0/09/Python_introduction.pdf

Hi Paul. I just stumbled on this PDF and am enjoying it. I think it makes a good introduction and reference for people like us, interested in Quantopian and Zipline. It has a good overview and info on some of the most important modules all in one place.

Best regards

Hello Paul,

You might have a look at:

https://www.quantopian.com/posts/working-with-history-dataframes

There is also:

Python for Data Analysis: Data Wrangling with Pandas, NumPy, and IPython
by Wes McKinney
Link: http://amzn.com/1449319793

Grant

Paul,

I've just started learning python and found the course on Coursera called "Programming For Everybody (Python)" really helpful. You should definitely check it out.

Best,
Phil

Thanks for pointing me at the new python references folks, they are proving extremely helpful!

Incidentally, I found a very good book on stock analysis - It has a decent chapter on using fundamentals / financials to make stock decisions and another section on technical analysis as used in algos. It's targeted at a beginner in investing, but takes you from knowing very little to having a reasonable understanding of the stockmarket, businesses and key buying and selling strategies. It's called 'Understanding Stocks' by Michael Sincere. He's got another book called 'All About Market Indicators' which I am getting next.

Well, I've been studying Python for around five or six days now, and it's been an interesting experience. Here are my thoughts, for those of you that don't have much experience yourselves of Python:

  • It is extremely logical and shares lots of principles with other languages (If/Else, For loops, Booleans, assigning names, passing parameters etc.)
  • There are some concepts that I do find tricky - The main issues for me were around using .properties to set properties and query names / parameters; I found it very hard to get my head around that, but I am making progress.
  • I have used numerous tutorials and books to approach the Python language from various different sides to try and train my mind in the right way. Good resources for me were 'Python for Dummies', the Python track on Code Academy, the Python.org online reference and the Learn Python subreddit on Reddit (extremely helpful people there.)
  • I have also found the Quantopian community itself very helpful. Gary Hawkins had some really useful advice and I am learning a lot from dissecting and understanding algos that others have written
  • The Quantopian API Reference and FAQ has been incredibly helpful. Once I had a rudimentary understanding of Python, I was able to go through it and begin to understand how it all fits together. One of the big stumbling blocks for me was in not understanding that the data function in (context, data) was predefined and available anywhere. Once I understood that, much more made sense!

My plans now are to continue dissecting existing algos and then writing some 'pseudocode' to outline some of my own algos to test. I will then (attempt) to convert them into 'real' Python and wrangling them until they run! I will let you know how things go...

Thanks for listening!

Bump.

Paul, how's your progress been? It's been a couple of months since your last post.

db

I am in the same boat from a programming standpoint (learning python from scratch being new to OOP) and some of the best learning tools I have found are the challenge sites like codewars.com, codingbat.com/python and checkio.com.

Hi Paul,

The fund PRBLX is all about ethical and socially responsible businesses and it has done well. It could be a good starting point for your list.

Paul, try looking at the members for KLD (ishares msci USA ESG) etf.

Hi all,

There's also an ongoing tutorial series (https://www.quantopian.com/posts/quantopian-webinar-lesson-1-the-basics-of-the-ide) that's focused on getting users who are familiar with Python ramped up with Quantopian. It's more useful for users with Python experience, but anyone else will benefit as well. We'll be covering core Quantopian concepts like the stock universe, ordering execution times, fetcher, and slippage using real trading algorithms that users have previously shared with the community.

Seong

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.