Hi everyone!Here is my assignment from my seminar. I am supposed to calculate the weight of the stock according to the rank. The formula should be:1/(the rank of a stock)/sum(1/the rank of a stock); for example: there are three stocks, the rank of every stock should be 2,5,7,so the weight of the first stock will be 1/2/(1/2+1/5+1/7)=0.59322034.
As a beginner in python and quantopian, I spend a lot of time in finding the code .
Can somebody help me out?
Thank you in advance!:)