← All Articles

πŸ’¬ A Comprehensive Guide to Deploying ChatGPT for Zero-Cost Financial Analysis of Any Company πŸ“ˆ

Austin Starks Β· Originally published

The original story is on Medium!

  Go to GitHub for AI-Finance Tool

This October 2023 guide shows two ways to turn financial statements into an AI summary. You can run the script without an OpenAI API key and paste its JSON into ChatGPT, or configure the optional API integration. The API route can incur usage charges; check the account terms before using it. The zero-cost description applies to the manual route under the account access available at publication.

AI-Powered Finance

Two Tailored Analytical Approaches

Understanding that my audience comes from diverse technical backgrounds, this guide provides two tailored strategies for conducting your financial review. Choose the route that fits your technical background. To compare their answers, give both the same company, financial statements and reporting period; different inputs can produce different conclusions. Your choices are:

  1. Leverage NexusTrade: An AI-Driven Stock Research Platform, perfect for investors wanting quick, actionable intel without the nitty-gritty.
  2. Visit My GitHub Repository for the AI Financial Analysis Toolkit: This option is great for developers who want to automate the process and understand what’s going on under the hood.

I will describe each of these approaches in great detail.

Read: ChatGPT generated my algorithmic trading strategy. It beat the market.

NexusTrade: The Vanguard of AI-Enabled Investments

NexusTrade is a pioneer in the realm of automated investment platforms, with its jewel being the AI-Powered Chat feature. Say goodbye to cumbersome GitHub downloads, multiple sign-up procedures, and environment variable tangles. With NexusTrade, you converse with a highly sophisticated AI capable of understanding your analytical needs. For instance:

The first halve of the response from the AI Agent The second halve of the response from the agent

The AI is able to extract balance sheet information about Nvidia, summarize it, and discuss potential upsides and downsides. This efficiency transforms your financial research, enabling you to cover a wide range of companies with extreme ease.

Moreover, NexusTrade allows you to design trading strategy portfolios right within the chat interface. For more information on the value of NexusTrade, check out the following article:

I created an open-source automated trading platform. Here’s how much it’s improved in a year.

The DIY Route: SimFin API and ChatGPT

If you’re a software engineer who wants programmatic access to company’s financials, this next approach is for you.

For this approach, you’ll need the following:

  1. A Free SimFin API token
  2. An OpenAI API key OR a ChatGPT account

 

 

The two coding routes support the same analysis task. Match their inputs before comparing the responses. Go to my GitHub page for AI Financial Analysis tool.

Go to GitHub for AI-Finance Tool

Clone the repository, and set up your environment variables in a .env file like so:

# In a file called .env at the root of the directory.
SIMFIN_TOKEN=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
OPENAI_API_KEY=sk-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx # optional

Replace these variables in the code

Once you’ve configured your environment, update the Python script with the stock ticker, time period, and fiscal year you’re interested in analyzing. Run the following commands:

pip install -r requirements.txt
python3 main.py

The sample below reports assets of $346.747 billion, liabilities of $290.020 billion and equity of $56.727 billion. Assets minus liabilities equals the stated equity. Its reported Piotroski F-Score is 4, net debt to EBITDA is 1.53, and dividend payout ratio is 12.56%. The printed excerpt does not identify the company or fiscal period, so it cannot establish a dated company conclusion by itself.

To repeat this workflow, choose one company and one fiscal period in the script. Keep those labels with the JSON and ask the assistant: β€œUsing only these statements, identify the company and fiscal period, summarize the balance sheet, show the arithmetic behind each reported ratio, and list the information that is missing.” Check the answer against the input before comparing it with another period.

AI Assistant: Based on the provided financial information, here is a
summary of the company's finances:

1. Balance Sheet:
- Total Assets: $346,747,000,000
- Total Liabilities: $290,020,000,000
- Total Equity: $56,727,000,000

... // other data

7. Other Important Metrics:
- Piotroski F-Score: 4
- Net Debt / EBITDA: 1.53
- Dividend Payout Ratio: 12.56%

The Piotroski F-Score of 4 suggests that the company has a moderate
financial strength. The net debt to EBITDA ratio indicates the company's
ability to repay its debt, with a ratio of 1.53. The dividend payout
ratio suggests that the company distributes a portion of its earnings as
dividends.

Based on the provided information, the company appears to be in a strong
financial position with healthy profitability metrics and positive cash flow.
However, it is important to conduct further research and analysis to
fully understand the company's financial health and prospects.

Without the optional OpenAI API key, the script outputs the financial data as JSON. Copy that JSON together with its company and fiscal-period labels into the manual ChatGPT route shown below.

Balance Sheet
{
"Assets": {
"Cash, Cash Equivalents & Short Term Investments": "$51,355,000,000",
"Accounts & Notes Receivable": "$23,752,000,000",
"Inventories": "$6,820,000,000",
"Other Short Term Assets": "$46,850,000,000",
"Total Current Assets": "$128,777,000,000",
"Total Noncurrent Assets": "$217,970,000,000",
"Total Assets": "$346,747,000,000"
},
... // more data
}

Cash Flow
{
"Operating Activities": {
"Net Income": "N/A",
"Depreciation & Amortization": "$2,916,000,000",
"Change in Working Capital": "$-1,497,000,000",
"Net Cash from Operating Activities": "$34,005,000,000"
},
... // more data
}

Derived
{
"Profitability Metrics": {
"EBITDA": "$38,932,000,000",
"Gross Profit Margin": "0.42962",
"Operating Margin": "0.30742",
"Net Profit Margin": "0.25606",
"Return on Equity": "0.52881",
"Return on Assets": "0.08651",
"Return On Invested Capital": "0.15283"
},
... // more data
}

Profit Loss
{
"Income": {
"Revenue": "$117,154,000,000",
"Gross Profit": "$50,332,000,000"
},
... // more data
}

From here, we can copy/paste the system prompt and the script output into ChatGPT as follows:

Input into ChatGPT

For the entire response, check out my Chat History on ChatGPT.

Final Thoughts

The two routes serve different readers: NexusTrade provides the chat workflow, while the repository exposes the data preparation. Compare their underlying company, period and statement inputs before expecting matching conclusions. To continue in Aurora, open a company-research conversation with one ticker and fiscal period, then ask for a source-linked summary. The script instructions above remain the archived October 2023 example.

One potential way to improve this process is by using more specialized GPT models. For example, FinGPT is an open-source generative model specifically trained on Financial Data. It could likely do a better, more robust analysis of a company’s earnings and help you make more informed financial decisions.

However, remember that AI is not infallible. While it significantly streamlines financial analysis, you should supplement these insights with your own research and due diligence. Make your financial decisions wisely; any action you take based on this guide is at your own risk.

Thanks for reading! For more intriguing articles like this, consider subscribing to Aurora’s Insights, your one-stop source for AI and finance-related discussions.

  Go to NexusTrade  

πŸ“š Follow our thought pieces on Medium 

 

🀝 Connect with me on LinkedIn

 

πŸ‘¨β€πŸ’» Explore our projects on GitHub

 

πŸ“Έ Catch us on Instagram

 

🎡 Dive into our TikTok 

Put your research to work

Create a free account to research a company, build a strategy with Aurora, or inspect a historical backtest. Choose the task you want to try.

or

Free to browse. No credit card required.

Discussion

Sign in or create a free account to join the discussion.

No comments yet.