Skip links

Stock Analysis Using Wolfram Mathematica

I have my own toolkit for analyzing stocks, but occasionally I use Mathematica as well. Given Mathematica’s extensive support for numerical computation including Machine Learning, it can be a valuable resource for deep analysis of the stock market. In today’s article, let me give an overview of some of the features that are helpful for a beginner trader. 

The starting point, of course, is downloading stock-specific data. Mathematica supports a variety of exchanges for this pupose. The function “FinancialData[]” is used for downloading data. 

Let us first find out what exchanges are supported:

Supported Exchanges
Supported Exchanges

 We see that BSE is supported, but not NSE. That is OK for our discussion.

How to find out the ticker symbols in BSE?

BSE Ticker Symbols
BSE Ticker Symbols

This list quite large, so I am not showing all the symbols. Let us check how many symbols are supported in BSE.

Count of Supported Symbols
Count of Supported Symbols

That is good, a total of 3980 entities in BSE. But how to find out which symbol stands for which company? We can use the same FinancialData[] function for this:

Finding Name from Symbol
Finding Name from Symbol

For our convenience, let us randomly select 50 companies from BSE.

Randomly Picking Symbols
Randomly Picking Symbols

Next, let us display this in the form of a Table, showing the Name and its Symbol.

Partial List of Ticker Symbols and Names
Partial List of Ticker Symbols and Names

How to display the chart for any symbol? Let us download the actual Open-High-Low-Close (OHLC) EOD data for a specific symbol and render it in the form of a Candle Stick chart:

Candle Stick Chart
Candle Stick Chart

The chart shows EOD data from Jan 1, 2025 to Aug 1, 2025.

There is a variant of CandleStickChart[] function, called TradingChart[] that displays Volume data as well.

TradingChart with Volume
TradingChart with Volume

Note that I have downloaded Volume as well using “OHLCV” parameter. 

For comparison, here is the chart as rendered in TradingView.

TradingView Chart
TradingView Chart

We can make the chart interactive and add needed indicators too. For this, let us use InteractiveTradingChart[] function and add indicators to it. This adds significant value to the analysis.

InteractiveChart
InteractiveChart

The above chart displays, in addition to Volume, Commodity Channel Index (20) and Keltner Channels (20, 10, 2). What is also interesting is that when you hover the mouse over the chart, the corresponding candle is highlighted and the relevant indicator values are shown.

Nice, isn’t it? The function FinancialData[] can also give us Fundamental data pertaining to the company, for example, P/E Ratio, MarketCap, EBITDA, etc. It is not limited to Technical data alone.

Let us dive into other interesting aspects of stock analysis using Mathematica in a future article. 

I have used Wolfram Mathematica ver 14.2 for this article. You can download my notebook here.

Have a great week ahead!

Leave a comment