I am trying to create an algorithm where I iterate through the top 10% of all traded stocks and buy the one with least volatility and short the one with most. I have taken care of writing the algorithm. My problem is that I am having trouble iterating through each stock. When I iterate through the stocks, I do not get the correct ticker symbol to place a trade. Can someone help me? I have attached my code.