Giter VIP home page Giter VIP logo

ticker's Introduction

Latest Release Build Status Coverage Status Report Card

Ticker

Terminal stock watcher and stock position tracker

Features

  • Live stock price quotes
  • Track value of your stock positions
  • Support for multiple cost basis lots
  • Support for pre and post market price quotes

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 Name Alias Flag Default Description
--config ~/.ticker.yaml config file location with watchlist and positions
interval -i --interval 5 Refresh interval in seconds
watchlist -w --watchlist comma separated list of symbols to watch
show-tags --show-tags display currency, exchange name, and quote delay for each quote
show-fundamentals --show-fundamentals display open price, previous close, and day range
show-separator --show-separator layout with separators between each quote
show-summary --show-summary show total day change, total value, and total value change
show-holdings --show-holdings show holdings including weight, average cost, and quantity
sort --sort sort quotes on the UI - options are change percent (default), alpha, value, and user
proxy --proxy proxy URL for requests (default is none)
version --version print 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
  • Symbols not on the watchlist that exists in lots will automatically be watched
  • To add multiple (quantity, unit_cost) to the same symbol, write two symbol entries - see ARKW example above
  • All properties in .ticker.yaml are optional
  • .ticker.yaml can be set in user home directory, the current directory, or XDG config home

Display Options

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

Sorting

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

  • Default - change percent with closed markets at the end
  • alpha to sort alphabetically by symbol
  • value to sort by position value
  • user to sort by the order defined in configuration with positions on top then lots

Groups

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

  • If top level watchlist or lots properties are defined in the configuration file, the entries there will be added to a group named default which will always be shown first
  • Ordering is defined by order in the configuration file
  • The holdings property replaces lots under groups but serves the same purpose

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:

  • none - symbols with no suffix will default to Yahoo Finance as the data source
  • .X - symbols with this suffix are shorthand symbols that are specific to ticker and intended to provide more concise and familiar symbols for popular assets (e.g. using SOL.X rather than SOLANA.CG)
    • The full list of ticker symbols can be found here. Initial values are populated with the top 250 cryptocurrencies from CoinGecko at time of release
  • .CG - symbols with this suffix will use CoinGecko as the data source. The proper coin name can be found on the CoinGecko page in the API id field (e.g. for SOL go to the coin's page on CoinGecko, find the value is solana, and use the symbol SOLANA.CG in ticker)
  • .CC - symbols with this suffix will use CoinCap as the data source. The coin name can be found on CoinCap by searching for the asset by name. The name of the asset in the URL bar is the name (e.g. for EGLD search for "MultiversX" and on the asset page the url will have the name of the coin: elrond-egld)

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.

  • When a currency is defined, all values are converted including summary, quote, and position
  • Add cost basis lots in the currency of the exchange - these will be converted automatically when currency is defined
  • If a currency is not set (default behavior) and the show-summary option is enabled, the summary will be calculated in USD regardless of the exchange currency to avoid mixing currencies
  • Currencies are retrieved only once at start time - currency exchange rates do fluctuate over time and thus converted values may vary depending on when ticker is started
  • If the currency-summary-only is set to true and a value is set for currency, only the summary values will be converted
  • If currency-disable-unit-cost-conversion flag to true, currency conversion will not be done when calculating the cost basis. This can be useful for users that purchase a foreign security and want to use the currency exchange rate at the time of purchase by inputting the unit cost in their local currency (set in currency) rather than using the most recent currency exchange rate.

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"
  • Terminals supporting TrueColor will be able to represent the full color space and in other cases colors will be down sampled
  • Any omitted or invalid colors will revert to default color scheme values

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}]
  • Ensure there is at least one lot in the configuration file in order to generate output
  • A specific config file can be specified with the --config flag

Notes

  • Real-time quotes - Quotes are pulled from Yahoo finance which may provide delayed stock quotes depending on the exchange. The major US exchanges (NYSE, NASDAQ) have real-time quotes however other exchanges may not. Consult the help article on exchange delays to determine which exchanges you can expect delays for or use the --show-tags flag to include timeliness of data alongside quotes in ticker.
  • Non-US Symbols, Forex, ETFs - The names for there may differ from their common name/symbols. Try searching the native name in Yahoo finance to determine the symbol to use in ticker
  • Terminal fonts - Font with support for the HORIZONTAL LINE SEPARATOR unicode character is required to properly render separators (--show-separator option)

Integrations

Development

Running tests:

ginkgo -cover ./...

Linting:

golangci-lint run

Libraries ticker uses

  • bubbletea - terminal UI framework
  • termenv - color and styling for the terminal
  • term-grid - grid layout library terminal UIs

Related Tools

  • tickrs - real-time terminal stock ticker with support for graphing, options, and other analysis information
  • cointop - terminal UI tracking cryptocurrencies

ticker's People

Contributors

1dollarsteak avatar achannarasappa avatar agrimrules avatar alexisloiselle avatar alt-romes avatar cpjolicoeur avatar deroshkin avatar enescakir avatar galmadar avatar herbygillot avatar junior avatar livioavalle avatar priyanshus avatar snksynthesis avatar tomclegg avatar viperperidot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ticker's Issues

Price Alarm

Would be nice to be able to set a price alarm with notification ๐Ÿš€

Contract tests

It would be great to have a consumer-driven contract test run on a daily schedule with a GitHub action and a corresponding indicator badge to signal pass or failure to get ahead of any breaking API changes

No information displayed

Ticker is not showing any stock data at all.
Here is the result for ticker -w NET,AAPL,TSLA
image

Here is ticker -w NET,AAPL,TSLA --show-tags --show-fundamentals --show-separator --show-summary
image

Installed via brew. No internet filtering/firewalls are enabled. Here is the computer's information:
image

Allow empty watchlist

First of all, this is awesome! I actually wanted to write something very similar myself but did not get around to doing it. Thank you!

Additionally, it would be nice to allow an empty watchlist.

Currency support

As mentioned in the issue #6 I'd like to ask for currency support.

My suggestion is to add this by just watching the exchange value between the Euro and USD. You can watch the Dollar just like a usual quote, maybe you can add this.

Unfortunately If I try this on the Yahoo API it doesn't work.

Show totals in the status bar

Enhancement request: show the totals in the statusbar, aligned on the same column with the total values for each rows.

When looking in XDG_CONFIG_HOME YAML config file shouldn't have dot prefix

When storing configuration files in XDG_CONFIG_HOME, it's not typical to also have the configuration file be a hidden file.

e.g.

~/.ticker.yaml
~/.config/ticker/ticker.yaml

This issue is just a placeholder to make the config file loader a bit more robust in how it search/loads the config file to allow for a bit more leeway. The README does note the file being called .ticker.yaml in both cases, but it would also be nice (perhaps) to allow for both styles.

Auto-reload config file

Describe the solution you'd like
Automatically reload the configuration file when it changes.

Describe alternatives you've considered
Using inotifywait or entr.

Additional context
Using inotify on linux should be relatively easy?

Start ticker with default ~/.ticker.yml

Problem Statement

As a user, I want to start ticker to monitor my watchlist and existing lots in the default config ~/.ticker.yml

Proposed Solution

Running ticker without any options starts ticker using the default ~/.ticker.yml.

This would tie in with well with a command to add a lot.

Example usage:

ticker # starts a new ticker environment with fresh ~/.ticker.yml
# quit ticker

ticker lots add abnb --quantity 100 --unit-cost 147.00 # adds this lot to ~/.ticker.yml
ticker watch estc # add estc to watchlist

ticker # starts ticker with abnb lot and estc in the watchlist

dynamic region

There isn't an option for changing the region. Would be nice to use an argument in the ticker.yaml

image

Positioning of Update Datetime

The positioning of the update datetime in the lower right corner is cut off on two terminals I tested.
Is it possible to to align it with the current value (which isn't cut off).

Best Regards
ticker_cutoff_date

Interval is ignored

As far as I can tell the interval flag and the corresponding option in the yaml configuration file is ignored thus always refreshing every 5 seconds.
Using Windows amd64 v2.2.0.

Also a version flag would be nice.

Windows executable detected as Malware by several Antivirus engines

I was trying to try the app in a Windows environment when the browser started to cancel the download of the compressed file...
However, I managed to download it and execute the program, which resulted in the result:

โฏ ticker

Unhandled Exception: System.ComponentModel.Win32Exception: Operation did not complete successfully because the file contains a virus or potentially unwanted software
   at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo)
   at shim.CommandExecutor.execute(String process, String arguments, String working_directory, Boolean is_gui, Boolean wait_for_exit, Boolean requires_elevation)
   at shim.ShimProgram.Main(String[] args)

Then I uploaded the file to VirusTotal, where seven Antivirus engines interpreted it as Malware/Malicious (including Microsoft itself). You can see the report here: https://www.virustotal.com/gui/file/6a89d65b6ffab900b0a1d66ad1b49b73d8a0aa147a6a08524c4af34c6cc4626f/detection

I want to think that this is not intended, but I don't know why this is happening...

Summary mixes up currencies

First off, thanks for a cool little utility.

The new summary feature --show-summary seems to add up all values without taking into account the currencies.

That is, they are all summed up even though the currencies are not the same, here is an example with a stock in USD and a crypto in EUR
Screenshot 2021-02-04 at 12 05 29

XDG compliance

It would be great if by default check for the configuration file in XDG_CONFIG_HOME (this is ~/.config for 90% of people), and maybe also XDG_CONFIG_HOME/ticker as well as in ~ for a configuration file, so as not to pollute the home directory with dotfiles.

Normally I'd have just submitted a pull request but I don't know Go, but I'm happy to help with any details or clarifications about it.

Cool project!

Bottom status bar covering information

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:

  1. Start ticker with show-fundamentals: false show-tag: false
  2. Scroll to the very bottom

Expected behavior
What should happen: See the price of the last stock
What actually happens: Last stock price is covered by bottom bar

Screenshots
2021-02-05_12-11_126560005_scrot

Environment (please complete the following information):

  • OS: Linux
  • Terminal: alacritty
  • Terminal Version: 0.6.0
  • ticker Version: b2eb144

Total for lots?

May be displaying totals for lots (in the status line?) could be worth considering? :)

Otherwise, seems like a great app, already using it.

(feature request) show profits/loss percent based on "lots"

Hi

Thank you very much for this software. At the moment I use the Stocks.app from Apple, which unfortunately has a proprietary file format. YAML is much better. The first impression of your software has me excited.

Example config:

show-tags: true
show-fundamentals: true
show-separator: true
interval: 10
watchlist:
  - BTC-EUR
lots:
  - symbol: "BTC-EUR"
    quantity: 0.24
    unit_cost: 900

Let's suppose I bought 0.24 Bitcoin for 900 Euro in the past.
I now wish to see how much profit or loss I made (in percent) with today price.

I am absolutely new to the investing world, but this profit/loss percent interests me the most.

HTTP response errors are not reported to user

Describe the bug
When there is an unexpected response with making the HTTP request retrieve quotes, the UI shows blank content with no indication as to what the problem is.

To Reproduce
Steps to reproduce the behavior:

  1. Start ticker with ticker -w AAPL --proxy "http://localhost:9999" (assuming no proxy exists at this port/host)
  2. See empty UI with no error message

Expected behavior
UI to be populated with data or an error message indicating what the problem is

Proposed solution
When there is a HTTP error response, display message in UI or exit application with error

See #59 for more information and workaround

Cannot find config file

The config file is not in the default directly as mentioned here and I do not see it anywhere.

using a ticker.yaml does not explain what will be the command to run it

Hi,

thank you for this great useful code I will daily use but ...
Even if I used the recommended yaml file I can not display this content by using even "ticker" or "ticker -w".
Then I read back twice the explanation but did not found how to run it correctly. I even moved the yaml file from /usr/local/bin to /home or /home/ and did not get it workable.

Please tell me how to use it properly with yaml.

Have a nice day and take care.

Redundant/alternate data sources

Background
Currently, data is pulled from Yahoo finance's unofficial API. Given the API is not officially supported, it could be shut down, limited, or changed in some way that makes ticker unusable which presents a serious risk.

Additionally, there are data sources that may not be covered by Yahoo finance that users may find value in using with ticker's interface.

Request
In order to add redundancy and extensibility, it would be ideal to have the option to pull from different, configurable data sources.

Technical Details

  • Implement of adapters (i.e. anti-corruption layer) for each data source
  • Implement Yahoo finance adapter
  • Define normalized internal data structures for quotes responses

Color Configuring

The Dark Grey is barely readable on dark terminals when there's sunlight in the room.

Best regards
ticker_cutoff_date

Edit:
This is a tricky one. ticker isn't using ANSI colors but termenv, which doesn't respect color schemes.

I patched it with fatih/color to use ANSI for most Text and it improved readability for me a lot.

I guess this is a fundamental decision everyone has to decide for themselves. I have no problem with maintaining a patch so I am fine.

ticker

diff --git a/go.mod b/go.mod
index d546e43..7b48c24 100644
--- a/go.mod
+++ b/go.mod
@@ -7,6 +7,7 @@ require (
        github.com/adrg/xdg v0.3.0
        github.com/charmbracelet/bubbles v0.7.5
        github.com/charmbracelet/bubbletea v0.12.2
+       github.com/fatih/color v1.7.0
        github.com/go-resty/resty/v2 v2.3.0
        github.com/jarcoal/httpmock v1.0.7
        github.com/lucasb-eyer/go-colorful v1.0.3
diff --git a/go.sum b/go.sum
index e79c0f2..d970abb 100644
--- a/go.sum
+++ b/go.sum
@@ -50,6 +50,7 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c
 github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
 github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ=
 github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no=
+github.com/fatih/color v1.7.0 h1:DkWD4oS2D8LGGgTQ6IvwJJXSL5Vp2ffcQg58nFV38Ys=
 github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4=
 github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
 github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4=
@@ -145,6 +146,7 @@ github.com/lucasb-eyer/go-colorful v1.0.3 h1:QIbQXiugsb+q10B+MI+7DI1oQLdmnep86tW
 github.com/lucasb-eyer/go-colorful v1.0.3/go.mod h1:R4dSotOR9KMtayYi1e77YzuveK+i7ruzyGqttikkLy0=
 github.com/magiconair/properties v1.8.1 h1:ZC2Vc7/ZFkGmsVC9KvOjumD+G5lXy2RtTKyzRKO2BQ4=
 github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ=
+github.com/mattn/go-colorable v0.0.9 h1:UVL0vNpWh04HeJXV0KLcaT7r06gOH2l4OW6ddYRUIY4=
 github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU=
 github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4=
 github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHXY=
diff --git a/internal/ui/ui.go b/internal/ui/ui.go
index 4c03fd5..08fdb8e 100644
--- a/internal/ui/ui.go
+++ b/internal/ui/ui.go
@@ -10,19 +10,21 @@ import (
        "ticker/internal/ui/component/watchlist"
        "time"
 
-       . "ticker/internal/ui/util"
+       // . "ticker/internal/ui/util"
        . "ticker/internal/ui/util/text"
 
        "github.com/charmbracelet/bubbles/viewport"
        tea "github.com/charmbracelet/bubbletea"
        "github.com/go-resty/resty/v2"
+       "github.com/fatih/color"
 )
 
 var (
-       styleLogo = NewStyle("#ffc27d", "#f37329", true)
-       styleHelp = NewStyle("#4e4e4e", "", true)
+       styleLogo = color.New(color.FgBlack, color.BgYellow).SprintFunc()
+       styleHelp = color.New(color.FgHiBlack).SprintFunc()
 )
 
+
 const (
        footerHeight = 1
 )
diff --git a/internal/ui/util/style.go b/internal/ui/util/style.go
index 813d84f..c0659a7 100644
--- a/internal/ui/util/style.go
+++ b/internal/ui/util/style.go
@@ -5,6 +5,7 @@ import (
 
        "github.com/lucasb-eyer/go-colorful"
        te "github.com/muesli/termenv"
+       "github.com/fatih/color"
 )
 
 const (
@@ -12,12 +13,12 @@ const (
 )
 
 var (
-       StyleNeutral       = NewStyle("#d4d4d4", "", false)
-       StyleNeutralBold   = NewStyle("#d4d4d4", "", true)
-       StyleNeutralFaded  = NewStyle("#616161", "", false)
-       StyleLine          = NewStyle("#3a3a3a", "", false)
-       StyleTag           = NewStyle("#d4d4d4", "#3a3a3a", false)
-       StyleTagEnd        = NewStyle("#3a3a3a", "#3a3a3a", false)
+       StyleNeutral       = color.New(color.FgWhite).SprintFunc()
+       StyleNeutralBold   = color.New(color.FgWhite, color.Bold).SprintFunc()
+       StyleNeutralFaded  = color.New(color.FgHiBlack).SprintFunc()
+       StyleLine          = color.New(color.FgBlack).SprintFunc()
+       StyleTag           = color.New(color.FgWhite, color.BgBlack).SprintFunc()
+       StyleTagEnd        = color.New(color.FgWhite, color.BgBlack).SprintFunc()
        StylePricePositive = NewStyleFromGradient("#C6FF40", "#779929")
        StylePriceNegative = NewStyleFromGradient("#FF7940", "#994926")
 )

Feature request: edit appearance of price quote

Would it be possible to edit the appearance of the quoted price for the stock? Things like font size, bold, and font color would be nice to edit to make the price stand out more I think. It would also be nice to be able to move it to a different position on the screen closer to the center of the screen imo.

Edit: I see now why the price quote is on the far right, it is to make room for the holdings column. I still think being able to adjust the appearance would be good though.

Add a thousands separator

Large position numbers would be easier to read with a thousands separator, or even better make the number format string configurable.

Unable to pipe

Describe the bug
I'm unable to pipe the output of ticker, for example to less.

To Reproduce
Steps to reproduce the behavior:

  1. ticker -w BOWL.L | less
  2. See error: Unable to start UI: inappropriate ioctl for device

Expected behavior
I'd expect to see output similar to top | less

Environment (please complete the following information):

  • OS: Linux - Ubuntu 20.04
  • Terminal: Konsole (fish shell)
  • Terminal Version: Konsole: 20.12.1, Fish: 3.1.2
  • ticker Version: v3.0.2

Flickering on updates in tmux

Hi, I was wondering if I am the only one experiencing flickering on updates of the tickers list.
I've just installed the package, and for demo purpose added AAPL,NET,TSLA tickers.
I use tmux, could be this the source of the problem?
I tested it on simple terminal, it works ok.

My os is ubuntu 20.04.

Add a changelog

Can we get a CHANGELOG.md appended to when new versions are released?

Ticker command to add lot

Problem Statement

As a user, I want to add a lot at any time from the command line without having to edit ~/.ticker.yml

Proposed Solution

Running a command such as ticker lots add abnb --quantity 100 --unit-cost 147.00 adds this to the lots in ~/.ticker.yml

This would tie in with well with a command to start ticker without any flag.

Example usage:

ticker lots add abnb --quantity 100 --unit-cost 147.00 # adds this lot to ~/.ticker.yml

ticker # starts ticker with abnb lot

Request to toggle on/off the display the my dollar balances.

Would like the option to be able to toggle on/off the display the my dollar balances.

I'd like to be able to press a key such as T to toggle balance amount off, take a screen shot and toggle the balance back on. Displaying all the gains / loss and percentages are fine. I would just like a quick way to not show how much is actually invested.

In the yaml file, would like the ability to define if this feature is on or off by default at startup.

Feature Request: Export data

One of my everyday routines is to update a spreadsheet with the current values of the tickers I have invested.
This system is great for that! Instead of going to a bunch of websites, I just run the terminal and it's done.

An export to JSON feature for example would be great because I could just put a script to run on the cronjob to update my spreadsheet using its data.

Thank you for the app :)

Module path should include repository hostname / path

To follow Go conventions and to make this package go get-able, the module path should be github.com/achannarasappa/ticker and the package import paths should be github.com/achannarasappa/ticker/{package}.

Currently, attempting to go get github.com/achannarasappa/ticker (my preferred way of installing go executable programs) fails with:

package ticker/cmd: unrecognized import path "ticker/cmd": import path does not begin with hostname

Add a command to print portfolio values to stdout for unix style piping

Background
Currently ticker only provides the data in a graphical user interface. To track portfolios over time or use the collected data in other ways the quotes and summaries should be printed to the stdout in a predefined format like json.

Request
In order to pipe asset and portfolio values into other tools in a CLI context, there should a command to print those values in different formats to the stdout.

Technical Details

  • there should be a specific (sub)command to trigger printing to stdout
  • flags for this command define which data to export and in what format
  • executed with this command, ticker doesn't show the graphical interface, it only prints the collected quotes and summaries

Additional context

An example how this could look like is the "holdings" command in cointop which enables users output only the total value of a portfolio or get the current values in different format like json or csv.

screenshot-cointop

Sorting?

As for now, as I understand, it sorts tickers by their growth. This leads to tickers constantly changing their positions. Can sorting by name be implemented?

Or, better, sort according to the order in the configuration file if one's present (this could allow custom sorting, visually separating a group of unrelated tickers, and also other things, like putting "lots" on top, and the rest of the watchlist below).

Docker support

Proposed Solution
Create Dockerfile and publish to Docker hub for easy usage without need to install the cli

Use Cases
Run Docker command to run Ticker

Additional context
Pull request already created with the solution. PR #75

Not all securities have a `PostMarketPrice`

quote.go uses responseQuote.PostMarketPrice if responseQuote.MarketState == "POST", however, some securities do not have a post market price. E.g. the latest price for https://query1.finance.yahoo.com/v7/finance/quote?lang=en-US&region=US&corsDomain=finance.yahoo.com&symbols=LUS.DE after the market has closed will still be RegularMarketPrice. ticker wil therefore display 0.0 as latest price.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.