ticker-tape/README.md
2026-06-16 09:33:46 -04:00

20 lines
723 B
Markdown

# Ticker Tape
To download a list of trades from a specific day from Alpaca, make an account on https://alpaca.markets/ and set APCA_API_KEY_ID and APCA_API_SECRET_KEY environment variables.
Then use `ticker_tape.py` to download and then sort them:
```
python ticker_tape.py --symbol-file sp100_symbols.txt --start 2026-06-12 --raw > trades_unsorted.csv
sort -t, -k1 trades_unsorted.csv > trades_sorted.csv
```
To generate ESC/POS commands for the receipt printer use `print_tape.py`:
```
uv run python print_tape.py -o ticker_tape.escpos trades_sorted.csv
```
Defaults to 10,000 trades per escpos file, cutting the receipt paper every 1000 stocks.
1000 trades translates into about roughly 10 feet of receipt paper.