Building a Basic Cross-Sectional Momentum Strategy – Python Tutorial

In this tutorial we utilize the free Alpha Vantage API to pull price data and build a basic momentum strategy that is rebalanced weekly. This approach can be adapted for any feature you’d like to explore. Let me know what you’d like to see in the next video!

4 thoughts on “Building a Basic Cross-Sectional Momentum Strategy – Python Tutorial

  1. Hi Colton, how are you? nice video!
    Just two things:
    1 – when calculating the weekly return you are doing look ahead bias because in the first line you already have a return and in my opinion need to be at the opposite way.
    2 – for returns you can use the pandas function pct_change().

    tks!

    Like

    1. Hey Felipe, glad you enjoyed it! The reason I do it this way without pct_change() is because want to align the coming week’s return with the signal which makes it easy to work with (think of the return as a label). The return wouldn’t be realized until the following week but there isn’t look ahead bias. Does that make sense?

      Like

      1. Yeap! you are right. One thing you can do is some dual momentum approach. using the sectors etfs as your macro momentum and operate inside their members using the relative momentum.

        Cheers!

        Liked by 1 person

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s