Stop Manually Auditing Your Stock Portfolio: Automate Your Dhaka Stock Exchange (DSE) Analysis with n8n and Gemini
Turn hours of manual spreadsheet work into a zero-touch, automated workflow. Get daily DSE price checks, news analysis, and actionable insights delivered straight to your inbox.
How much time do you spend each week logging into your brokerage account, downloading a PDF statement, cross-referencing it with live DSE prices, and scanning the news for relevant disclosures?
If you are a serious investor in the Bangladesh capital market, this routine is essential, though it can be time-consuming. What if you could reclaim that time while making better, faster investment decisions?
The answer lies in Workflow Automation combined with Generative AI.
[Disclosure: This post contains a referral link for NSAVE (A secure cross-border financial platform for freelancers and remote workers to hold USD, GBP, and EUR safely offshore). If you sign up using the link below, I may receive a benefit, and you will receive a free month of the Pro subscription.]
The Problem: Manual Friction
As an investor, you need a holistic view of your portfolio. You need to know:
Your current valuation vs. your cost basis.
If any corporate news (dividends, earnings, price-sensitive information) is impacting your holdings.
If you are over-concentrated in a specific sector.
Getting this view requires manually pulling data from multiple sources—your email, the DSE website, and financial news portals. This friction often leads to delayed decisions.
The Solution: A Fully Automated DSE Audit Pipeline
By using the low-code automation platform n8n, integrated with Google Gemini via LangChain, we can build a robust “set-and-forget” workflow that automatically performs a complete portfolio audit.

Let’s break down how the automated pipeline, as seen in the screenshot below, functions:
- The Gmail Trigger: The workflow begins passively. Every minute, it scans your Gmail inbox for an email with a specific subject line (e.g., Portfolio has attachment) from your brokerage. Once it arrives, it automatically downloads the PDF statement.
- Data Extraction: The Extract from File node acts as a virtual assistant. It reads the attached PDF and parses the raw text into usable data: the stock tickers you own, the average buy price, and the total quantity of shares.
- Live Market Intelligence. This is where the power of automation shines. Instead of you checking the DSE website, the workflow does it for you: Get DSE Prices: This HTTP Request node scrapes the live share price scroll from dsebd.org. Get DSE News: A second HTTP Request node fetches today’s latest news and corporate disclosures from the DSE archive.
- AI Analysis with Gemini: This is the brain of the operation. The workflow bundles three crucial pieces of data—your parsed PDF portfolio, the live DSE prices, and the day’s news—and sends it to the Google Gemini AI model. Gemini acts as your expert equity research analyst, executing a detailed prompt that maps sector distribution, calculates real-time P&L, assesses news impact, and generates both a 72-hour tactical plan and a long-term strategic compounding forecast.
- Delivery: Finally, the AI-generated report is formatted into clean HTML, and the Send Gmail node delivers the final, comprehensive audit directly to your inbox.
The Key Takeaway
By automating this process, you eliminate the manual effort required to gather data. You move from a reactive state to a proactive, data-informed state. This is just one example of how modern automation tools can be applied to capital markets. Whether you are an individual investor or a financial advisor, mastering workflow automation is the next step in investment efficiency.

