MT5 and trans2quik.dll - page 4

 
prostotrader:

Has anyone actually worked with this glitch?

I did, and still do. Wrote a couple of years ago, haven't changed anything since then. I don't remember having any problems.

See copies in the manual.

 
Yuriy Asaulenko:

Worked, and continue to work. Wrote a couple of years ago, haven't changed anything since then. I don't remember there being any problems.

See copies in the manual.

YOU try what I described.

result:= T2QSubscribeOrders(PAnsiChar(AnsiString('123')),
                                    PAnsiChar(AnsiString('123')));

Is the result the same as mine?

Can you give me your code if it works?

 
prostotrader:

YOU try what I have described.

Is the result the same as mine?

Can you give me your code, if it works?

The code works, but you have to rip it out of the system, after which it will no longer work, and it will be useless).

Don't see yourT2QSubscribeOrders function in the API manual.

ZZZ I see, I mean function from previous page). Nah, I wrote all the functionality myself using a clean API and the instances are just for reference.

 
Yuriy Asaulenko:

The code works, but you have to rip it out of the system, after which it will no longer work, and it will be useless).

I don't see yourT2QSubscribeOrders function in the API manual.

ZZZ I see, I mean function from previous page). Nah, I wrote all the functionality myself using a clean API and the instances are just for reference.

Ok.

But do you understand how your code works?

Interested in how trans2quik.dll works

I.e. What does (step by step).

For example:

1. Loading DLL.

2. Call TRANS2QUIK_CONNECT

3. Look what the function returns

4. If TRANS2QUIK_SUCCESS, call TRANS2QUIK_CONNECTION_STATUS_CALLBACK

5. If TRANS2QUIK_SUCCESS we call TRANS2QUIK_TRANSACTIONS_REPLY_CALLBACK

//--- load trans2quik.dll ---
    if((QTrader.QuikPath <> '') and (FileExists(IncludeTrailingPathDelimiter(QTrader.QuikPath) + DllName))) then
    begin
      QTrader.Tr2QHandle:= LibLoad(QTrader.QuikPath);
      if(QTrader.Tr2QHandle > 0) then
      begin
        ErrCode:= 0;
        ErrSize:=0;
        ErrStr:= nil;
        res:= T2QConnect(LPSTR(AnsiString(QTrader.QuikPath)), ErrCode, ErrStr, ErrSize);
        case res of
          TRANS2QUIK_SUCCESS: begin
            QTrader.QConn:= true;
            QTrader.DLLConn:= true;
            res:= T2QSetConnStatCB(@pfConnStatusCB, ErrCode, ErrStr, ErrSize);
            if(res = TRANS2QUIK_SUCCESS) then
            begin
              res:= T2QSetTransReplyCB(@pfTransReplyCB, ErrCode, ErrStr, ErrSize);
              if(res = TRANS2QUIK_SUCCESS) then
              begin
                res:= T2QStartOrders(@pfOrderStatusCB);
                if(res = TRANS2QUIK_SUCCESS) then
                begin
                  res:= T2QStartTrades(@pfTradeStatusCB);
                  if(res <> TRANS2QUIK_SUCCESS) then
                  begin
                    Application.MessageBox(PWideChar('Не установлен колбэк статуса сделок!'
                                              + #10#13 +
                                             'Программа будет закрыта.'),
                                             PWideChar('ОШИБКА!'), MB_ICONHAND);
                    close();
                  end;
                end else
                begin
                  Application.MessageBox(PWideChar('Не установлен колбэк статуса ордеров!'
                                              + #10#13 +
                                             'Программа будет закрыта.'),
                                             PWideChar('ОШИБКА!'), MB_ICONHAND);
                  close();
                end;
              end else
              begin
                Application.MessageBox(PWideChar('Не установлен колбэк ответов!'
                                              + #10#13 +
                                             'Программа будет закрыта.'),
                                             PWideChar('ОШИБКА!'), MB_ICONHAND);
                Close();
              end;
            end else
            begin
              Application.MessageBox(PWideChar('Не установлен колбэк соединения!'
                                              + #10#13 +
                                             'Программа будет закрыта.'),
                                             PWideChar('ОШИБКА!'), MB_ICONHAND);
              Close();
            end;
          end;
          TRANS2QUIK_FAILED: begin
            Application.MessageBox(PWideChar('Непредвиденая ошибка при попытке соединения с QUIK!'
                                             + #10#13 +
                                             'Возможно не влючён импорт внешних транзакций.'
                                             + #10#13 +
                                             'Программа будет закрыта.'),
                                             PWideChar('ОШИБКА!'), MB_ICONHAND);
            Close();
          end;
          TRANS2QUIK_QUIK_TERMINAL_NOT_FOUND: begin
            Application.MessageBox(PWideChar('Не найден терминад QUIK!' + #10#13 +
                                             'Программа будет закрыта.'),
                                             PWideChar('ОШИБКА!'), MB_ICONHAND);
            Close();
          end;
          TRANS2QUIK_DLL_VERSION_NOT_SUPPORTED: begin
            Application.MessageBox(PWideChar('Данная версия trans2quik.dll не поддерживается!'
                                              + #10#13 +
                                             'Программа будет закрыта.'),
                                             PWideChar('ОШИБКА!'), MB_ICONHAND);
            Close();
          end;
          //ANS2QUIK_ALREADY_CONNECTED_TO_QUIK:;
          TRANS2QUIK_WRONG_SYNTAX: begin
            Application.MessageBox(PWideChar('Синтаксическая ошибка ы пути к терминалу!'
                                              + #10#13 +
                                             'Программа будет закрыта.'),
                                             PWideChar('ОШИБКА!'), MB_ICONHAND);
            Close();
          end;
          TRANS2QUIK_QUIK_NOT_CONNECTED: begin
            Application.MessageBox(PWideChar('Нет соединения терминала с сервером!'
                                              + #10#13 +
                                             'Программа будет закрыта.'),
                                             PWideChar('ОШИБКА!'), MB_ICONHAND);
            Close();
          end;
          TRANS2QUIK_DLL_NOT_CONNECTED: begin
            Application.MessageBox(PWideChar('Не соединения библиотеки с терминалом!'
                                              + #10#13 +
                                             'Программа будет закрыта.'),
                                             PWideChar('ОШИБКА!'), MB_ICONHAND);
            Close();
          end;
          TRANS2QUIK_MEMORY_ALLOCATION_ERROR: begin
            Application.MessageBox(PWideChar('MEMORY ALLOCATION ERROR!'
                                              + #10#13 +
                                             'Программа будет закрыта.'),
                                             PWideChar('ОШИБКА!'), MB_ICONHAND);
            Close();
          end;
          TRANS2QUIK_WRONG_CONNECTION_HANDLE: begin
            Application.MessageBox(PWideChar('WRONG CONNECTION HANDLE!'
                                              + #10#13 +
                                             'Программа будет закрыта.'),
                                             PWideChar('ОШИБКА!'), MB_ICONHAND);
            Close();
          end;
          TRANS2QUIK_WRONG_INPUT_PARAMS: begin
            Application.MessageBox(PWideChar('WRONG INPUT PARAMS!'
                                              + #10#13 +
                                             'Программа будет закрыта.'),
                                             PWideChar('ОШИБКА!'), MB_ICONHAND);
            Close();
          end;
        end;
      end else
      begin
        Application.MessageBox(PWideChar('Не загружена библиотека трансакций!'+ #10#13 +
                                          'Программа будет закрыта.'),
                                           PWideChar('ОШИБКА!'), MB_ICONHAND);
        Close();
      end;
    end;


and so on, how is it done?

 
prostotrader:

and so on, as you have done?

Something like this. Connect, check, subscribe to colbecs, transfer transactions. The API is small, there's no other way to do it. Only you have your own API wrapper, while I have an API immersed in a class.

By the way, it's Sunday today, the market is dead. You can't really check anything.

 
Yuriy Asaulenko:

Something like this. Connect, check, subscribe to colbecs, transfer transactions. The API is small, there's no other way to do it. Only you have your own API wrapper, while I have API immersed in a class.

By the way, it's Sunday today, the market is closed. Can't really check anything.

Quirk-demo is working (I am working)

 
prostotrader:

Qurick demo is working (I am working)

I don't have a demo. I don't need it.

By the way, I remember that in another terminal, not in Quick, some of the functionality with demo requests didn't work.

I do not understand what is the problem? I don't understand what the problem is with the 123, if I want to use SPBFUT and SRZ8 or data of a specific symbol(s) and then watch the events before and after.

I don't understand what you are doing and why.

 
Yuriy Asaulenko:

I don't have a demo. I don't need it.

By the way, I remember in another terminal, not in Quick, some of the functionality with demo bids didn't work.

I do not understand, what is the problem? I don't understand what the problem is with the 123, if I want to use SPBFUT and SRZ8 or data of a specific symbol(s) and then watch the events before and after.

I don't understand what you're doing and why.

Just made a mistake and the function returned that everything is correct.

Tried 123 and... it came back correct.

So I thought maybe there's something I'm doing wrong...

 
prostotrader:

Just made a mistake and the function returned it as correct.

Tried 123 and... it came back correct.

So I thought maybe I was doing something wrong...

If you're working with Quick Junior, it's an odd design, imho. When I switched to Quick, I decided to see what the beast was, and it didn't work with Junior, not at all.

 
Yuriy Asaulenko:

If you work with Quick Junior, it's an odd design, imho. When I switched to Quick, I decided to see what it was all about, and it didn't work for me with Junior, not at all.

I don't have a problem.

Reason: