Giter Club home page Giter Club logo

tstock's Introduction

tstock - Check stocks from the terminal! ๐Ÿš€๐Ÿš€๐Ÿš€

๐Ÿ“ˆ tstock is a tool to easily generate stock charts from the command line.

Just type tstock aapl to get a 3 month candlestick chart of $AAPL in your terminal!

tstockex

Features

  • Stocks for most global exchanges
  • Support for major cryptocurrencies
  • Different time intervals, including intraday trading
  • "Wisdom"?!

Dependencies

  • Python 3.6 or greater

Installation

AUR

tstock is available on the AUR. If you are on an Archlinux system, you can just install it using your AUR helper. Example using yay:

yay -S tstock

PyPI

tstock is also available as a Python package. You can install it using pip:

pip install tstock

Getting started

AlphaVantage API setup

After installing tstock, you will need a AlphaVantage API key to pull the market data.

  • Make a free AlphaVantage API account at https://www.alphavantage.co/support/#api-key
  • After creating the account, you will see your free API key
  • Run export ALPHAVANTAGE_API_KEY=<your access key>. You can make this permanent by adding this line to your .bashrc

Usage

tstock aapl # chart of $AAPL
tstock aapl -t 1min # the past 70 1-minute-intervals of $AAPL
tstock aapl -t 60min -b 24 # the past 24 60-minute-intervals (aka past day) of $AAPL
tstock aapl -t 60min -b 24 -y 20 # same as above, but only 20 lines high
tstock btc -a crypto # chart of the cryptocurrency $BTC
tstock btc -a crypto -c GBP # same as above, but in currency GBP
tstock btc -a crypto -c EUR -s # print only the last price of $BTC in EUR

Run tstock TICKER to get the 70 day chart of $TICKER. Use -b COUNT to specify the number of days back you want to pull. -t INTERVAL will specify the time interval of each candlestick. Use -y LINES to specify the length of the chart's y axis.

To get cryptocurrencies, use the -a crypto option. For example, tstock -a crypto BTC would fetch a price chart of Bitcoin.

For more options, run tstock -h

You can get international markets by specifying a code after .. For example, to get SAIC Motor Corporation on the Shanghai Stock Exchange, run tstock 600104.SHH. Find more information on how to specify special tickers on AlphaVantage's docs: https://www.alphavantage.co/documentation

Notes

  • The free tier of the API is limited to 500 API calls per day, 5 calls per minute.

Donate

I develop tstock for free in my spare time. If you like it, and want to by me a coffee, I'd really appreciate it.

Bitcoin: (QR) bc1qusuztegpfuh7jk25l2dx5xyjvasgryrqg42d5n

Monero: (QR) 87wuCKbbchKV8Dz3JRoSN3jaqWBSiEShFXkFrYUaKT8Bew4P7dFvUJWVVR6RLr84J44QCdtNVyR6QC7aCSKYUWfnGK9y4K2

tstock's People

Contributors

gbox4 avatar

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.