|
Jeff D
2014-01-15 17:45:07
|
|
I'll continue here comments from the blog:
You suggested this code to add a second parameter with weights to rank and trade:
// This will calculate percentile (0 - 100) - The higher the better
res = comp(value1, "percentile", 1, filter1) * weight1 + comp(value2, "percentile", 1, filter1) * weight2;
// Then calculate ranking
res = comp(res, "rank", 1, filter1);
The question I have is, how do I reverse the percentile rank of value2, i.e. value1 is ranked smallest to highest where the highest value is ranked 1, while I wanted to rank highest to lowest value2 where the lowest value is ranked 1.
The reason for this is that I want to use Sttdev as the parameter for value2 and I;m interested in a lower volatility stock being ranked higher than a high volatility stock.
Thanks.
|
|