Skip to content

Useful snippets of code for acquiring and analyzing stock market data.

License

Notifications You must be signed in to change notification settings

tt-digital/stockmarket

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

stock market

Useful snippets of code for acquiring and analyzing stock market data.

ticker.py

Usage:

Put the stock market symbols as arguments for ticker.py in the command line.

$ python3.8 ticker.py BHG.ST AAPL GOOG EURUSD=X ^GDAXI 1810.HK

Sample Output:

alt text

Data Source:

Data queries will be made to https://finance.yahoo.com/.

history.py

What it does:

Fetches historical stock market data through yfinance (https://pypi.org/project/yfinance/) and plots them utilizing mplfinance (https://pypi.org/project/mplfinance/) including moving average and traded volume. Also saves a csv with the data in the same folder as the script.

Usage:

Edit variables in the file to your liking and simply run the script:

$ python3.8 history.py

Sample Output:

alt text