Actually, the code cited above (and reproduced below)
CODE:
Please log in to see this code.
... will work because the same indicator is used in all cases, so the values returned by these indicator instances are compatible. But if the indicators are different, then you have a problem. For example, if indicator RSI is ten times the value range of indicator ROC, then ROC will
always be under represented in listComposite[index].val. So you can't simply add values of different indicators up to get a composite rank; that won't work.
But what you can do is add their ranks (or ranking indexers) up to get a composite rank. I've given a solution below, but it has problems. IndicatorHolder needs to be enhanced to take parameters (which is easy to fix). But you also need to define a Predicate delegate before the list.Find(<IndicatorHolder>Predicate) method will function. Other than that, this is what I have:
CODE:
Please log in to see this code.
One other thing. You don't need separate list element types for all three of these List<...>s. Instead, define a
single IndicatorHolder class, then create three separate instances of List<IndicatorHolder> for listComposite, listRSI, and listROC from that single type. Keep it simple (but not too simple).