Is it possible to overlay the quotes of another broker in MT4? - page 4

 
getch >>:

Спреды в теории арбитража не при чем.


Everyone writes so mysteriously, as if they know something, but are silent))))) and they write that there are no fish)))) so maybe you should tell the users about it, so they don't waste their time)
 
Everyone does. Don't you?
 
zhuki >>:
Но открыться всё равно сложнее.Да и завершить хотелось бы положительно.

It's all formalised.

 
getch >>:

Это все формализовано.

I am familiar with your work and have great respect for your research. Thank you.

 

Have you tried to read not the quotes with the Expert Advisor but to read the packets coming to the port. So to speak at the moment of receiving them by MT4.

You see, in order to increase the speed.

 

This topic was touched upon in this forum and I promised to try to write something useful on it. It turned out to be a universal core of an arbitration Expert Advisor. I haven't done anything else on the subject.

I think that the delay between the terminal receiving a tick and sending it to the trader is close to zero.

Possible improvements have been suggested. I actually see the topic as interesting, but not when solving it head-on.

 
getch >>:

Эта тема была затронута на этом форуме и пообещал попробовать что-то дельное по ней написать. Получилось универсальное ядро арбитражного советника. Больше ничего на тему не делал.

Думаю, что задержка между получением тика терминалом и отправкой его трейдеру близка к нулю.

Возможные доработки высказывал. Тему на самом деле вижу интересной, но не при решении в лоб.

Thank you. I got it.

 
Fduch >>:

Саму программу не смотрел, я писал собственную реализацию (приложение на c#, которое принимает через сокеты котировки и рассылает приказы терминалам).

Да и вопрос не в реализации, а в применении на практике. Пар ДЦ, подходящих для арбитража, я так до сих пор и не встретил.

If you don't mind, post a code example. (Example code that gets quotes via sockets).

 
fevrall >>:

Если не сложно выложите пример кода. (Пример кода, котрый получает котировки через сокеты).

Unfortunately, it's useless without the rest of the code =)

The language is c#.

        /// <summary>
        /// Метод обработки входящих соединений
        /// </summary>
        public override void ProceedSocket( object objSocket)
        {
            string dealingCenterName = "";
            Socket socket = ( Socket) objSocket;
            #region ProcessingSocket
            {
                #region GetMessage
                string incomingMessage = "";
                byte[] buffer = new byte[10000];
                Console. WriteLine("Recieving data from socket..");
                int recieved = 0;
                while (( recieved = socket. Receive( buffer)) != 0)
                {
                    Console. WriteLine("Recieved "+ Convert. ToString( recieved));
                    string str = "";
                    for (int k = 0; k < buffer. Length; k++)
                        str = str + Convert. ToChar( buffer[ k]);
                    incomingMessage = incomingMessage + str;
                    if ( str. Contains("\r\n\r\n") == true)
                        break;
                }
                #endregion

                lock ( DealingCentersDictionary)
                {
                    #region UpdateMarketsInfo
                    // Обновляем инфу в ServerMarketInstruments
                    string[] instruments = incomingMessage. Split("\r\n". ToCharArray());
                    // Выбирам дилинговый центр
                    dealingCenterName = instruments[0];
                    Console. WriteLine("Proceeding " + dealingCenterName + " socket");
                    if ( DealingCentersDictionary. ContainsKey( dealingCenterName) == false)
                        DealingCentersDictionary. Add( dealingCenterName, new Market());
                    Market CurrentDCInstruments = DealingCentersDictionary[ dealingCenterName];
                    // Обновляем котировки
                    for (int k = 1; k < instruments. Length; k++)
                    {
                        string s = instruments[ k];
                        string[] data = s. Split(';');
                        if ( data. Length == 3 && data[0] != "" && data[1] != "" && data[2] != "")
                        {
                            string ticket = data[0];
                            double ask = Convert. ToDouble( data[1]. Replace(".", ","));
                            double bid = Convert. ToDouble( data[2]. Replace(".", ","));
                            if ( CurrentDCInstruments. Instruments. ContainsKey( ticket) == false)
                            {
                                CurrentDCInstruments. Instruments. Add( ticket, new Instrument());
                            }
                            CurrentDCInstruments. Instruments[ ticket]. CurrentState.Ask = ask;
                            CurrentDCInstruments. Instruments[ ticket]. CurrentState.Bid = bid;
                        }
                    }
                    #endregion
                }

                #region Answer
                byte[] byteAnswer = new byte[300];
                socket. Send( byteAnswer);
                #endregion
            }
            #endregion
            socket.Close();
            Console. WriteLine("Closed " + dealingCenterName + " socket");
        }

Just to have an idea of what exactly is meant by "rest of the code":


And it's all really useless as there are no arbitration situations.

Getch, thanks. I'll add a method to check synthetics. Hadn't thought of it...

 
Fduch >>:


И все это действительно бесполезно, т.к. арбитражных ситуаций нет.


I'm interested in the very idea of getting quotes via a socket. Thanks, I'll have a look later.

Reason: