MetaTrader 5 Python用户组 - 如何在Metatrader中使用Python - 页 44

 
Renat Fatkhullin:

如果你可以创建多个会话mt5.initialize。

在一个会话中,请求是同步的。

一个终端的多个会话(经纪人、账户)?

还是每个会话都需要一个单独的终端?

这很有意思。

 
Vladimir Perervenko:

一个终端的多个会话(经纪人、账户)?

还是每个会话都需要一个单独的终端?

这很有意思。

支持对一个终端的多个会话。

 
Renat Fatkhullin:

支持对一个终端的多个会话。

很好。我将尝试

 
请注意,Jupyter Notebook *.ipynb文件是直接从编辑器(不是终端)支持的。

有可能完全运行它们。
 
下午好。

寻找Python的MetaTrader5软件包的源代码。遇到了这个部分:https://www.mql5.com/en/code/mt5/libraries
但有数以百万计的链接。通过人工搜索找到所需源代码的机会接近于零。

请告诉我,如果这个图书馆https://pypi.org/project/MetaTrader5/
是否可以找到源代码(如果可以,我不介意得到它的链接)?
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...
 
该库只作为一个编译包发布。
 
Renat Fatkhullin:
注意,直接从编辑器(不是终端)支持Jupyter笔记本*.ipynb文件。

有可能完全运行它们。

是否有可能远程运行它们?即指定jupyter运行的服务器的IP,还是只指定本地?

 
Renat Fatkhullin:

下周五我们将发布MT5版本并同时更新文档。

论坛中对旧界面的描述也将被编辑。


默认情况下,在用户账户下最后启动的终端被启动。搜索目录C:\Users\%username%\AppData\Roaming\MetaQuotes\Terminal,并选择最新的实例。

答案代码被包裹在元组中,与MQL5的答案代码相似。

我们将在后面的文档中描述它。

你能告诉我今天是否到期吗?
 
alex.alexen:
你能告诉我今天是否到期吗?

从我所看到的,更新已经通过了--2020年2月21日的构建2340

 

拜托,谁能帮助我。

我试图从MQL5编辑器中运行样本(Python),但它给我的错误是

NameError: name 'MT5_TIMEFRAME_H4' is not define

谢谢帮助

编码

# 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...