Section 6 Unit 8

Number of Shares of Portfolio Position Object

My code:



def initialize(context):

    pass

    

def handle_data(context, data):

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

    # Enter the code below

    print(AAPL_Position.amount)

    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