PyQuant News is on Substack

Looking for the newest weekly Python deep dives for algorithmic trading, market data analysis, and quant finance? Subscribe to the PyQuant Newsletter on Substack for free.

Subscribe for free 👉

Build your own market data analytics app in 5 minutes

April 15, 2023
Facebook logo.
Twitter logo.
LinkedIn logo.
Newsletter issue count indicatorNewsletter total issues indicator
Build your own market data analytics app in 5 minutes

Build your own market data analytics app in 5 minutes

First, I learned how to code to build my own analytics apps.

Second, I traded my first stock.

The first code I wrote was PHP and it was terrible.

The first stock I traded was MSFT and I lost money.

Since then, I've written hundreds of thousands of code lines and traded thousands of stocks.

Most of the code I've written is to do one thing:

Analyze market data.

And most of the time, I do it in a web app (see here and here).

The problem is, it can take days (or years) to get all the parts of the web app right.

Nailing the layout, making it work, and organizing the files just right is pretty time-consuming.

Fortunately, I discovered Streamlit when it launched in 2018 and it's a game-changer.

Now I build analytics web apps in 5 minutes.

And you can too.

Build your own market data analytics app in 5 minutes

Building Streamlit web apps lets you showcase your skills to employers by Building in Public.

Startups, bootstrappers, indie software developers, and of course Python developers Build in Public to showcase their skills, get help, and establish their networks.

You can also quickly build reusable analytics in a web browser. This makes it easy to include analytics in your investment workflow.

Let's dive in.

Imports and set up

Streamlit is a Python library that lets you create web apps easily. Today, you will use pandas and yfinance to download and process the stock data, and the talib library for technical analysis.

Create a new Python script called stock_data_analysis.py, and import the necessary libraries.

Create the app

Your app will let people choose a ticker from the S&P 500 index. Create a function to download the symbols from Wikipedia.

Then create a function that applies a technical analysis indicator depending on the selection.

Set the title of the app, add a brief description, and set up the select boxes.

Finally, download the data, apply the selected indicator, and create the chart and data table.

That's it! Now to run the app, enter the command at your terminal window in the same directory as the script you created.

In a few seconds, your browser window will open and your app will launch!

PQN #040: Build your own market data analytics app in 5 minutes. When I turned 18, I made two choices that transformed my life.

This app only touches on what you can do with Streamlit. Incorporate other technical analyses, download economic or other market data, and even host your app for others to use. Now you have an app to build on and make it yours.

And it only took 5 minutes.When I turned 18, I made two choices that transformed my life: