Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
RSI Signal for largest securities

Hello,

I am trying to write code to purchase oversold securities and sell short overbought securities with the criteria:
1. Largest 1500 securities (do not want to include small biotechs with offerings)
2. Set standard trading cost

I have the following attached code, however it only works for the spy itself, and not any other universe. Also I believe the code only sells the spy, not sells short it.

Any help is greatly appreciated!