First off, Welcome to Quantopian.
What you are asking is exactly what a typical algorithm does. One would first define the 'universe' of securities to trade within. This is typically decided by constraints on liquidity, type of security (ie only stocks and no ETFs), or some knowledge that a strategy performs well only on a specific group of securities (eg only works well on a specific sector). One can also set specific securities (eg AAPL IBM) but this has the inherent drawback of potential lookahead bias (why choose AAPL? Would we have chosen that stock 10 years ago when we start our backtest?) The 'universe' is typically defined in the pipeline and then set as a screen on the pipeline so only securities in the universe are returned.
The pipeline pulls together all the data one needs for their strategy. Rules can then be developed which use this data to determine what to buy and sell. One task which wasn't alluded to in the original post was how much to buy. Determining the weighting of stocks can be quite complex. If today we buy 10 stocks and tomorrow we buy 20 stocks, what should the algo do if there isn't enough money left in the portfolio to buy those stocks. The Quantopian platform will let you 'borrow' as much money as you wish. However, that won't match real life. The logic should rebalance existing positions to free up money for these new stocks or, alternately, cap the new stocks to only buy when there is a positive account balance.
Attached is a simple algo which is a start to what you are looking to do. Do take a look at the tutorials (https://www.quantopian.com/tutorials) especially part 2 on pipeline. That may give some better direction.
Good luck.
Disclaimer
The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by Quantopian. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. No information contained herein should be regarded as a suggestion to engage in or refrain from any investment-related course of action as none of Quantopian nor any of its affiliates is undertaking to provide investment advice, act as an adviser to any plan or entity subject to the Employee Retirement Income Security Act of 1974, as amended, individual retirement account or individual retirement annuity, or give advice in a fiduciary capacity with respect to the materials presented herein. If you are an individual retirement or other investor, contact your financial advisor or other fiduciary unrelated to Quantopian about whether any given investment idea, strategy, product or service described herein may be appropriate for your circumstances. All investments involve risk, including loss of principal. Quantopian makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances.