Back to Community
Getting Started?

Hello,
I have been trading for about 7 years. This last year I really started to focus on learning algorithmic trading. I have been working on learning python for 5 months, I spend approximately an hour to two hours on developing my Python skills. I THINK i am pretty solid when it comes to doing the notebooks and research. I feel very comfortable in Jupyter. When I try to write an actual algo, I get lost and don't really know how to start. I have done all the tutorials on Quantopian more then once. Can anyone give input or advice how I can learn the algorithm part more in depth? Thanks for your help and feed back.

3 responses

Already comfortable in notebooks? That's impressive.

I'd go this route ...

Click to clone someone's algorithm.
Click a line number in the margin next to a line with code in it, such as inside before_trading_start().
By the way the 'Build Algorithm' button does an automatic save before running the code.
In this mode it will take a little longer to begin.
When it breaks in, a console window will appear.
You can click the down arrow to step through the code a line at a time for example.
Type (or copy/paste) variables at that prompt to see their contents.

One little refined point to know: If a particular variable contains too much content, it will currently just crash.
For example, the results here in context.out could be large:

def before_trading_start(context, data):  
    context.out = pipeline_output('pipe')  

Since context.out is a pandas dataframe (part of the magic around these parts), you can view just a bit of it with, for instance:

context.out.head() ...or
context.out.head(10)

Next point:
Set the date range to just a few days, then start making some changes and run to see what happens.
Rather than being worried about breaking something, a great part of learning is in observing where boundaries are, so feel free to even make deliberate errors to find out what it will do. If smoke starts coming out of your machine there's an award for that but no one has been able to collect. :)

Naturally this forum is a great resource (and stackoverflow sometimes), it's just a matter of being able to find what you need.
There's a built-in search but the method I use most often is a search like the following. Suppose one wants to read up on the use of fundamentals in pipeline. Notice the use of 'site' here. That way all of the results are on quantopian.com.

https://www.google.com/search?q=pipeline+fundamentals+site:quantopian.com

Would love to know if any particular part of that turns out to be especially useful.

Josh -- maybe if you provide a specific example of what you're trying to accomplish somebody can help you more concretely. But basically the most basic workflow on Quantopian is you have pipeline that runs each day before market opens and you use that to filter and rank stocks, and then you have a scheduled function that calls the order_optimal_portfolio feature that rebalances your portfolio according to those weights/scores and constraints you feed it.

Other than that, Blue's advice to clone existing algorithms is good. That way you can go through and see how they do the algorithm.

Blue SeaHawk,
Thank you so much! I think this is the part that I was forgetting, I am not going to break anything and the way to learn is from trial and error. I think I have been trying to sprint before I crawl. That is perfect and I am going to give that a shot.

MR. Hawk that is the problem is I am not exactly where to start but I think with the advice you two have given me, I just need to get down into it and give it a shot. I am pretty comfortable doing that in Juypter, but not the quantopian algo ide and yall make a great point. Just start doing it and figure out what is going on. The worst is my computer explodes and that has only happen twice. So there isn't any risk to getting down and just doing it.

I really appreciate the feed back guys!