Section 6 Unit 7

Portfolio Position Object

My code:



def initialize(context):

    pass

    

def handle_data(context, data):

    # Enter the code below

    AAPL_Position = context.portfolio.positions[symbol('AAPL')]

    end()





The error:

 An error occured while running the code:



Code: 404 - {"result":"no instance available"}

Hello Hugo,



Same issue as this one:  https://quantra.quantinsti.com/questionDetails/682/Error-Section-6-Unit