Pandas Role in Algorithmic Trading: From Data Analysis to 3D Candlestick Charts
In today’s digital age, Python has become a game-changer for algorithmic trading and crypto trading strategies. Especially when it comes to data analysis, the Pandas library is one of the most important tools. In this blog, you will learn how you can create stunning 3D charts, analyze time-series data, and take your Freqtrade strategy to new heights using Pandas.
Why is Pandas important for data analysis?
Algo traders and quantitative analysts spend about 70% of their time processing and analyzing data. Without Pandas, this task becomes almost impossible. The main reason for this is that Pandas has:
- Simple and powerful data structures available: Series (1D) and DataFrame (2D)
- Built-in time series analysis tools
- Data cleaning and filtering is easy
- Aligning large amounts of data is easy
Create 3D charts and stunning visualizations with Pandas
When working with Pandas, you are not limited to just reading and processing data. You can also create some amazing visual representations like:
- 3D candlestick charts with volume bars
- 3D line plots for moving averages
- 3D bubble charts for stocks (e.g. Google, Apple, Microsoft)
- 3D surface plots with annotations
All these graphs will not only help you understand the data better, but will also be helpful in making the right decisions in trading.

Series and DataFrame: The two pillars of Pandas
When working with Pandas, you are not limited to just reading and processing data. You can also create some amazing visual representations like:
- 3D candlestick charts with volume bars
- 3D line plots for moving averages
- 3D bubble charts for stocks (e.g. Google, Apple, Microsoft)
- 3D surface plots with annotations
All these graphs will not only help you understand the data better, but will also be helpful in making the right decisions in trading.
Pandas provides two main data structures:
Series (1D data): Like a column or row in an Excel sheet
DataFrame (2D data): Like an entire table with both rows and columns
For example, if you have a table that contains stock names, prices, and dates, it is a DataFrame. And any one column or row of that table is called a Series.
Time Series Analysis: The Heart of Algorithmic Trading
Since most of the data in trading is time-based (like stock prices change every minute/second), Pandas’ inbuilt time series handling is extremely beneficial for algo trading. With Pandas you can:
- Set time index
- Add indicators like moving average, EMA, RSI
- Slice data by time
Data cleaning: wrong data means wrong results
Suppose you downloaded 10 years of data of Apple or Bitcoin, but there are some missing values or errors in it. Then the whole trading strategy can go in the wrong direction. That’s why Pandas has:
- Tools to handle missing values
- Filtering and aggregation functions
- Features to identify and replace NaN values
Data alignment and integration
Another great feature of Pandas is that it automatically aligns data based on labels. This makes it very easy to merge or compare different tables or series.
Also, it integrates easily with:
- NumPy
- Matplotlib
- Other Python libraries like SciPy
Data input-output (I/O) tools
Pandas has a number of I/O functions that help you read and save data from different formats:
- CSV
- Excel
- SQL
- JSON etc.
This means you can fetch data from any source and analyze it in Pandas.
Watch this Day 23 video tutorial
Day 23: Pandas Series
7/20