Skip to content

Gamers-Blended/PythonForFinance

Repository files navigation

PythonFinance-WebScrap

With reference from https://www.youtube.com/playlist?list=PLQVvvaa0QuDcOdF96TBtRtuQksErCEBYZ

Python for Finance

1: Plotting of Individual Stocks
This file retrieves stock prices of a specific ticker (to be chosen by the user) from Yahoo Finance API, then stores them in a newly created CSV file.
It then plots a candlestick graph of the adjusted closing price of the selected stock.
TSLA is the default ticker.
A different stock can be selected by changing the ticker name in the web.DataReader() function.

2: Web Scrap & Visualisation
A program used to scrap data from tables in websites and convert them into CSV file.
It then visualises the data from the CSV file as a correlation heatmap.
By default, data is scrapped from the S&P500 Wikipedia page.

3: Preprocessing Data for Machine Learning
Uses the CSV file generated from Web Scrap & Visualisation.py and votes buy/sell/hold decision through 3 classifiers:

  1. svm.LinearSVC()
  2. neighbors.KNeighborsClassifier()
  3. RandomForestClassifier()

Results:

Voting labels:

  • 1 -> buy
  • -1 -> sell
  • 0 -> hold

BAC is the default ticker.

About

A collection of Python files for finance

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages