Hey guys,
I have a question regarding a long only algorithm I am building.
I have noticed, that apparently the algorithm accumulates positions, since the number of positions increases gradually and after a while there are more open positions than stocks in the pipeline. I have tried to close the positions manually but this also does not work, since I get the following error when I try to order_target_percent(stock,0) for eachstock in context.portfolio.positions: stock = eachstock.symbol
Error
non-string argument given to symbol()
Does anyone know why positions are being accumulated and i have more positions than output from my pipeline and how to solve it ? Thanks a lot and have a nice day