An example based on the Malaysian stock market.

There are dozens of amazing stock screener apps and sites out there like TradingView. However, most sites do not offer as much customization as you want, if you don’t pay for it.

Image for post

For example, in TradingView you can easily find stocks with the last price above certain moving averages (MAs) but you are limited to the pre-defined 5, 10, 20, 30, 50, 100, and 200-day MA.

Image for post

The same applies to MQTrader, another popular screener used by Malaysian traders.

The good news is, with a few lines of Python code, you can make your own customized simple stock screener, and I am here to show you how.

If you haven’t set up Python on your computer yet, click here for the setup tutorial. If you’re totally new to Python I strongly recommend using Jupyter Notebook or Google Colab to get you started.

Step 1: Get stock prices

First things first, we need stock prices. There are, again, many great free APIs out there that allow you to access the stock prices using literally two lines of code.

import yfinance as yf
yf.Ticker("AAPL").history(start="2021-01-11", end="2021-01-15")

#python #stock-screener

Build your Own Technical Analysis Stock Screener using Python
32.90 GEEK