Skip to content

clawedcode-git/stockman

Repository files navigation

StockMan icon

StockMan

A personal stock portfolio tracker for Android.
No account. No subscription. No cloud. All data stays on your device.


What it does

StockMan tracks your stock holdings, watchlist, dividends, and transaction history entirely on-device. Organise everything into multiple portfolios — one per goal or family member — and view them individually or consolidated. Live prices come from Yahoo Finance — no API key required. The app works in any display currency (USD, EUR, GBP, JPY, INR) using live exchange rates.


Screenshots

A deep-navy interface with a fresh green accent, monospace figures, and a fully themed light / dark / AMOLED experience.

Portfolio · Dark Stock detail · Dark Analytics · Dark
Portfolio dashboard with multi-portfolio selector Stock detail with 7-day chart and market statistics Analytics performance chart
Multi-portfolio selector, live values, gain/loss pills 7D/30D price chart + market statistics Portfolio performance over time
Portfolio · AMOLED Portfolio · Light Add Holding
Portfolio dashboard in AMOLED black theme Portfolio dashboard in light theme Add holding form
True-black OLED theme Clean light theme Log a holding into any portfolio

Features

Portfolio

  • Live prices on every holding — current price inline next to the ticker, total position value on the right
  • Daily change badge — today's dollar P&L (±$X) per holding in green/red
  • All-time gain/loss — absolute and % from your purchase cost basis
  • Realized P&L — close a position via "Record Sale"; closed positions are tracked separately with realized gain/loss
  • Multiple portfolios — keep separate portfolios per goal or family member and switch with one tap, or view them all consolidated (see below)
  • Sort by value, gain %, or ticker A–Z (≡ icon in the top bar)
  • Swipe to delete — swipe a holding left or right to remove it
  • Watchlist toggle — add/remove a ticker from the watchlist directly in the edit dialog
  • Copy ticker — tap the ⎘ icon to copy a ticker symbol to clipboard
  • Import — tap the ↑ icon in the top bar to import trades from a brokerage CSV
  • Share snapshot — tap ↗ to share a formatted portfolio summary via the system share sheet
  • Pull-to-refresh — swipe down for an immediate price refresh

Multiple portfolios

Track several portfolios in one app — e.g. ISA, SIPP, Taxable, or one per family member.

  • Create, rename, recolour, and delete portfolios under Settings → Portfolios (each gets a colour dot from an 8-colour palette and an optional owner label)
  • A portfolio selector strip appears on My Portfolio once you have more than one — pick All Portfolios for a consolidated view or tap a single portfolio to filter
  • Every figure respects the filter: total value, daily change, gain/loss, realized P&L, and the holdings list all reflect the selected portfolio
  • When adding or editing a holding, choose which portfolio it belongs to; new holdings default to the currently selected one

Holding detail screen

Tap any holding or watchlist item to open a detail view with two tabs:

  • Overview — live price, daily change, 7D/30D chart, market statistics (Open, Prev Close, Day High/Low, 52-Week High/Low)
  • Pre / post-market price — during an active pre-market or after-hours session, a labelled extended-hours row shows the latest extended price and its colour-coded change vs. the regular close. It's derived from Yahoo's intraday bars and trading-session windows, and is hidden automatically outside extended hours
  • News — recent Yahoo Finance headlines for the ticker with publisher, relative timestamp, and tap-to-open links

Analytics (11 tabs)

Tab Description
Performance Portfolio value chart over 7D / 1M / 3M / 6M — chart line and Change % are coloured by the selected period's own return, not the all-time gain
Diversification Sector donut chart with optional target allocation and deviation
Transactions Full trade log with per-ticker net position; CSV import
Earnings Upcoming earnings calendar with push-notification reminders
Dividends Dividend history, projected annual income, and a 3-month payment calendar
Benchmark Portfolio return vs. S&P 500 (SPY)
Tax Report Cost basis and unrealized G/L per position; export to CSV
Alerts HIGH / LOW / STOP_LOSS price triggers with push notifications
Heatmap Tiles sized by position value, coloured red→grey→green by % gain
FX Rates 30-day chart of the active currency pair (EUR/USD, GBP/USD, etc.)
DCA Dollar-cost averaging rules — log monthly investments per ticker

Home screen widget

Add the StockMan 2×1 widget from the home screen widget picker. It shows total portfolio value and daily change %, with a dark navy background that blends well on any launcher. Updates every 30 minutes and immediately after each in-app refresh.

Alerts & notifications

  • Price alerts checked in the foreground on every refresh
  • Background price alert checking via WorkManager (toggle in Settings) — runs every 30 minutes even when the app is closed
  • Earnings date reminders
  • On-demand daily portfolio summary notification

Import support

The CSV importer auto-detects the broker format — no manual selection needed.

Broker Detected by
Charles Schwab Action + Fees & Comm columns
Fidelity Trade Date + CUSIP columns
Robinhood activity_date + trans_code columns
E*TRADE TransactionType + SecurityType columns
TD Ameritrade TRANSACTION ID + REG FEE columns
Morgan Stanley StockPlan Connect Branding text or Award Type / Event Type / Transaction Type + Security
Generic CSV date, symbol/ticker, type/action, shares/quantity, price

Only BUY and SELL rows are imported. Fees, dividends, lapses, and forfeitures are skipped automatically.

Settings

Option Values
Display currency USD · EUR · GBP · JPY · INR
Theme System Default · Light · Dark (navy) · AMOLED Black
Background alerts On / Off
Portfolios Create / rename / recolour / delete portfolios

The signature Dark theme pairs deep-navy surfaces with a fresh green accent and monospace figures. AMOLED Black uses pure #000000 backgrounds so OLED pixels are fully off, saving battery. A clean Light theme is available too. The version footer in Settings reads directly from BuildConfig.VERSION_NAME and will always match the installed build.


Build & run

Prerequisites

Tool Version
Android Studio Meerkat (2024.3) or newer
JDK 17 (bundled with Android Studio)
Android SDK API 36 (compile), API 24 (minimum)
Kotlin 2.3

Clone and open

git clone https://github.com/clawedcode-git/stockman.git
cd stockman

Open the root folder in Android Studio. Gradle sync runs automatically.

Run on a device or emulator

  1. Connect a physical device (USB debugging enabled) or create an AVD via Device Manager
  2. Select the :app run configuration in the toolbar
  3. Click Run ▶

No API keys, environment variables, or external services are required.

Build a debug APK from the command line

./gradlew assembleDebug
# Output: app/build/outputs/apk/debug/app-debug.apk

Build a release APK

  1. Create a keystore if you don't have one:
keytool -genkey -v -keystore stockman.jks -keyalg RSA -keysize 2048 -validity 10000 -alias stockman
  1. Add signing config to app/build.gradle.kts (or use a keystore.properties file):
signingConfigs {
    create("release") {
        storeFile     = file("stockman.jks")
        storePassword = "yourStorePassword"
        keyAlias      = "stockman"
        keyPassword   = "yourKeyPassword"
    }
}
buildTypes {
    release {
        signingConfig    = signingConfigs.getByName("release")
        isMinifyEnabled  = true
        isShrinkResources = true
        proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
    }
}
  1. Build:
./gradlew assembleRelease
# Output: app/build/outputs/apk/release/app-release.apk

Install directly via ADB

adb install -r app/build/outputs/apk/debug/app-debug.apk

Project structure

app/src/main/java/com/example/stockman/
├── data/
│   ├── StockDatabase.kt          Room database (v7)
│   ├── StockDao.kt               All database queries
│   ├── StockRepository.kt        Repository interface + implementation
│   ├── *Entity.kt                Room entities (holdings, watchlist, dividends,
│   │                             alerts, transactions, earnings, dca_rules, accounts)
│   ├── GoogleFinanceApiService.kt Yahoo Finance primary + Google Finance fallback
│   ├── YahooFinanceApiService.kt  Retrofit interface (chart + search endpoints)
│   ├── CsvImporter.kt            Brokerage CSV auto-detection and parsing
│   └── db/Migrations.kt          Explicit Room migrations (v3 → v7)
│
├── ui/
│   ├── StockViewModel.kt         Single Hilt ViewModel for all screens
│   ├── DashboardScreen.kt        My Portfolio screen
│   ├── WatchlistScreen.kt        Watchlist screen
│   ├── AnalyticsScreen.kt        11-tab Analytics screen
│   ├── DetailScreen.kt           Holding detail (Overview + News tabs)
│   ├── SettingsScreen.kt         Settings screen
│   ├── UiComponents.kt           Shared composables: TickerBadge, ChangePill, MonoFont
│   └── main/MainScreen.kt        Navigation host
│
├── widget/
│   ├── StockmanWidget.kt         Glance home screen widget
│   └── StockmanWidgetReceiver.kt AppWidget receiver
│
├── worker/
│   └── AlertCheckWorker.kt       WorkManager background alert checker
│
├── di/
│   └── AppModule.kt              Hilt dependency injection
│
├── notifications/
│   └── NotificationHelper.kt     Push notification helper
│
└── StockmanApplication.kt        Application class (WorkManager init)

Database migrations

The Room database is at version 7. All schema changes use explicit migrations — never destructive fallback.

Version Change
3 Initial: holdings, watchlist, dividends, alerts
4 notes, sellPrice, sellDate added to holdings
5 transactions and earnings tables added
6 dca_rules table added
7 accounts table added (seeds default "Personal"); accountId added to holdings

To add a migration: bump the version in StockDatabase.kt, write a Migration object in Migrations.kt, and append it to the ALL array.


Tech stack

Layer Technology
Language Kotlin
UI toolkit Compose Material3
Home widget Glance
Navigation Navigation3
Architecture MVVM
Local storage Room
Background jobs WorkManager
HTTP Retrofit OkHttp
DI Hilt
Concurrency Coroutines
Build system Gradle

License

MIT

About

Premium Android stock portfolio tracker and automated market alerts suite built with Jetpack Compose, Room, and Hilt.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages