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

 
Maxim Dmitrievsky:

Naturally, you can also use a tester through the pips.

How slow would it be?

 
forexman77:

How slow will it be?

how slow does it need to be? ))

Connect and data transfer is almost instantaneous, the amount of python calculations determines the slowdown
 
Maxim Dmitrievsky:

how slow do you need to go? ))

Well, here we go again. Question to question)

For example tried to take a script from R and from it ARIMA. I ran a single test on a daily chart since 2004 up to the current date. The test lasted about four minutes with visualization (it was very long).

For example how long some classifier or regression is considered, what timeframe. Can you tell in this way?

Plus the data was processed incorrectly(with R the data was periodically not ready and the indicator was requesting data. Tried using a delay. Didn't help. I gave up and did not use it at all).

Of course it is interesting to try different neural networks, classifiers and the like with different settings in MetaTrader, because visualization is better there. Although I don't have any illusions about it.

I'm testing everything in Python now. I'm thinking whether it's worth bothering to study tinker, PQT and other to make multifunctional tester in Python.

 
forexman77:

Well, here we go again. Question upon question)

For example tried to take a script from R and from it ARIMA. I ran a single test on a daily chart since 2004 till the current date. The test lasted about four minutes with visualization (it was very long).

For example how long some classifier or regression is considered, what timeframe. Can you tell in this way?

Plus the data was processed incorrectly(with R the data was periodically not ready and the indicator was requesting data. Tried using a delay. Didn't help. I gave up and gave up).

I don't know in milliseconds, you can check it now.

https://www.mql5.com/ru/articles/5691

I didn't make any pips for the tester... can you do it?

Соединение MetaTrader 5 и Python: получение и отправка данных
Соединение MetaTrader 5 и Python: получение и отправка данных
  • www.mql5.com
Сетевой сокет является конечной точкой межпроцессного взаимодействия через компьютерную сеть. В стандартной библиотеке MQL5 есть группа функций Socket, которые обеспечивают низкоуровневый интерфейс для работы в сети интернет. Этот интерфейс является общим для разных языков программирования, так как он использует системные вызовы на уровне...
 
Maxim Dmitrievsky:

not clocked in milliseconds, you can run it to check

https://www.mql5.com/ru/articles/5691

Well there's no way to do it in the tester... I didn't make pips for the tester... do you want to do it?

Sure do. The first question here is, are there any fish there? To find out you need to check on the history.

Only it seems to me, as in R there can be difficulties, which I described above.

 
imho, a complex NS is not needed in the market, there is little point. But reading articles with examples in Python is a piece of cake.
 

I've already got full-fledged Python connected to the terminal, and you're still using slow-moving sockets and pipes to make the exchange.

MetaTrader 5 (MQL5) + Python 3 DLL для Forex, CFD и Futures
  • roffild.com
Использование MetaTrader с Python 3 для Forex, CFD и Futures. Из MetaTrader можно получать котировки в Python, но нет полноценной связи между ними. Пост одного из разработчиков. Главная идея и отличие этой обертки от остальных: обмен данными между MQL и Python через заранее созданные функции. Это самый быстрый и надежный метод обмена данными...
 
Maxim Dmitrievsky:

Naturally, you can also use pips in the tester

The MQL5 socket client from the article "CONNECTING METATRADER 5 AND PYTHON: GETTING AND SENDING DATA" should receive this structure from python socket server in message to initiate a trade request?

structMqlTradeRequest
{
ENUM_TRADE_REQUEST_ACTIONSaction;// Type of action to be performed
magic;// Expert stamp (magic number identifier)
ulongorder;// Ticket order
stringsymbol;// Trade symbol name
doublevolume;// Requested volume of the transaction in lots
doubleprice;// Price
doublestoplimit;// StopLimit order level
doublesl;// Stop Loss level of order
doubletp;// Take Profit level of order
ulongdeviation;// Maximal acceptable deviation from the requested price
ENUM_ORDER_TYPEtype;// Order type
ENUM_ORDER_TYPE_FILLINGtype_filling;// Order type
ENUM_ORDER_TYPE_TIMEtype_time;// Order type by time of execution
datetimeexpiration;// expiration time (for ORDER_TIME_SPECIFIED orders)
stringcomment;// comment on the order
ulongposition;// Ticket position
ulongposition_by;// Ticket of opposite position
};

 
slukin:

The MQL5 socket client from the article "CONNECTING METATRADER 5 AND PYTHON: GETTING AND SENDING DATA" needs to receive this structure from python socket server in message to initiate a trade request?

structMqlTradeRequest
{
ENUM_TRADE_REQUEST_ACTIONSaction;// Type of action
magic;// Expert stamp (magic number identifier)
ulongorder;// Ticket order
stringsymbol;// Trade symbol name
doublevolume;// Requested volume of the transaction in lots
doubleprice;// Price
doublestoplimit;// StopLimit order level
doublesl;// Stop Loss level of order
doubletp;// Take Profit level of order
ulongdeviation;// Maximal deviation from the requested price
ENUM_ORDER_TYPEtype;// Order type
ENUM_ORDER_TYPE_FILLINGtype_filling;// Order type
ENUM_ORDER_TYPE_TIMEtype_time;// Order type by time of execution
datetimeexpiration;// expiration time (for ORDER_TIME_SPECIFIED orders)
stringcomment;// comment on the order
ulongposition;// Ticket position
ulongposition_by;// Ticket of opposite position
};

A string can pass the command and a list of parameters, separated by separators. When Expert Advisor unpacks the message, it will understand what to do.

 
forexman77:

Of course you do. The first question here is, are there fish there? To find out you need to check on history.

Only it seems to me, as in R there may be difficulties as described above.

exactly like this

in order not to engage in programming to nowhere, you must first formulate a goal

at least it is a profit

and if the whole world has been solving this problem for a long time, it is easier to find the answer to the question first, and only then prog

at the moment there is a theme of exploring the product and its possibilities
Reason: