Set of CLI tools for working with stock market data.
Some tools require access to gatewayed APIs. Credentials should be added to inc/config.h
after running make config
(and inspecting the source code of this whole codebase prior, of course).
This CLI tool is capable of scraping general stock market ticker data from various web resources. It generates CSV files that can later be used by other tools in the suite.
NYSE
,NASDAQ
(via finviz.com)OTCQB
,OTCQX
,Pink sheets
(via otcmarkets.com)
libcsv
, libcurl
, libtidy
make -j ticker-scraper
bin/ticker-scraper NASDAQ > nasdaq-and-pink.csv
bin/ticker-scraper --no-csv-header Pink >> nasdaq-and-pink.csv
bin/ticker-scraper US OTC > us-and-otc-stocks.csv
"marketplace","ticker","company","price","sector","industry","country","marketcap"
"NASDAQ","A","Agilent Technologies, Inc.","173.94","Healthcare","Diagnostics & Research","USA","52.46B"
"NASDAQ","AA","Alcoa Corporation","48.83","Basic Materials","Aluminum","USA","9.23B"
"NASDAQ","AAAU","Goldman Sachs Physical Gold ETF","17.42","Financial","Exchange Traded Fund","USA","-"
"NASDAQ","AAC","Ares Acquisition Corporation","9.74","Financial","Shell Companies","USA","1.22B"
Historical stock market data scraper. Obtains OHLC records and saves them to disk (one JSON file per ticker).
The input is CSV files in the same format as the one that gets produced by ticker-scraper
(Tool #1).
- TD Ameritrade developer.tdameritrade.com (requires API key)
libcsv
, libcurl
, libjson-c
make config
put your TD Ameritrade API key into inc/config.h
make -j historical-data-scraper
bin/historical-data-scraper --min-price=0.1 --max-price=7.5 -o data/historical/ nasdaq-and-pink.csv
{
"candles": [
{
"open": 25.5,
"high": 26.8485,
"low": 25.5,
"close": 26.1,
"volume": 2291,
"datetime": 1475470800000
}
],
"symbol": "EYEG",
"empty": false,
"marketplace": "NASDAQ",
"company_name": "EyeGate Pharmaceuticals, Inc.",
"country": "USA",
"sector": "Healthcare",
"industry": "Biotechnology"
}
CLI tool for creating chart images out of historical stock market data generated by historical-data-scraper
(Tool #2).
libcairo2
, libjson-c
make -j chart-generator
bin/chart-generator -o data/charts data/historical/*