- tags
- #pkg-portfolio #example #help #listed
- view
- public
- description
- Stock portfolio tracker app: your holdings, what you paid, today's value and profit, and news on your stocks. An AI Putty example you can copy and change.
Stock portfolio tracker: holdings, profit and news
A stock portfolio tracker for anyone who holds shares across a few accounts and wants one page with what it's all worth and what's new. It's a live example built with AI Putty from one sentence: "Build me an app to track my portfolio: my holdings, what I paid, today's price, and tell me when a company I hold puts out news." You can import it into your own project and change it by talking to your AI.
Totals
Four boxes at the top add up every holding: Value (what it's worth today), Cost (what you paid), Profit and Return. Profit and return show green when up and red when down.
Holdings
One row per stock per account, biggest value first. The columns:
- Stock: the ticker and the company name.
- Account: where you hold it, such as TFSA or RRSP.
- Shares and Paid, your average cost per share.
- Price and Today, the stock's change today in percent.
- Value and P/L, the profit or loss in dollars and percent.
Add a holding (members): pick the Stock, type the Account (TFSA to start), the number of Shares and your Avg cost, then Add. The totals and the table update.
News on your stocks
Headlines on your stocks, newest first. News on a stock you hold comes before the rest. Each item shows the date and the kind of news (drilling, dividend, deal…). new marks a headline from the past week; not held marks a stock you don't own.
Examples
"Am I up or down overall?" Look at Profit and Return in the totals. In the sample data, the three holdings are worth $43,090 against $41,400 paid: a profit of $1,690, a return of +4.1%.
"Which holding is losing money?" Look for red in the P/L column. In the samples it's Copperhead Mining (CPH) in the Margin account: 10,000 shares paid at $1.30, now $1.21, down $950 or 7.3%.
"Has anything happened at a company I hold?" Read News on your stocks. Held stocks come first; a new tag means the past week.
Make it yours
Ask your AI to import it (see Portfolio): "import the portfolio app from examples". Your project gets the model, the app, this help and the sample stocks, and from then on it's yours to change. Then, say:
- "Add my three biggest holdings"
- "Fetch live prices every morning"
- "Email me when a stock I hold has news"
- "Show the totals per account"
How it's built
Three classes: a stock (ticker, name, exchange, sector, price, today's change), a holding (shares of one stock in one account at an average cost) and a news item (a dated headline on a stock). A holding's cost, value, profit and profit % are computed in the model, so every view, export and rule sees the same numbers; the page only sums them. The sample prices are fixed; live prices are a rule you can add. See PortfolioDesign for the layout and Portfolio for all the parts.