Day traders guide to stock selection using python

Ankit Malik
Stocks & Stats
Published in
2 min readJul 17, 2020

A simple guide to volatility based stock selection from Nifty50 with python implementation

Photo by M. B. M. on Unsplash

Lockdown due to COVID-19 although was frustrating but opened up avenues to practice something new. My new was trading. Looking at top gainers and losers after market hours and analysing charts to compute maximum possible earnings I could have, fascinated me.

I learnt technical analysis, made a lot of mistakes one of which was trading when market is sideways or in less volatile stocks. When stock prices don’t fluctuate we can’t make money (buy on low, sell or high).

For a day trader, trading is a four step process:

  1. Select a list of volatile stocks
  2. Pick stocks where technical indicators show a Buy or Sell signal
  3. Entry strategy
  4. Exit strategy (Stop loss or take profit)

But when we talk about intraday, it’s a matter of minute(s) if not seconds, and if we go through all these steps in real time we won’t be able to maximise our profit potential.

What if I told you, we can narrow down on a list of stocks a day before we trade? Here is what we do: We choose let’s say the top 20 volatile stocks and add them to our watchlist. We can now reject stocks which do not fit our indicators.

Let me show you with an example of stocks from Nifty (Index of National Stock Exchange — India).

source: www1.nseindia.com

Manual way is to:

  1. Go to the NSE India website and download the list of volatile stocks.
  2. Filter out Nifty top 100 stocks (top 100 stocks by market cap) from the list.
  3. Select top 20 or stocks above a volatility threshold.

Let’s do this using a simple python program:

The above code gets the most volatile stocks from NSE, joins the list with Nifty 100 and applies a threshold on daily volatility. In this case I have applied a 3% cutoff. Markets are mad these days!

And what we get here:

Mouthwatering list of potential money makers! Now use your analysis and earn big.

Thanks for reading. Stay tuned for more!

--

--