Home

Awesome

<p> <a href="https://github.com/achannarasappa/ticker/releases"><img src="https://img.shields.io/github/v/release/achannarasappa/ticker" alt="Latest Release"></a> <a href="https://github.com/achannarasappa/ticker/actions"><img src="https://github.com/achannarasappa/ticker/workflows/test/badge.svg" alt="Build Status"></a> <a href='https://coveralls.io/github/achannarasappa/ticker?branch=master'><img src='https://coveralls.io/repos/github/achannarasappa/ticker/badge.svg?branch=master' alt='Coverage Status' /></a> <a href='https://goreportcard.com/badge/github.com/achannarasappa/ticker'><img src='https://goreportcard.com/badge/github.com/achannarasappa/ticker' alt='Report Card' /></a> </p> <h1 align="center">Ticker</h2> <p align="center"> Terminal stock watcher and stock position tracker </p> <p align="center"> <img align="center" src="./docs/ticker.gif" /> </p>

Features

Install

Download the pre-compiled binaries from the releases page and copy to a location in PATH or see quick installs below

homebrew

brew install achannarasappa/tap/ticker

linux

curl -Ls https://api.github.com/repos/achannarasappa/ticker/releases/latest \
| grep -wo "https.*linux-amd64*.tar.gz" \
| wget -qi - \
&& tar -xvf ticker*.tar.gz ticker \
&& chmod +x ./ticker \
&& sudo mv ticker /usr/local/bin/

docker

docker run -it --rm achannarasappa/ticker

Note: config file can be mounted from the host machine by using a bind mount with -v ~/.ticker.yaml:/.ticker.yaml

snap

sudo snap install ticker

Note: config file will need to be set with --config $HOME/ticker.yaml since Snap does not allow access to dotfiles

Third-party repositories

These repositories are maintained by a third-party and may not have the latest versions available

MacPorts

sudo port selfupdate
sudo port install ticker

Quick Start

ticker -w NET,AAPL,TSLA

Usage

Option NameAliasFlagDefaultDescription
--config~/.ticker.yamlconfig file location with watchlist and positions
interval-i--interval5Refresh interval in seconds
watchlist-w--watchlistcomma separated list of symbols to watch
show-tags--show-tagsdisplay currency, exchange name, and quote delay for each quote
show-fundamentals--show-fundamentalsdisplay open price, previous close, and day range
show-separator--show-separatorlayout with separators between each quote
show-summary--show-summaryshow total day change, total value, and total value change
show-holdings--show-holdingsshow holdings including weight, average cost, and quantity
sort--sortsort quotes on the UI - options are change percent (default), alpha, value, and user
proxy--proxyproxy URL for requests (default is none)
version--versionprint the current version number

Configuration

Configuration is not required to watch stock price but is helpful when always watching the same stocks. Configuration can also be used to set cost basis lots which will in turn be used to show total gain or loss on any position.

# ~/.ticker.yaml
show-summary: true
show-tags: true
show-fundamentals: true
show-separator: true
show-holdings: true
interval: 5
currency: USD
currency-summary-only: false
watchlist:
  - NET
  - TEAM
  - ESTC
  - BTC-USD # Bitcoin price via Yahoo
  - SOL.X # Solana price via CoinGecko
  - SAMOYEDCOIN.CG # Samoyed price via CoinGecko
  - CARDANO.CC # Samoyed price via CoinCap
lots:
  - symbol: "ABNB"
    quantity: 35.0
    unit_cost: 146.00
  - symbol: "ARKW"
    quantity: 20.0
    unit_cost: 152.25
  - symbol: "ARKW"
    quantity: 20.0
    unit_cost: 145.35
    fixed_cost: 7.00 # e.g. brokerage commission fee
groups:
  - name: crypto
    watchlist:
      - SHIB-USD
      - VGX-USD
    holdings:
      - symbol: SOL1-USD
        quantity: 17
        unit_cost: 159.10

Display Options

With --show-summary, --show-tags, --show-fundamentals, --show-holdings, and --show-separator options set, the layout and information displayed expands:

<img src="./docs/ticker-all-options.png" />

Sorting

It's possible to set a custom sort order with the --sort flag or sort: config option with these options:

Groups

Watchlists and holdings can be grouped in .ticker.yml under the groups property. While running ticker, press <kbd>TAB</kbd> to cycle forward through groups.

Data Sources & Symbols

ticker pulls price quotes from Yahoo Finance by default but also supports pulling quotes from CoinGecko which supports price quotes for most cryptocurrencies. In order to pull from a specific data source, use a source suffix:

Currency Conversion

ticker supports converting from the exchange's currency to a local currency. This can be set by setting the currency property in .ticker.yaml to a ISO 4217 3-digit currency code.

<img src="./docs/ticker-currency.png" />

Custom Color Schemes

ticker supports setting custom color schemes from the config file. Colors are represented by a hex triplet. Below is an annotated example config block from .ticker.yaml where custom colors are set:

# ~/.ticker.yaml
watchlist:
  - NET
  - TEAM
  - ESTC
  - BTC-USD
colors:
  text: "#005fff"
  text-light: "#0087ff"
  text-label: "#00d7ff"
  text-line: "#00ffff"
  text-tag: "#005fff"
  background-tag: "#0087ff"

Printing Holdings

ticker supports printing holdings to the terminal as text by using ticker print. Output defaults to JSON but CSV output can also be generated by passing the --format=csv flag.

$ ticker --config=./.ticker.yaml print
[{"name":"Airbnb, Inc.","symbol":"ABNB","price":164.71,"value":16965.13,"cost":15038,"quantity":103,"weight":53.66651978212161},{"name":"Tesla, Inc.","symbol":"TSLA","price":732.35,"value":14647,"cost":15660,"quantity":20,"weight":46.33348021787839}]

Notes

Integrations

Development

Running tests:

ginkgo -cover ./...

Linting:

golangci-lint run

Libraries ticker uses

Related Tools