Dear all,

I have done some search on existing posts in the Forum and try to leverage those to build pre-market volume filter to get stocks that has RVOL > certain threshold before market opens.

I have tried attempted the attached backtest based on these reference links below:

  • Volume filter for first 30 min of data: 
  • Pre Market settings

My questions:

  • According to the log, Data did get pumped into OnData in Extended hours, but volume traded for SPY does not change (say from 2020-01-22 05:00 - 2020-01-22 08:00, every print statement printed the same volume after each hour, indicating that there is no incremental volume traded. It is not the expected result)
  • I have set the time for scheduled event to 9:30am market open, and based on the SelectUniverse method, sort through stocks that has volume > 10 now to further narrow down the universe from coarse filter. The volume before 9:30am for these stocks are zero based on the log. While I expect the volume to be non-zero (the pre-market volume traded). How could I fix the code to achieve the expected result?
  • I am trying to filter the universe based on RVOL instead of volume > 10. Is there a way that I can incorporate a simple moving average for daily volume for the past 10 days and then compute the RVOL in SelectUniverse? I have tried to look into various posts and still struggling to do that.

Many thanks in advance for any pointers.

Author