Hi,
The gist of the competition is to come up with your own logic of how to combine stocks so that your strategy outperforms the S&P 500 index. A systematic portfolio is a portfolio that rebalances its components based on rules (you need to define them) so that it adapts to market conditions in the future (not only in the past - that’s called over-fitting, and that has no value when it comes to investing in the future). In a nutshell, you have to create your own portfolio not replicate an existing portfolio.
In order to test your portfolio, we will compute its returns and risk profile over undisclosed period(s) to check whether it does well on unseen data or if you have just fitted the data you had at your disposal (2006-12-31 to 2017-12-31).
By trying to replicate xlk, you introduce a high bias to your portfolio, excluding all sectors but one. If an event like the burst of the dot-com bubble in 2001 happens again, your portfolio will suffer massive draw downs (NASDAQ fell 78% back then). Usually, practitioners favour a diversification approach to portfolios rather than putting all eggs into one basket.
That being said, you can obviously use sectorial information to try to switch to riskier sectors (high beta) when the market is bull and to more defensive sectors (low beta) when the market becomes more risky. The function getTickersSP500 has an industry code column. Read about GICS sectors to understand how the code works and how to extract valuable information from them.
Hope this helps