I'm trying to close out a position on a security if it's in my positions but not in a separate list of securities I'm maintaining. However, I can only get the sid from the positions, and I can't get the sid from the list of securities. I tried using the sid() function, like everyone else it looks like, only to find out that the parameter must be a literal. Is there a way to get the actual security from the list of positions? That would be the easiest way. I could probably make do with being able to get the sid of a given security, though that feels like the long way around in this case.