Workflow for getting only one strongest buy signal for portfolio per day in Scan

I am trading bigger portfolio of stock and limit number of positions that I open every day (let say to one). I have no problem to backtest this rules wit custom backtester.

This system trades on open of Daily bars.

I would like now to setup Scan that will:

  1. Scan all the symbols in portfolio after the close for Buy signals but select only ONE per day based on position score (same as done in custom backtester).
  2. Track what positions are opened from previous scans and scans for SELL signals (for open positions only).
  3. I would like to generate BUY and SELL signals for following day perhaps to some txt file.

Can you please hint me how to setup this workflowflow? How to for example limit number of signals in scan output based on position score?

Thank you.

I am looking for something else, came across your problem statement. so thought of giving you a way out.
you have to use a For loop to iterate through all symbol in X watchlist and identify the possible filtered stocks, rank them and add the highest rank stock in another Y watchlist and also add the symbol having open position.
This For Loop should run only when passing through 1st symbol otherwise it will slow up the code. So your Y watchlist is having only 1 new symbol and symbols with open position.
Run the default scan on Y watchlist.
It will give exit results for open trades and entry results for new filtered symbol.