Python MetaTrader5 example code TypeError

 

Hi, could someone explain how to debug the error when running the example code provided from:

I've included a screenshot of the exact error message. I've tried using both Python 3.7 and 3.8 versions.

Documentation on MQL5: Integration / MetaTrader for Python / symbols_total
Documentation on MQL5: Integration / MetaTrader for Python / symbols_total
  • www.mql5.com
Integration / MetaTrader for Python / symbols_total - Reference on algorithmic/automated trading language for MetaTrader 5
Files:
mt5.png  101 kb
 

I am not sure

I testing all sample code all update and fine 

may be  need to init

mt5.initialize(path="C:\\Program Files\\MetaTrader 5\\terminal64.exe")

python try to connect with last MT5 that active application

 

one more that jupyter notebook is on you localhost right?

for simple testting python

test on you PC that run MT5, and test run python from command prompt

 
demoinvest:

one more that jupyter notebook is on you localhost right?

for simple testting python

test on you PC that run MT5, and test run python from command prompt

When I run order "order_send" it show error as below :

'NoneType' object has no attribute 'bid'


Is that the same issue? If the order_send function can't be used. That's means no use totally.

 
demoinvest:

one more that jupyter notebook is on you localhost right?

for simple testting python

test on you PC that run MT5, and test run python from command promptYeah

Yeah, my Jupyter notebook is on my localhost. I tried specifying the path on initialization as per your suggestion, doesn't solve the issue. 

 

As a temporary solution, would someone kindly provide the list of all 182 Symbols?

I am able to run some of the other example codes with no problems so far, such as copy_rates_from & copy_ticks_from.

 
mt5attempt:

As a temporary solution, would someone kindly provide the list of all 182 Symbols?

I am able to run some of the other example codes with no problems so far, such as copy_rates_from & copy_ticks_from.

https://www.mql5.com/en/docs/integration/python_metatrader5/mt5symbolsget_py

Documentation on MQL5: Integration / MetaTrader for Python / symbols_get
Documentation on MQL5: Integration / MetaTrader for Python / symbols_get
  • www.mql5.com
AUDCAD : SymbolInfo(custom=False, chart_mode=0, select=True, visible=True, session_deals=0, session_buy_orders=0, session... AUDCHF : SymbolInfo(custom=False, chart_mode=0, select=False, visible=False, session_deals=0, session_buy_orders=0, sessi...
 

Perhaps I didn't make it clear in my original post, but both symbols_get and symbols_total functions are not working for me. They are returning None. 

Files:
Error.png  114 kb
Reason: