Print the Open Positions in the Portfolio
I put the code
def initialize(context):
pass
def handle_data(context, data):
#Enter the code below
print(context.portfolio.positions_value)
end()
When submit I get the error:
An error occured while running the code:
Code: 404 - {"result":"no instance available"}
Hello Hugo, we are looking into the issue.
It looks like the TWS instance is not available on our backend.
Meanwhile, you may follow steps in this section to install IBridgePy and TWS on your local computer to practice the code on your local computer through IB demo/paper trading account.
Thanks