Hi all
Note
Connection address should be added to the list of allowed ones on the client terminal side (Tools \ Options \ Expert Advisors).
If connection fails, error 5272 (ERR_NETSOCKET_CANNOT_CONNECT) is written to _LastError.
The function can be called only from Expert Advisors and scripts, as they run in their own execution threads. If calling from an indicator, GetLastError() returns the error 4014 – "Function is not allowed for call".
- www.mql5.com
Hi all
Note
Connection address should be added to the list of allowed ones on the client terminal side (Tools \ Options \ Expert Advisors).
If connection fails, error 5272 (ERR_NETSOCKET_CANNOT_CONNECT) is written to _LastError.
The function can be called only from Expert Advisors and scripts, as they run in their own execution threads. If calling from an indicator, GetLastError() returns the error 4014 – "Function is not allowed for call".
Hi Maxim Dmitrievsky,
I allowed the localhost and it's working correctly. Thank you very much! But when I ran in backtest using the Strategy Tester, the error 4014 persisted. The socket doesn't work with backtest?
Best regardsHi Maxim Dmitrievsky,
I allowed the localhost and it's working correctly. Thank you very much! But when I ran in backtest using the Strategy Tester, the error 4014 persisted. The socket doesn't work with backtest?
Best regardsYes, all right. Metaquotes disabled this feature in backtester, but they say maybe allow this in near future.
Bom dia, estou tendo erro de dll
Traceback (most recent call last):
ImportError: DLL load failed: Não foi possível encontrar o módulo especificado.
alguém sabe o que estou fazendo errado ?
Bom dia, estou tendo erro de dll
Traceback (most recent call last):
ImportError: DLL load failed: Não foi possível encontrar o módulo especificado.
alguém sabe o que estou fazendo errado ?
Olá Antonio,
esse erro normalmente acontece quando tenta instalar a biblioteca em um python que não é o Python para windows. Tente instalar o https://www.python.org/downloads/ e veja se corrige o erro.
Abraço
- Aplicativos de negociação gratuitos
- 8 000+ sinais para cópia
- Notícias econômicas para análise dos mercados financeiros
Você concorda com a política do site e com os termos de uso
Novo artigo Integração da MetaTrader 5 e Python: recebendo e enviando dados foi publicado:
O vasto processamento de dados requer ferramentas extensas e muitas vezes está além do ambiente seguro de um único aplicativo. Linguagens de programação especializadas são usadas para processar e analisar dados, estatísticas e aprendizado de máquina. Uma das principais linguagens de programação para processamento de dados é o Python. O artigo fornece uma descrição de como conectar a MetaTrader 5 e o Python usando sockets, além de como receber cotações por meio da API do terminal.
Nós vamos escrever um programa simples que irá criar um servidor socket e receber as informações necessárias do cliente (o programa em MQL5), manipulá-lo e enviar o resultado de volta. Esse parece ser o método de interação mais eficiente. Suponha que nós precisamos usar uma biblioteca de aprendizado de máquina, como por exemplo scikit learn, que calculará a regressão linear usando preços e retornar as coordenadas, com base nos quais uma linha pode ser desenhada no terminal MetaTrader 5. Este é um exemplo simples. No entanto, essa interação também pode ser usada para treinar uma rede neural, para enviar à ela dados do terminal (cotações), aprender e retornar o resultado para o terminal.
Agora nós podemos continuar a criação de uma classe responsável pela manipulação do socket:Autor: Maxim Dmitrievsky