Discussion on "How to write a DLL for MQL5 and exchange data in 10 minutes". - page 2

 
I haven't tested one thing in MQL5 with passing strings to dll yet

I've noticed this problem with string passing in MQL4-DLL. In MQL4 code I call function in DLL and pass the string:

#import "MyDll.dll"
 void passSymbol(string symb);






void start() {

    passSymbol(Symbol());

}

and in dll I receive this string with a tool name.

_DLLAPI int __stdcall passSymbol(char* symbol) {
   указатель symbol в какой-то момент не содержит имени инструмента а левые символы вообще.
}


At a certain moment, on some tick (it may work fine for half a day) the dll suddenly receives a left-handed string with unclear characters instead of the instrument name.
Maybe you can check a similar code in mql5? The memory pointer seems to be incorrect in MQL4 or sometimes there is a conflict of access to the string of threads inside the terminal.

The double arrays and int variables pass through correctly without any problems.

I will write a test for MQL5-DLL as soon as time will appear. But if you are also testing this stuff, write such a test to verify the stability of string passing to dll, by repeating the process on every tick for a long period of time.

 
GarF1eld:

If it is possible to export quotes only through dll, then it means that a script should be placed on each instrument to be exported? What if there are many of them? For example, 50?

I understand that it is possible to pass quotes for many instruments in one script, but it will not be a full-fledged substitute for DDE, where ticks are not lost.

Renat:

The matter is that we don't have the task "to provide the interface for giving quotes".

Our task is to create a complete and self-sufficient environment for developing analytical systems. Such an environment so that even third-party programs would not need to be used.

The answer is certainly interesting. The subject heading "How to write a DLL for MQL5 and exchange data in 10 minutes" is worth to see this article " Data transfer between indicators - a simple solution of a painful problem " and compare it with the above mentioned problem (italicized).
 
Renat:

The point is that we are not tasked with "providing an interface for issuing quotes".

Our task is to create a complete and self-sufficient environment for the development of analytical systems. Such an environment so that even third-party programs do not have much need to be used.


The GUI is very weak - it took 2 days to write the logic, and it took a whole day to display the calculated information in any way

As a result I disabled everything - I built the data transport(https://www.mql5.com/ru/forum/382) and am happy now.

Aren't the developers setting their sights too high?

And why reinvent the wheel, if everything was already done a long time ago (C, Delphi, ...)?

 
yu-sha:

The GUI is very weak - it took me 2 days to write the logic, and it took me a whole day to display the calculated information in any way

In the end I gave up on everything - I built the data transport(https://www.mql5.com/ru/forum/382) and am enjoying my life

Aren't the developers setting their sights too high?

And why reinvent the wheel when everything has already been done a long time ago (C, Delphi, ...)?

IMHO the problem with MT5 started with its inception: the lack of a clear vision of what this product is supposed to solve. Either it is an upgraded and based on MT4 but raised to a new version in terms of speed and extended functions, or it is a new modern trading platform with a well thought out structure and extensibility (i.e. containing business classes, or trading framework, to perform clearly defined specific classes of tasks, and based on some modern programming language/environment with its general functionality and widely available software support tools). To solve this dilemma by attempting to combine opposites, by brewing a kind of compote, so to speak, by the method of "impromptu of the most talented soloists", it seems not quite succeeded.

If it seems to someone pure rubbish without a shadow of constructive, for the second time lead to a bathhouse, or shoot him down for good :)

 

2pisara

Get to the root of it.

MQL is more for traders with little programming skills. A la Basic for dummies.

I have nothing against such a position - thank you for that too.

But positioning MQL5 as"a complete and self-sufficient environment for the development of analytical systems. This is the kind of environment where even third-party programs don't need to be applied."This is a serious request. It will take years of work, not just by individual enthusiasts, but by a team of professional programmers under the direction of a good architect to "bind" the core with some digestible soup set. I can't say anything about budget and management - that's another level of the project.

I want to support the employees of the company in their hard work. I want to say thank you for their hard work. But let's face it - MQL5 is just a stage in achieving the goal.

P.S. Moscow was not built in a day

 
Yes, it's scary to think or remember how many unnecessary things each of us has done, is doing and will continue to do!
 
Renat:

It's very easy to check the call speed. For example, you can roughly calculate it like this:

I got 57,000 calls per second on a Quad Q9400 @2.66Ghz. The same code gives about 20,000,000 calls per second in MetaTrader 4, as there is no control and piping.

We will definitely try to reduce the loss on DLL calls in MetaTrader 5.

It would be good to make a special directive to the compiler, which is enabled by default and which inserts these wrappers to the DLL calls. When disabled, it's a good idea not to insert these wrappers. Like debug and release mode. Still, sometimes 57K is not enough. The same time is eaten up by the running time of the dll.
 
HideYourRichess:
It is a good idea to make a special compiler directive which is on by default and which inserts these wrappers into the dll calls. When disabled, it's a good idea not to insert these wrappers. Like debug and release mode. Still, sometimes 57K is not enough. The same time is eaten up by the dll's runtime.
The 240 build has simplified the wrappers, now the call rate is 19,911,000 calls per second.
 
About the MQL / MQL2 / MQL4 / MQL5 discussion: apparently, you don't know our history very well. At least go to the corporate website and read it.


We have methodically created 4 generations of trading languages since 2001 with a huge community of traders. Competitors were dying, their control languages did not develop, while we have worked, are working and will continue to work.

 

Renat: 

and we have worked, are working and will continue to work.

As the Great Grandpa Lenin bequeathed.

;)

I don't remember, I think I've asked before...
Is it possible to create simple dlls using the µl5 tools,
just write it in unitor and compile it...?