You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
So initializing inDLL_PROCESS_ATTACH: will be enough to call from mql program?
From mql program to call its functions located in dll.
From the mql program to call its functions located in the dll.
And what's the problem with describing their signatures? Don't you pull winapi somehow via method signatures?
I'm sorry, why describe them? And I'm sorry, I didn't pull anything))
I'm sorry, why describe them? And I'm sorry, I didn't pull anything))
Dear forum users.
Andrey, I think everyone understands that asynchrony and multithreading are different things.
Since the CreateThread() function is described in the WinAPI inluder, it was assumed that threads could be used.
There are no functions similar to CreateTask() described in the IDE, so the assumption of possible asynchronous code writing disappears by itself.
Therefore, emphasis was placed on threads. However, as it turned out, the described functions are only WinAPI prototypes.
I repeat, the task was to use pure WinAPI and the described prototype CreateThread() was misleading. It is not said anywhere that these are prototypes.
All tasks are different, so I got to the asynchronous method and I believe that it is better to always write asynchronously or in threads,
And developed the habit of always writing asynchronously, will allow you to write fast programs, and raise your level as a specialist.
It's the basic principle of the developers themselves, the speed of execution of mql programs, is our everything!
It is a pity that mql has no such a feature,
I make a suggestion to the mql administration to develop standard mql functions for asynchronous programming,
since there are problems with threads and, above all, security.
For asynchronous mode I think there are no safety issues.
Example logic
Work out the implementation of EventLoop in mql.
create the MqlTask class
Declare the tasks as MqlTask object obj;
create task task = obj.CreateTask(MyFunc());
execute success = task -> Run();
pause execution success = task -> SleepMs(ms);
wait for success = task -> Wait(ms);
wait indefinitely success = task -> Wait(0);
remove the task after it executes delete task;
and all sorts of getStatuses to control it.
Andrey, I think everybody understands that asynchronous mode and multithreading are different things.
The WinAPI's inluder contains the CreateThread() function and we had assumed that threads could be used.
Since there are no functions similar to CreateTask() described in the IDE, we should not consider possible asynchronous code writing.
Therefore, emphasis was placed on threads. However, as it turned out, the described functions are only WinAPI prototypes.
I repeat, the task was to use pure WinAPI and the described prototype CreateThread() was misleading. It is not said anywhere that these are prototypes.
All tasks are different, so I got to the asynchronous method and I believe that it is better to always write asynchronously or in threads,
And a developed habit to always write asynchronously, will allow you to write fast programs and raise your level as a specialist.
It's the basic principle of the developers themselves, the speed of execution of mql programs, is our everything!
Too bad there is no such a feature in mql, so I will make a suggestion to the mql team to develop a standard mql function
for asynchronous programming, since there are problems with the threads and, above all, security.
I think there are no security obstacles for asynchronous mode.
To work out the implementation of loop loops, and execute tasks in these loops.
Make up your mind whether you want to execute methods asynchronously or multithreaded. I, for example, work with sockets asynchronously from mql.
In order to determine what is possible to use in mql and what is forbidden.
CreateThread() was found in the inludes, so I thought it was possible to work with threads.
But as it turned out threads are forbidden, so the choice falls on async, but how to use async in mql is also not clear.
Yes, that's exactly the problem with sockets. The help says that no more than 128 sockets can be created, which limits getting information on American stocks, for example.
And even those 128 sockets it's not clear how to convert it into asynchronous mode and avoid delays in processing incoming data.
That's why I had to search for solution to the problem in another way,but I wanted to solve it in pure WinAPI, without any self-written dll.
And how to work asynchronously in mql it's interesting, if you have any working examples, it would be good to discuss them, if you can share the information.
But the standard asynchronous methods in mql help I have not seen.
In order to determine what is possible to use in mql and what is forbidden.
I found CreateThread() in the code's injectors, so I thought I could handle threads.
But as it turned out threads are forbidden, so the choice falls on async, but how to use async in mql is also not clear.
Yes, that's exactly the problem with sockets. The help says that no more than 128 sockets can be created, which limits getting information on American stocks, for example.
And even those 128 sockets it's not clear how to convert it into asynchronous mode and avoid delays in processing incoming data.
That's why I had to search for solution to the problem in another way,but I wanted to solve it in pure WinAPI, without any self-written dll.
And how to work asynchronously in mql it's interesting, if you have any working examples, it would be good to discuss them, if you can share the information.
But the standard asynchronous methods in mql help I have not seen.
I read the smart participants and I wonder...
What's the point of all these gimmicks?
When in MQL would the multi-threading be so terribly needed? To me, the only use would be strategy testing, which is implemented in the standard way.
Ideally, it might make sense to run several WebRequests, but I don't think multi-threading is needed at all.
What tasks require multithreading in the first place?