I'm new to QuantConnect and still trying to figure out how things work here.  I use to do a bit of research on Portfolio123 that involved backtesting fundamentals using their screening tool.  I was hoping the friendly folks here could get me started in building a Python script that would essentially do the same thing here.

My old backtest involved the following:

  • Benchmark to the S&P 500 Equal Weight index
  • Eliminate OTC stocks
  • Eliminate ADRs
  • Exclude the financial sector
  • Eliminate stocks with average daily trading volume under $100,000
  • Market Capitalization greater than 50 million
  • Closing price greater than $1
  • Fundamental (such as PE) not missing
  • Rank stocks by PE and select those that are in the best 20th percentile (lowest 20% PE in this example)
  • Ideally, rebalance the portfolio every 52-weeks
  • Test from 1998 to 2020
I appreciate any help you can provide in making something like this happen using the Python script. Thanks!