AttributeError: ‘TradingApp’ object has no attribute ‘nextValidOrderId’

  anaconda, api, conda, python, tws

Keep seeing this error message

Hi guys,

I tried to run this code for IBKR API.
I literally just copy/pasted what I learned in the udemy course but still getting this message.

Some additional info below:

  1. I did it twice in two of my computers, but seeing the same error.
  2. I made sure TWS files are in the right location when I opened Spyder(python) in my anaconda virtual environment. Some summaries of code I used in terminal below:

conda create —name quant python=3.8

conda info —envs (it will tell all the environments created in the computer)

conda activate quant

conda install -c anaconda spyder

conda install pandas==0.24.1

conda install threading

conda install times

cd “….TWS APIsourcepythonclient”

conda activate quant

python install


spyder —new-instance (use this if spyder is already running in different environment)

Source: Python Questions