Python 3.7中的MetaTrader5库 [英] MetaTrader5 libarary in Python 3.7
问题描述
我正在尝试在Python中使用MT5分析货币数据,但无法正常工作.
I am trying to analyse currency data using MT5 in Python but it is not working.
from MetaTrader5 import *
from datetime import date
# Initializing MT5 connection
MT5Initialize()
MT5WaitForTerminal()
print(MT5TerminalInfo())
print(MT5Version())
这是错误:MT5WaitForTerminal()RuntimeError: No IPC connection
.我怎样才能解决这个问题?
This is the error: MT5WaitForTerminal()RuntimeError: No IPC connection
. How can I fix this?
推荐答案
我遇到了同样的问题,并且发现了以下解决方案: 我的终端是从代理站点下载的,可能进行了一些修改以阻止ipc连接. 我从 https://www.metatrader5.com/en/download 下载了原始软件 并从经纪人的版本中复制"Config"文件夹.
I had the same issue and I found the following solution: My terminal was downloaded from the broker site and probably had some modifications that block ipc connections. I downloaded original software from https://www.metatrader5.com/en/download and copied "Config" folder from broker's version.
现在python脚本有效.
Now python script works.
这篇关于Python 3.7中的MetaTrader5库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!