Looking for help with a newbie question. The attached algo works fine as long as I use the following:
.order_by(fundamentals.valuation.market_cap.desc())
However, if I change it order by either market cap "ascending" or ROE "ascending" (see below)
.order_by(fundamentals.valuation.market_cap.asc())
or
.order_by(fundamentals.operation_ratios.roe.asc())
I get the following error:
TypeError: 'float' object is not iterable
...
USER ALGORITHM:34, in trade
shorts = ranks[ranks <= lower]
Can anyone tell me what's causing this and how to correct it? I'm guessing it's trying to combine values from different data types but am still new to Python and would appreciate help with this.
Thanks.
Troy