For code/output blocks: Use ``` (aka backtick or grave accent) in a single line before and after the block. See:

Number of open positions

  • Hello,

    Is there a way to get the number of all the open positions without looping through all the data to find if self.getposition(d) has a size > 0?


  • found it:


    I needed it in Sizer

  • After debugging I found the positions in are not only the ones with positive size so I'm back to looping. To get the nuber of open positions inside a Sizer I am using a list comprehension:

    open_positions = len([position for position in if > 0])

    anyone can suggest a better solution?

Log in to reply