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:

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.

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.