I want to try a strategy like based on ranking on SP500 with a particular stats like trailing sharpe ratio, monthly gain and select 10 from SP500 holds for like three monthes with equal money. And rebalance every three monthes. Is there any example code available like this?