Hey y'all! Love the community here, as a beginner to Python, I've taken a lot in and am learning a ton! Quick beginner question! How do you create a portfolio, and then call it into initialize? For instance, here is the code I'm working with now:
def initialize(context):
context.portfolio.positions[symbol('x'), symbol('x'), symbol('x'), symbol('x'), symbol('x'), symbol('x')]
There's more companies in it, but you get the picture. However, the problem occurs when I try to get the order target percentage. I get this error.
UnsupportedOrderParameters: Passing non-Asset argument to 'order()' is not supported. Use 'sid()' or 'symbol()' methods to look up an Asset.
Basically I want to figure out how I can make a variable called portfolio, and just have it call the list of companies in the portfolio!
Thanks in advance!