Install Required Libraries
- Install the requests library to make HTTP Requests
- Install pandas to do some data exploratory
- In this recipe we will use altair to do the data visualization, if you are unfamiliar with altair, try to watch this playlist Altair Tutorial
- This is not a library, but you will need your Sector API Keys for this recipe
Data Exploration
In this recipe, we will use the Daily Transaction Data API from Sectors. Let’s get the Daily Data of BBCA from January 2024 to March 2024.daily_data
it should look like the following:
- Symbol, the symbol that represent a company
- Date, the date of transaction
- Close, the closing price of that day
- Volume, transaction volume of that day
- Market Cap, the market cap of that day
Data Visualization
Before visualize the data, let’s transform the data to Pandas DataFrame.Time Series Visualization
Now let’s visualize the closing price data using altair:
Simple Moving Average(SMA)
It’s good if you already familiar with SMA method for time series analysis, but no worries if you haven’t, take a look at this SMA Article. Let’s use 3-Day SMA to the chart: