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

 
Renat Fatkhullin:

If you can create multiple sessions mt5.initialize.

Within one session, the requests are synchronous.

Multiple sessions to one terminal (broker, account)?

Or each session will need a separate terminal?

It is interesting.

 
Vladimir Perervenko:

Multiple sessions to one terminal (broker, account)?

Or will each session need a separate terminal?

That is interesting.

Multiple sessions to one terminal is supported.

 
Renat Fatkhullin:

Multiple sessions to a single terminal are supported.

Great. I will try

 
Note that Jupyter Notebook *.ipynb files are supported directly from the editor (not the terminal).

It is possible to run them fully.
 
Good afternoon.

Looking for source code of MetaTrader5 package for Python. Came across this section:https://www.mql5.com/en/code/mt5/libraries
But there are millions of links. Chances to find required source code by human search are close to zero.

Please tell me if this library https://pypi.org/project/MetaTrader5/
is it possible to find source code (if yes, I won't mind to get link to it)?
MQL5 Code Base: Libraries
MQL5 Code Base: Libraries
  • www.mql5.com
Custom Price Chart using a simple Artificial Neural Network that tries to project price movements into the future. Not very useful for trading, but fun to watch and learn ;) NELODI Trading Terminal is a collection of Indicators and an Expert Advisor, which work together to provide a complete solution for manual Trading, primarily designed for...
 
The library is only distributed as a compiled package.
 
Renat Fatkhullin:
Note that directly from the editor (not the terminal) Jupyter Notebook *.ipynb files are supported.

It is possible to run them fully.

Is it possible to run them remotely? I.e. specify the ip of the server where jupyter is running, or only locally?

 
Renat Fatkhullin:

Next Friday we will release the MT5 release and update the documentation at the same time.

The descriptions of the old interfaces in the forum will also be edited.


By default, the terminal that was last started under the user account is launched. The directory C:\Users\%username%\AppData\Roaming\MetaQuotes\Terminal is searched and the most recent instance is selected.

The answer codes are wrapped in tuple and are similar to the answer codes in MQL5.

We will describe it later in the documentation.

Can you tell me if it's due today?
 
alex.alexen:
Can you tell me if it's due today?

From what I can see, the update has already passed -build 2340 of 21.02.2020

 

Please, who can help me.

I tried to run sample (python) from MQL5 editor, but it gives me error

NameError: name 'MT5_TIMEFRAME_H4' is not define

thanks for help

code

# Copyright 2020, MetaQuotes Software Corp.
# https://www.mql5.com
from datetime import datetime
from MetaTrader5 import *
import MetaTrader5 as mt5
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
pd.set_option ('display.max_columns', 500) # number of columns to be displayed
pd.set_option ('display.width', 1500) # max table width to display
# import pytz module for working with time zone
import pytz
mt5.initialize ()
 
# set time zone to UTC
timezone = pytz.timezone ("Etc / UTC")
# create 'datetime' object in UTC time zone to avoid the implementation of a local time zone offset
utc_from = datetime (2019, 4, 5, tzinfo = timezone)
# get 10 EURUSD H4 bars starting from 04/01/2019 in UTC time zone
rates = mt5.copy_rates_from ("EURUSD", MT5_TIMEFRAME_H4, utc_from, 20)
mt5.shutdown ()
# display each element of obtained data in a new line
print ("Display obtained data 'as is'")
for rate in rates:
    print (rate)
 
# create DataFrame out of the obtained data
rates_frame = pd.DataFrame (list (rates),
                           columns = ['time', 'open', 'low', 'high', 'close', 'tick_volume', 'spread', 'real_volume'])

# display data
print ("\ nDisplay dataframe with data")
print (rates_frame)  
Descubra las nuevas posibilidades de MetaTrader 5 con la comunidad y los servicios MQL5
Descubra las nuevas posibilidades de MetaTrader 5 con la comunidad y los servicios MQL5
  • www.mql5.com
Formule preguntas sobre análisis técnico, discuta sobre sistemas comerciales y mejore sus hablidades de programación de estrategias comerciales en el lenguaje MQL5. Contacte con tráders de todo el mundo en el foro e intercambie experiencias, también podrá ayudar a los principiantes con sus propias respuestas: nuestra comunidad se desarrolla...