I need someone to code the following rules into python for use on the quantopian platform
Begin with 13 predetermined ETFS
-Trade Monthly (with limits)
-At end of month Calculate the average of the 1, 3, 6, and 12 month returns for each etf.
-Invest in the funds with the top 6 highest averages, if current price is greater then SMA200 (200 day simple moving average), otherwise hold cash for that portion.
This portfolio takes 13 ETFs and ranks then by the average of the return over the last 1, 3, 6, and 12 months. Then an equal weighted portfolio of the top 6 ranked asset classes is formed. The asset classes are only included if they are above their 200-day SMA. Otherwise, that portion of the portfolio stays in cash. This trades and re-balances monthly.