Back to Community
New Tutorial Available on Quantopian - Algorithmic Trading by Sentdex

We love the tutorial series that Harrison wrote, so his tutorials are now available on the updated Quantopian Tutorials page. His tutorial, called Algorithmic Trading, can be found here. A copy of the notebook for parts 4-8 is attached to this post.

Who is Harrison?
Harrison Kinsley is creator of and Recently, he updated his Python for Finance tutorial to include updated lessons on Quantopian.

Python for Finance
The Python for Finance series starts off with an introduction to using Python, Pandas, and Matplotlib to get, visualize, and manipulate stock data from public sources.

The series then moves to Quantopian where Harrison walks through building, researching, and analyzing trading strategies using several tools in the Quantopian API: Pipeline, Alphalens, Pyfolio, Optimize, Research, and the IDE. Specifically, the tutorial focuses on building up to a strategy that combines fundamental factors with a factor built on the Sentdex news sentiment dataset.

Algorithmic Trading on Quantopian
The videos for the Quantopian section of the tutorial can now be found here on Quantopian. A copy of the notebook for parts 4-8 is attached to this post.

The written version can be found on

Introduction to Python, Pandas, and Matplotlib
The first part of the series that introduces Python, Pandas, and Matplotlib can also be found on

Full credit goes to Harrison for making this tutorial and for sharing it with the Quantopian community!

Loading notebook preview...
Notebook previews are currently unavailable.

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.

4 responses


I have problem using the followling line in you make_pipeline() function:

    #Factor returns  
    sentiment_factor = sentiment.sentiment_signal.latest  

it give me "'Field' object has no attribute 'latest'" error.

I suppose you need some converting on blaze object?


you notebook comments about stocks in the universe are "not within 2 days of an earnings announcement, are not announced acquisition
# targets, and are in the Q1500US." Are you using other date sets to screen our invalid stocks ?

Hi Steven,

For the "'Field' object has no attribute 'latest'" error, I imagine that may have come up if the code was not run in the correct order. In my notebook, I used the same name to load the interactive version of the dataset (Blaze) as I did the pipeline version of the dataset. Both are called sentiment. Next time, I'll use different names to avoid this problem. Essentially, you'll need to import the pipeline version in order for the latest attribute to work properly. This should do it:

from import sentiment

sentiment_factor = sentiment.sentiment_signal.latest  

Regarding the universe, it looks like the comment is incorrect. It's just defining the universe to be stocks in the Q1500US that have a non-null sentiment factor. Sorry for the confusion.

Hi Jamie, I'm uncertain as to why I cannot use the interactive version of the dataset (Blaze) in the pipeline itself. I always thought that the interactive version of the dataset is used in the research environment and you are running the pipeline in the research environment so shouldn't you be able to run the pipeline on the blaze version of the dataset and why do we have to switch to the pipeline version of the dataset?