Stock Trading Analysis with Python

The Stock trading analysis with Python is a course to teach students to write python algorithms to quantify the trading discipline and identify opportunities.

Stock trading using algorithm brings us several advantages. It allows traders to backtest their trading strategies before putting them to work, evaluating and customizing a wide range of stocks against multiple indicators is feasible which cannot be done using off-shelf software. And the biggest advantage is to help traders make objective decisions as they are governed by a set of well tested rules and not by human emotion from the markets.

Python is one of the best computer languages in developing Fintech products. We will use it throughout the course. After completing the course, students can write codes to download historical stock data from internet, save time by scraping trade information from other websites, calculate technical indicators, back test trading strategies, evaluate strategies performance, calculate return, plot stock data against different technical indicators ( such as MA, RSI and MACD ) and placing real trade order to the brokerage firmsl.

Those people who are interested in stock trading and want to trade realtime using algorithm will find the course useful.

What you’ll learn


  • Python and python's libraries installation
  • Understanding python's data structure
  • Strings operation
  • Using tuple, list and dictionary
  • Read / write text files
  • Using date/time related functions
  • Date and time format conversion
  • Slicing and merging data
  • Automate the repetitive work using loop
  • Streamlining coding using by defining your own functions
  • Using python's libraries

Working with historical data

  • Downloading the historical data for a single stock
  • Downloading the historical data for multiple stocks
  • Notes on batch downloading
  • Working and saving the downloaded data

Technical analysis indicators calculation

  • Calculating the SMA and EMA
  • Calculating the RSI
  • Calculating the Bollinger Bands
  • Calculating the MACD

Stock Charts

  • Matplotlib drawing library
  • Plotting the stock price with volume
  • Plotting the stock price together with MA + RSI

Backtesting trading strategies

  • Formulating your trading strategies
  • Constructing backtesting workflow
  • Generating trading signals
  • Backtesting cross over trading strategy
  • Backtesting MA + RSI
  • Backtesting MACD

Strategies evaluation

  • Return calculation with buy and hold strategy
  • Return calculation with no trading cost
  • Return calculation with trading cost
  • Evaluating strategies performance

PYS1083 - 廣東話 10 Aug enrol
PYS1094 - 廣東話 16 Sep enrol
PYS1101 - 廣東話 20 Oct enrol
PYS1111 - 廣東話 13 Nov enrol
  Beginning Data Science with Python
  Python for Data Analysis
  Python Programming

Stocks selection and web scraping

  • The power of web scraping in data analysis
  • Understanding webpage structures
  • Locating the cut-in point
  • Scraping data with codes
  • Transformating the data and saving the result
  • Project 1 : scraping the daily top gaining stocks
  • Project 2 : selecting stocks by TA indicators

Algorithm Trading using Futu's API

  • What's API
  • Futu's API installation
  • Getting the real time stocks data
  • Placing, editing and cancelling trade orders
  • Getting deals information
  • Putting your trade algorithm by simulation