Coder Social home page Coder Social logo

tickrs's Introduction

tick-rs

Actions Status

Realtime ticker data in your terminal ๐Ÿ“ˆ Built with Rust. Data sourced from Yahoo! Finance.

Installation

Binary

Download the latest release for your platform

Cargo

cargo install tickrs

Arch Linux

pacman -S tickrs

Homebrew

brew tap tarkah/tickrs
brew install tickrs

Config File

See wiki entry

CLI Usage

tickrs
Realtime ticker data in your terminal ๐Ÿ“ˆ

USAGE:
    tickrs [FLAGS] [OPTIONS]

FLAGS:
    -p, --enable-pre-post    Enable pre / post market hours for graphs
    -h, --help               Prints help information
        --hide-help          Hide help icon in top right
        --hide-prev-close    Hide previous close line on 1D chart
        --hide-toggle        Hide toggle block
        --show-volumes       Show volumes graph
    -x, --show-x-labels      Show x-axis labels
        --summary            Start in summary mode
        --trunc-pre          Truncate pre market graphing to only 30 minutes prior to markets opening
    -V, --version            Prints version information

OPTIONS:
    -c, --chart-type <chart-type>              Chart type to start app with [default: line] [possible values: line,
                                               candle, kagi]
    -s, --symbols <symbols>...                 Comma separated list of ticker symbols to start app with
    -t, --time-frame <time-frame>              Use specified time frame when starting program and when new stocks are
                                               added [default: 1D] [possible values: 1D, 1W, 1M, 3M, 6M, 1Y, 5Y]
    -i, --update-interval <update-interval>    Interval to update data from API (seconds) [default: 1]

Windows

Use Windows Terminal to properly display this app.

Acknowledgments

tickrs's People

Contributors

mabezdev avatar mandeep avatar miraclx avatar orhun avatar spikecodes avatar tarkah avatar virtualritz 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

tickrs's Issues

Build instructions?

Hi,
Can you add in your readme some basic build instructions for non "go" people? ldflags, etc

Charts don't load on Android

Issue:
After "add a ticker" with a valid ticker it just repeats "..." indefinitely and never loads the chart.
The rest of the key commands and the tui app all appear to work fine.

Install: cargo install tickrs

System info:

$ cargo -V
cargo 1.50.0

$ uname -a
Linux localhost 4.14.113-20606106 #1 SMP PREEMPT Mon Feb 1 10:40:43 KST 2021 aarch64 Android

$ termux-info
Packages CPU architecture:
aarch64
Android version:
11
Device manufacturer:
samsung
Device model:
SM-N975F

Thanks for any support you can provide!

Possible Pre Post Issue with Kagi Chart?

Using symbol "ES=F" as a reference, Kagi chart behavior for "1W" timeframe seems to be intermittently working. If you cycle through the ohlc, candle, and kagi before market open you will notice the kagi chart does not reflect the "Pre Post" price movement. This seems to only occur when exiting tickrs and restarting. I have tickrs running 4/29 to 4/30 7:25am EST and kagi was was properly showing the "Pre Post" movements on the "1W" kagi chart. When I quit and restarted, only ohlc and candle were showing the "Pre Post" price movements for "ES=F".

Crash if invalid ticker is given

How to reproduce:

  1. Start tickrs
  2. Enter * into the "Add Ricker" proms
  3. Crash (see image)
    image

Suggestion: Either add character checks at the input or escape the input before create the query URL

Crash on Crypto

Crashes on unwrap of None value when looking at options of Crypto assets.

Allow reordering ticker tab entries

Just a thought, but perhaps it would be nice to have the ability to reorder tabs after adding them.

This would reflect in the tabs view and also in the summary view.

Currently, you can move forward between tabs with the tab key, and in the inverse direction with the shift+tab.

However, (and maybe it's just me), I can also use the ctrl key with that to the same effect.

So a ctrl+tab has the same effect as a tab, and so does a ctrl+shift+tab have the same effect as a shift+tab.

Maybe the ctrl specifier can be used to signify reordering.

So a ctrl+tab would move a tab forward by an index, and a ctrl+shift+tab would move the selected tab and index backwards.

This is just a suggestion and the key specifiers can be anything, I just thought these appropriate since they're apparently redundant in effect and can be repurposed but can be a topic for discussion.

Price history stretches to fit the timespan

If you try to view a timespan longer than the available data for an asset, the longest available history will be shown instead, but with no indication that it is being stretched.

20210205_10h33m51s_grim
20210205_10h34m07s_grim

For example, THNQ has existed for only about 9 months -- but attempting to view 5Y of its history gives no indication of this. This is not an issue when labels are visible, but it could be misleading in the summary view as there is no indication that different assets are not shown on the same timescale.

Some symbols always low of zero, resulting in wrong y-axis scaling used

Hey hey ๐Ÿ‘‹ it looks like for some symbols (TSLA in the case below) the low is at zero for all time ranges, resulting in plots like the 1D plot to be hard to impossible to read and interpret since we're not "zooming in" on the daily variation.

Here is a screenshot of what I mean. Is this the API sometimes just reporting zero as low? Can we do something in this case?

tsla

UI consistency

Hi @tarkah,

First let me say this is a really cool project and I hope to contribute some effort into it.

At first glance I noticed a few things that seem a bit off:

  • The words in the Toggle box are all capitalized, but things like current price, high, and low are lowercased. The same goes for the words in the Options pane as well. I think there should be some consistency where these words are all capitalized.
  • The c, h, and l letters do their job. One consistency change would be to spell them out to Current Price, High, Low.
  • In the Toggle box, the 'c' keybind should show the current chart type rather than the next chart type. This would be parity with other trading software.
  • When entering a ticker in lowercase, the ticker shows up in the Tabs section as all lowercased. I think they should be all uppercased.

Most of these are not issues, mostly just personal preferences from what I've seen in other charting software. If these sound like changes you'd like to see, let me know and I'd be happy to submit a PR.

tabs: focus tab selection in view

Tabs view should focus on the selected tab and simulate left-right scroll.

Here, MSFT is selected but it, and other symbols after it are out of view.

Screenshot_20210220_193958

when the terminal is expanded:

Screenshot_20210220_194341

Position calculation

Hello, first of all, thank you for this software, it looks great!

Have you considered the possibility of specifying an X amount per ticker in order to calculate the final position? I don't know if you think it's useful, or out of scope...

Thanks!

Custom user data source (CSV/JSON) instead of from Yahoo?

Hi,

Thanks for your work. It's amazing. I've been looking for candlestick chart in the terminal for so long.
Is there any way to provide my own OHLC data in a common format such as CSV and JSON?
An example use case is to show technical analysis in history, and therefore recent tickers are not needed.

Just a way to show a static candlestick chart is enough. Something like this would be nice:

cat ohlc.json | tickrs --candlestick

Panic: Too many open files

Backtrace (most recent call first):
  File "rust:library/core/src/option.rs", line 1268, in core::option::expect_none_failed
  File "<unknown>", line 0, in tickrs_api::client::Client::new
  File "<unknown>", line 0, in tickrs::task::AsyncTask::connect
  File "<unknown>", line 0, in tickrs::event::handle_keys_display_summary
  File "<unknown>", line 0, in tickrs::main
  File "<unknown>", line 0, in std::sys_common::backtrace::__rust_begin_short_backtrace
  File "<unknown>", line 0, in std::rt::lang_start::{{closure}}
  File "rust:library/core/src/ops/function.rs", line 259, in core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once
  File "rust:library/std/src/panicking.rs", line 379, in std::panicking::try::do_call
  File "rust:library/std/src/panicking.rs", line 343, in std::panicking::try
  File "rust:library/std/src/panic.rs", line 396, in std::panic::catch_unwind
  File "rust:library/std/src/rt.rs", line 51, in std::rt::lang_start_internal
  File "<unknown>", line 0, in main
  File "<unknown>", line 0, in __libc_start_main
  File "<unknown>", line 0, in _start

The application panicked (crashed).
  called `Result::unwrap()` on an `Err` value: Io(Os { code: 24, kind: Other, message: "Too many open files" })
in /tickrs-api-0.9.0/src/client.rs, line 193
thread: main

Hard crash when scrolling through the options list (index out of bounds)

I just hit a hard crash when scrolling through the options list (just using the down arrow to go through the list of dates).

Here is the backtrace - hope it helps. Let me know if you need more information.

$ env RUST_BACKTRACE=full tickrs
Backtrace (most recent call first):
  File "<unknown>", line 0, in <tickrs::widget::options::OptionsWidget as tui::widgets::StatefulWidget>::render
  File "<unknown>", line 0, in tickrs::draw::draw_main
  File "<unknown>", line 0, in tui::terminal::Terminal<B>::draw
  File "<unknown>", line 0, in tickrs::main
  File "<unknown>", line 0, in std::rt::lang_start::{{closure}}
  File "rust:src/libstd/rt.rs", line 52, in std::rt::lang_start_internal::{{closure}}
  File "rust:src/libstd/panicking.rs", line 297, in std::panicking::try::do_call
  File "rust:src/libstd/panicking.rs", line 274, in std::panicking::try
  File "rust:src/libstd/panic.rs", line 394, in std::panic::catch_unwind
  File "rust:src/libstd/rt.rs", line 51, in std::rt::lang_start_internal
  File "<unknown>", line 0, in main
  File "<unknown>", line 0, in __libc_start_main
  File "<unknown>", line 0, in _start

The application panicked (crashed).
  index out of bounds: the len is 0 but the index is 0
in src/widget/options.rs, line 386
thread: main

Futures

Are futures symbols supported? This may be a case of me just not entering the symbols correctly, but I can't seem to figure it out. I know Yahoo! does expose the futures here (https://finance.yahoo.com/commodities/). Taking the S&P ES as an example, (https://finance.yahoo.com/quote/ES%3DF?p=ES%3DF), I've tried variations on the symbol... (ES, ES=F, ES=F?,ES=F?,ES=F?p) to no avail.

(Also - Very cool tool that you've developed! I was looking to do something vaguely similar in Python until I came across this).

Thanks!

Show x-axis time labels in charts

Hey hey, this is a neat little tool - good stuff! ๐Ÿ™‡

It would be immensly helpful to show not only the y-axis labels but also the x-axis time labels; this would make it much more useful.

Deleted release?

A few hours ago I saw tickrs has a new release (0.14.5) and for that reason I updated the Arch Linux package. Now I see that release is gone from the repository. Is everything okay?

PM/AH data on Yahoo not displaying

The price data and volume still appear from yesterday and the 1D chart is blank until trading hours starts. This may be a limitation of Yahoo's API or data source since their webpages https://finance.yahoo.com/quote/<ticker> have most of the same problems.

shift+tab not working

After the latest dependency update #68, shift+tab no longer works.

With the SHOW_DEBUG=1 env

v0.11.0

DebugInfo { ..., last_event: Some(Key(KeyEvent { code: BackTab, modifiers: NONE })), mode: DisplayStock }

#68

DebugInfo { ..., last_event: Some(Key(KeyEvent { code: BackTab, modifiers: SHIFT })), mode: DisplayStock }

This was changed in crossterm #490 and merged into master at https://github.com/crossterm-rs/crossterm/blob/423895e9523e8cfbd01c46f222c711c3a83bd784/src/event/sys/unix/parse.rs#L140

Candlesticks not displayed

Candlesticks are not displayed as in the demo gif.

I'm running ARCH on WSL2 inside alacrity terminal. Any idea why?

image

Blank screen on market closed

I am not sure if this issue is just me or for everyone, but when the market is closed running a command like:

tickrs -s AAPL 

Results in a blank screen. It would be better to show the activity before market close or to just show a splash screen saying that the market is closed.

Again, this could potentially be a bug isolated to me.

Cache data between time range view changes

Hey hey ๐Ÿ‘‹

It looks like we're fetching data every time we change the time range plots.

On slow connections this leads to lag when users switch to a different time resolution and then back e.g. between 1D -> 1W -> 1D.

It looks like we already cache the data between tickets, since tab-ing through them draws the plots instantly.

Don't redraw unless new data received over API

@daniel-j-h I've already merged the user update interval feature and as I mentioned, this doesn't affect redrawing, only when to fetch API data.

Right now I have the app re-draw on a fixed 1 second cycle. In addition, user input causing changes will trigger the app to re-draw. If I can add a mechanism that tells the app to redraw whenever new API data is received, I can ditch the fixed update interval and the entire app will be reactive to when changes occur. Which will be awesome because it'll even further reduce CPU usage, especially when a long interval is specified by the user.

I have an idea on how to implement this, I'll get to it sometime later today!

Crash with --time-frame 1D outside of trading hours

tickrs hangs when time-frame is set to 1D when started before a certain time (maybe before trading start on NYSE?).
To mitigate this, i can start with -t 1W, but as soon as i change to 1D inside the application, it also hangs.

Can reproduce this on Linux Arch with alacritty terminal as well as WSL2 (Ubuntu) on Windows Terminal.
My timezone is GMT+1 (Berlin).
At the time of filing this issue (8:20 GMT) the crash occurs. I observed the same yesterday morning.
Later in the day, everything works as expected.

Sometimes no data points shown except high / low

Hey hey ๐Ÿ‘‹ It seems like sometimes we can not get any data points other than high / low.

Is this caused by the API? Can this be solved with retries? Should we show a spinner โ™ป๏ธ or something indicating that we're in the process of fetching the data?

nodata

Unable to track U.S. Dollar Index

I'm unable to add USDX (Yahoo! Finance quote DX-Y.NYB) under symbols. I've added it under symbols like so:

symbols:
    - BTC-USD
    - ETH-USD
    - ADA-USD
    - LINK-USD
    - BTC-ETH
    - DX-Y.NYB

and the graph seems to be stuck loading the graph. If indexes are supposed to be added differently it isn't made clear by the documentation.

image

Thanks! - Gustav

Theme: background isn't applied everywhere

Just tried the background theming option for the first time

~/.config/tickrs/config.yml
theme:
  background: '#403E41'
line candle
summary of 1 Screenshot_20210220_191115 Screenshot_20210220_190458
summary of 3 Screenshot_20210220_191301 Screenshot_20210220_190139
stock view Screenshot_20210220_191435 Screenshot_20210220_190300

1H graph

Hi there, is there any chance we could get an hourly graph? Love tickrs, thanks!

Crashes when window resizes to smallest possible size

Backtrace omitted. Run with RUST_BACKTRACE=1 to display it.
Run with RUST_BACKTRACE=full to include source snippets.

The application panicked (crashed).
index out of bounds: the len is 62 but the index is 109
in /home/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/tui-0.9.5/src/buffer.rs, line 213

Backtrace omitted. Run with RUST_BACKTRACE=1 to display it.
Run with RUST_BACKTRACE=full to include source snippets.

The application panicked (crashed).
called Result::unwrap() on an Err value: "PoisonError { inner: .. }"
in src/main.rs, line 139
thread: main

Easy to replicate on my KDE neon, run ./tickrs, resize window to the smallest size possible. Maybe a check for unwrap as it doesn't seem to work if the console window is small. (probably 0x0 since only the edges are visible)

And I do mean smallest possible size:
image

Feature: Blink end of line

For volatile stocks, the end of the line can be multiple dots stacked on each other, which makes it hard to tell which point is the last point. It would be great if the last dot blinked or was a different color.

image

Background color issues

@daniel-j-h I noticed in your screenshots that there was weird coloring going on in places with the background. I've found the issue and will be fixing it, see my before and after.

image

image

Consistent OOMing at 5AM UTC

I'm running three instances of tickrs in a persistent tmux session. After noticing issues on my machine at 5AM a few days in a row (pretty much a complete crash this morning), I checked journalctl:

Feb 10 06:02:20 kernel: Tasks state (memory values in pages):
Feb 10 06:02:20 kernel: [ pid ] uid tgid total_vm rss pgtables_bytes swapents oom_score_adj name
Feb 10 06:02:20 kernel: [2275268] 0 2275268 2001555 705854 9302016 421501 0 tickrs
Feb 10 06:02:20 kernel: [2275331] 0 2275331 2149014 730901 9654272 434922 0 tickrs
Feb 10 06:02:20 kernel: [2275401] 0 2275401 2050708 707631 9764864 475771 0 tickrs

They got killed in cascade over the next ten minutes, so I figure it leaks fast.

Disable MouseCapture

As at the moment of writing, (4ba57c0), tickrs always captures the mouse despite only needing to show cursor location in the debug information.

Only, this debug information only shows with the SHOW_DEBUG=1 env set

This effectively disallows all forms of text selection within tickrs whether in/out of debug mode.

Unless we can selectively enable capturing the mouse for certain parts of the interface (maybe on the graphs for future purposes), we probably shouldn't at all since we aren't actually using it.

At this point you can't actually "copy" debug information, you would have to manually retype it.

Stock prices beyond two decimal places

Great tool, I instantly loved it.

I have OTC penny stocks, which often are represented to 4 decimal places.

tickrs rounds all the prices to two places, (it seems) so the data and charts a little less-than-compelling.

Screen Shot 2021-04-29 at 3 28 47 PM

Would it be possible to support more decimal places, perhaps as a config options (even per symbol would be awesome!)

Provide option to hide the toggle shortcuts

Hey hey ๐Ÿ‘‹ At the moment we always show the "Toggle" shortcuts on the top right.

There is an option to not show the help, but there is no option to hide this toggle menu. For non-interactive use-cases like running on a raspberry pi with a small display attached, but no keyboard, it would be great if we could hide the toggle shortcuts.

Maybe --hide-help could just remove these, too?

Provide command line option to change refresh interval

Hey hey ๐Ÿ‘‹

it would be great to have an option like -n, --interval or something like that (similar to watch?) so we can change the data update interval. When we only want to show e.g. the 5Y data, it makes no sense to request new data every few seconds and re-draw it.

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.