Websocket how?

 

Hi all!

I've got a task to receive quotes from huobi via websocket and build an offline chart using these quotes.

I realized that this cannot be done using standard means.

I have an idea to write a dll in java and use it to receive quotes.

How can this be implemented?

I have never done this before, I will be very grateful for help!

 

Networking features in MetaTrader 5: https://www.mql5.com/ru/docs/network

Документация по MQL5: Сетевые функции
Документация по MQL5: Сетевые функции
  • www.mql5.com
Группа функций Socket* позволяет создать TCP-соединение (в том числе защищенное соединение TLS) с удаленным хостом через системные сокеты. Схема работы проста: вы создаете сокет, подключаетесь к серверу и можете начинать чтение и запись данных. Для безопасности конечного пользователя на стороне клиентского терминала реализован список...
 
MetaQuotes:

Networking features in MetaTrader 5: https://www.mql5.com/ru/docs/network

Isn't this implemented in 4?

your link does not support wss

 
Fedor Arkhipov:

Isn't this implemented in 4?

Your link does not support wss

Had the same hassle, had to write my own websockets.

If you're interested, I can send it to you. But it's in beta mode, bugs are caught from time to time ...

 
Дмитрий Прокопьев:

It was the same hassle, I had to write my own websockets.

If you're interested, I can send it to you. But it's in beta mode, bugs are caught from time to time ...

I think wss can be attached there, I have ws there, as its task within one host to dump data to python.

Let's just say it's a crutch before the "python lib" ;) ... with the advent of the lib, it's only needed to synchronize events,

so it's still used in terminal and python.

 
Дмитрий Прокопьев:

It was the same hassle, I had to write my own websockets.

If you're interested, I can send it to you. But it's in beta mode, bugs are caught from time to time ...

Please send it over! You can send it to me in a private message.

 

I found an example library, but the dll is compiled in 32 bit version and I get an error because of it.

Does anyone have wine installed?

Files:
 
MetaQuotes:

Networking features in MetaTrader 5: https://www.mql5.com/ru/docs/network

You have an exaggerated view of mql users.
Who still have to parse the RFC standard themselves, and write the appropriate handlers.

 
Дмитрий Прокопьев:

It was the same hassle, I had to write my own websockets.

If you're interested, I can send it to you. But it's in beta mode, bugs are caught from time to time ...

Yes, it is interesting, if you can send me plyz.

In general, the theme of sockets is interesting, I remember trying to implement mine from scratch in C++, purely by API of OS, "triple handshake", protocols, etc., but could not overcome, I lacked motivation.

If you have implemented WS purely or at least via standard sockets, that's interesting.

 

The same is true of the implementation for huobi, for go, for node-js, for java. just choose, tweak it to put it in the right format somewhere.

The more so, almost everyone has a restart of candlestick history, which you can even use on pure mql.

 
Git-e has ready-made libraries for websockets, such as Beast.
Reason: