All price calls return "None"

 
Hello everyone,

I have a working code, having tried it on other computers than mine. Just on my computer, despite using the same api in the same version, price calls don't work. Exemple:

mt5.login(login, password, server)
account_info = mt5.account_info()
print('login: ', account_info.login)
print('balance: ', account_info.balance)
print('equity: ', account_info.equity)
print(mt5.symbols_total())
> show good information But:
print(mt5.symbol_info_tick("EURUSD")._asdict())
> None

Can i get some help please? Thanks in advance
Documentation on MQL5: Python Integration / symbol_info_tick
Documentation on MQL5: Python Integration / symbol_info_tick
  • www.mql5.com
symbol_info_tick - Python Integration - MQL5 Reference - Reference on algorithmic/automated trading language for MetaTrader 5
 
MQL5.community - User Memo
MQL5.community - User Memo
  • www.mql5.com
You have just registered and most likely you have questions such as, "How do I insert a picture to my a message?" "How do I format my MQL5 source code?" "Where are my personal messages kept?" You may have many other questions. In this article, we have prepared some hands-on tips that will help you get accustomed in MQL5.community and take full advantage of its available features.
 
Artex:
Hello everyone,

I have a working code, having tried it on other computers than mine. Just on my computer, despite using the same api in the same version, price calls don't work. Exemple:

> show good information But:
> None

Can i get some help please? Thanks in advance
The solution is in the link to the documentation.
 
What do you mean? I do indeed import the metaTrader5 API as mt5, so it's normally connected, a print(mt5.__version__) returns 5.0.44 by the way
 
Artex #: What do you mean? I do indeed import the metaTrader5 API as mt5, so it's normally connected, a print(mt5.__version__) returns 5.0.44 by the way
What I mean is pretty clear : read the documentation, did you ?
 
Alain Verleyen #: What I mean is pretty clear : read the documentation, did you ?

Yes I did, and as I said my code is working. By installing the same dependencies between my computer and that of a friend, my code works for him and not for me.

Just, on my computer all price calls return "none".

 
Artex #:

Yes I did, and as I said my code is working. By installing the same dependencies between my computer and that of a friend, my code works for him and not for me.

Just, on my computer all price calls return "none".

Sorry I had misread about your issue.

a print(mt5.__version__) returns 5.0.44 by the way

I have 5.0.45, try firstly to upgrade MT5 package.

If the problem persists, use last_error() to get more information :

print("symbol_info_tick() failed, error code =",mt5.last_error())
 
Alain Verleyen #:

Sorry I had misread about your issue.

I have 5.0.45, try firstly to upgrade MT5 package.

If the problem persists, use last_error() to get more information :

The problem is that even with the same version of api on computer friend, the code don't work, but when i come back home i'll try to update my api version.
However, there is no real error by using the api, like as i said, the api just return a NoneType object. So the problem it's difficult to resolve without any error.
 
Artex #:
The problem is that even with the same version of api on computer friend, the code don't work, but when i come back home i'll try to update my api version.
However, there is no real error by using the api, like as i said, the api just return a NoneType object. So the problem it's difficult to resolve without any error.

So we are back to the documentation :

Return Value

Return info in the form of a tuple. Return None in case of an error. The info on the error can be obtained using last_error().

There is an error, it will help to know why symbol_info_tick returns 'None'.

Documentation on MQL5: Python Integration / symbol_info_tick
Documentation on MQL5: Python Integration / symbol_info_tick
  • www.mql5.com
symbol_info_tick - Python Integration - MQL5 Reference - Reference on algorithmic/automated trading language for MetaTrader 5
 
Alain Verleyen #:

So we are back to the documentation :

There is an error, it will help to know why symbol_info_tick returns 'None'.

the error code are "error code = (-4, 'Terminal: Not found')", but it's strange because when i start my code the terminal MT5 open
 
Artex #:
the error code are "error code = (-4, 'Terminal: Not found')", but it's strange because when i start my code the terminal MT5 open

RES_E_NOT_FOUND

-4

no history


Error -4 means there is no data. Is the symbol available and selected ?
Documentation on MQL5: Python Integration / last_error
Documentation on MQL5: Python Integration / last_error
  • www.mql5.com
last_error - Python Integration - MQL5 Reference - Reference on algorithmic/automated trading language for MetaTrader 5
Reason: