![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
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
Can you tell me how to catch the window called by F9 (Order)?
Can't find it by text.
So far it has been caught as follows:
Hello!
Can you tell me how to determine the MT descriptor from an EA running in the tester?
The construct:
does not work, becauseReturns 0.
Is a graph like this open at this point? (with the specified symbol and period)
Is a graph like this open at this point? (with specified symbol and period)
Yes, of course.
Tried it both ways.
Or is it a feature of WindowHandle function (although there is no word about it in help...)
Or maybe I'm dumb...
Yes, of course.
Tried it both ways.
Or it's peculiarity of WindowHandle function (though help doesn't say anything about it...)
Or maybe I'm dumb...
In that case, the only way out is to search for a Metatrader window in the list of all windows using FindWindowExA(...)
In visualization mode, the handle is obtained without any problems. But you must be testing NOT in visual mode. Then it makes sense: no window, no handle. As for the other open windows, I understand that they are not accessible from the tester.
In that case, the only way out is to search for the required window in the list of all windows using FindWindowExA(...).
Yes, I tried to apply Ilnur's code from page 5:
Here's an example of a script that starts a strategy tester and waits for it to complete. The button text is read with GetWindowTextA().
Interestingly, the tester window does not necessarily have to be visible in this case.
But from tester this trick didn't work. (I'm launching another terminal for optimization from tester and want to track completion of this process.)
If it's not too difficult, can you give me an example for FindWindowExA(...) or a link?
Here I have such a function for finding a window:
Look up the class name and title of the required window in SPY++.
I commented out the thread ID check because it is not needed in this case (there is no source window to compare).
In general, I advise you to handle WinAPI functions, if you're going to use them. Please refer to MSDN(http://msdn.microsoft.com/en-us/library/ff818516.aspx) for detailed description of the functions.
please advise how to correctly get a list of tools in the Order window (F9)?
I get the number of elements, but can not get exactly the rows by number, returns -1.
#define ID_SYMBOL 0x053E //character name to select
cmhandle ComboBox
Here I have such function for window search:
Alexey, thanks, the function works, but...
I've commented out the flow ID check because it's not needed in this case (we don't have a source window to compare).
Just the thread ID is needed, as I have two terminals involved.
I got out of it through header identification, but I would still like to know how to determine flow ID from under the tester?