Bruno21 d381eb8043 Rename stocks.sh to stocks_legacy
as stocks.sh no longer work (API finance Yahoo HS)
2025-01-13 20:32:43 +01:00
2021-04-20 13:36:15 +02:00
2024-01-09 18:27:02 +01:00
2024-01-09 18:27:02 +01:00
2021-04-20 07:49:01 +02:00
2021-04-18 14:16:23 +02:00

stocks.sh

Real-time stock tickers from the command-line.

stocks.sh is a simple shell script using the Yahoo Finance API as a data source. It features colored output and is able to display pre- and post-market prices (denoted with *).

Based from ticker.sh

stocks.sh

Install

$ curl -o ticker.sh https://raw.githubusercontent.com/pstadler/ticker.sh/master/ticker.sh

Requirements

  • jq, a versatile command-line JSON processor.
  • yq, a versatile command-line YAML processor.

Usage

Preferences:

# Preference file:
$ nano ~/.stocks.yaml

watchlist:
  - ^FCHI
  - AC.PA
  - ALCLS.PA
  - ATO.PA
  - AUB.PA
  - CS.PA
  - DG.PA
  - ORA.PA
  - VIRP.PA
  - WLN.PA
lots:
  - symbol: "AUB.PA"
    quantity: 600
    unit_cost: 32.164
  - symbol: "ORA.PA"
    quantity: 700
    unit_cost: 9.426


Running:

# Single symbol:
$ ./ticker.sh AAPL

# Multiple symbols:
$ ./ticker.sh AAPL MSFT GOOG BTC-USD

# Run stocks.sh:
$ ./stocks.sh


# Update every five seconds:
$ watch -n 5 -t -c ./ticker.sh AAPL MSFT GOOG BTC-USD
# Or if `watch` is not available:
$ while true; do clear; ./ticker.sh; sleep 5; done
# Or
./run_stocks.sh
Description
No description provided
Readme 118 KiB
Languages
Shell 100%