MetaTrader 5 Python User Group - how to use Python in Metatrader - page 28

 
Well, if all the data is from one terminal, then it is clear that the time shift is not important. But this is supposed to be an analytics tool (e.g. linking to news or other data) - and the time is different there, so you have to convert.
 
Lyuk:
Well, if all the data is from one terminal, then it is clear that the time shift is not important. But this is supposed to be a tool for analytics (e.g. linking to news or other data) - and the time is different there, so we have to convert it.

Seems easy

pd.tz_convert(None)
https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.Series.dt.tz_convert.html
 
It is not difficult, when you have already found a bug that needs time to correct, debugging is difficult.
 

The library is not installed or even updated. The current version I'm using is 5.0.4 and the latest version is 5.0.8.

It's a log. What should I do?

Collecting MetaTrader5
  Downloading https: //files.pythonhosted.org/packages/56/76/58682d9a70b8eea2a707634125fb495bf457b21fef565d2d4bac559aad94/MetaTrader5-5.0.8.tar.gz
Building wheels for collected packages: MetaTrader5
  Building wheel for MetaTrader5 (setup.py) ... error
  ERROR: Command errored out with exit status 1 :
   command: 'c:\python35\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = ' "'" 'C:\\Users\\la\\AppData\\Local\\Temp\\pip-install-s2bqudzg\\MetaTrader5\\setup.py' "'" '; __file__=' "'" 'C:\\Users\\la\\AppData\\Local\\Temp\\pip-install-s2bqudzg\\MetaTrader5\\setup.py' "'" ';f=getattr(tokenize, ' "'" 'open' "'" ', open)(__file__);code=f.read().replace(' "'" '\r\n' "'" ', ' "'" '\n' "'" ');f.close();exec(compile(code, __file__, ' "'" 'exec' "'" '))'  bdist_wheel -d  'C:\Users\la\AppData\Local\Temp\pip-wheel-6x877lgv'  --python-tag cp35
        cwd: C:\Users\la\AppData\Local\Temp\pip-install-s2bqudzg\MetaTrader5\
  Complete output ( 10 lines):
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build\lib.win-amd64- 3.5
  creating build\lib.win-amd64- 3.5 \MetaTrader5
  copying MetaTrader5\__init__.py -> build\lib.win-amd64- 3.5 \MetaTrader5
  running build_ext
  building 'MetaTrader5.C' extension
  error: [WinError 2 ] The system cannot find the file specified
  ----------------------------------------
  ERROR: Failed building wheel for MetaTrader5
  Running setup.py clean for MetaTrader5
Failed to build MetaTrader5
Installing collected packages: MetaTrader5
  Found existing installation: MetaTrader5 5.0 . 4
    Uninstalling MetaTrader5- 5.0 . 4 :
      Successfully uninstalled MetaTrader5- 5.0 . 4
    Running setup.py install for MetaTrader5 ... error
    ERROR: Command errored out with exit status 1 :
     command: 'c:\python35\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = ' "'" 'C:\\Users\\la\\AppData\\Local\\Temp\\pip-install-s2bqudzg\\MetaTrader5\\setup.py' "'" '; __file__=' "'" 'C:\\Users\\la\\AppData\\Local\\Temp\\pip-install-s2bqudzg\\MetaTrader5\\setup.py' "'" ';f=getattr(tokenize, ' "'" 'open' "'" ', open)(__file__);code=f.read().replace(' "'" '\r\n' "'" ', ' "'" '\n' "'" ');f.close();exec(compile(code, __file__, ' "'" 'exec' "'" '))' install --record 'C:\Users\la\AppData\Local\Temp\pip-record-7ohhmuga\install-record.txt'  --single-version-externally-managed --compile
          cwd: C:\Users\la\AppData\Local\Temp\pip-install-s2bqudzg\MetaTrader5\
    Complete output ( 10 lines):
    running install
    running build
    running build_py
    creating build
    creating build\lib.win-amd64- 3.5
    creating build\lib.win-amd64- 3.5 \MetaTrader5
    copying MetaTrader5\__init__.py -> build\lib.win-amd64- 3.5 \MetaTrader5
    running build_ext
    building 'MetaTrader5.C' extension
    error: [WinError 2 ] The system cannot find the file specified
    ----------------------------------------
  Rolling back uninstall of MetaTrader5
  Moving to c:\python35\lib\site-packages\metatrader5- 5.0 . 4 .dist-info\
   from c:\python35\lib\site-packages\~etatrader5- 5.0 . 4 .dist-info
  Moving to c:\python35\lib\site-packages\metatrader5\
   from c:\python35\lib\site-packages\~-tatrader5
ERROR: Command errored out with exit status 1 : 'c:\python35\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = ' "'" 'C:\\Users\\la
 \\AppData\\Local\\Temp\\pip-install-s2bqudzg\\MetaTrader5\\setup.py' "'" '; __file__=' "'" 'C:\\Users\\la
 \\AppData\\Local\\Temp\\pip-install-s2bqudzg\\MetaTrader5\\setup.py' "'" ';f=getattr(tokenize, ' "'" 'open' "'" ', open)(__file__);code=f.read().replace(' "'" '\r\n' "'" ', ' "'" '\n' "'" ');f.close();exec(compile(code, __file__, ' "'" 'exec' "'" '))' install --record 'C:\Users\la \AppData\Local\Temp\pip-record-7ohhmuga\install-record.txt' --single-version-externally-managed --compile Check the logs for full command output.
 
jaffer wilson:

The library is not installed or even updated. The current version I'm using is 5.0.4 and the latest version is 5.0.8.

It's a log. What should I do?

Reinstall Python (3.7 or 3.8 is better) and try again, please.

 
MetaQuotes Software Corp. :

Reinstall Python (preferably 3.7 or 3.8) and try again, please.

I'm using Python 3.5.0. The previous version works fine. But the latest update doesn't update. What could be causing this?

 
jaffer wilson:

I'm using Python 3.5.0. The previous version works fine. But the latest update doesn't update. What could be the reason for this?

Reinstall Python 3.5.0 x64 and try again.

 
MetaQuotes Software Corp. :

Reinstall Python 3.5.0 x64 and try again.

Thank you for your reply. I have done that. But the problem remains the same.

 
jaffer wilson:

The library is not installed or even updated. The current version I'm using is 5.0.4 and the latest version is 5.0.8.

It's a log. What should I do?

Judging by the logs you are trying to build a module from source, you must have Visual Studio 2017/2019 or Visual C++ Build Tools for that.

Try entering:

pip uninstall MetaTrader5
pip install MetaTrader5

installation should go from whl:

E:\>pip install MetaTrader5
Collecting MetaTrader5
  Downloading https://files.pythonhosted.org/packages/e4/fc/dc782c6b6b1c9270b8efbca08b2304150354a87fff5695671f930af8f0ad/MetaTrader5-5.0.9-cp37-cp37m-win_amd64.whl
Installing collected packages: MetaTrader5
Successfully installed MetaTrader5-5.0.9
 
Almaz :

Judging by the logs you are trying to build a module from source, you must have Visual Studio 2017/2019 or Visual C++ Build Tools for that.

Try entering:

installation should go from whl:

I tried that too. But I don't understand why this is happening. If I uninstall Metatrader and try to reinstall, I get the same error. Even for version 5.0.4.

And I'm using Python 3.5.0 strictly.

Reason: