Pipeline only has access to yesterdays pricing and data (as of 'before_trading_start'), so no, you cannot incorporate the current price directly into a CustomFactor.
However, you can easily get the current prices of all securities returned by your pipe by using the 'data.current' method. It accepts a list as well as a single security. The index of the pipeline output is just such a list of securities. No need to get 'all 8000+' securities. I like to then store those current prices in the same dataframe as the other pipeline outputs so everything is in one neat place. Something like this...
def before_trading_start(context, data):
# Get a dataframe of our pipe data.
context.output = pipeline_output('my_pipe')
def enter_buy_sell_orders(context, data):
# Get the current prices for all stocks returned by our pipe (ie context.output.index)
# Add those prices as a new column named 'current_price' in 'context.data'
context.output['current_price'] = data.current(context.output.index, 'price')
# Do any logic you wish on any of the columns in the pipe dataframe output
stocks_to_buy = context.output.query('current_price < yesterday_close').head(TARGET_STOCKS).index
See attached algorithm. Good luck.