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
I don't see a problem. What's the big deal... You need to select an order in one main function A(), and in another function B(), called from the main function A(), to process the order selected in function A(). And we should know for sure in function B() whether or not the order is still selected... So pass to function B() the ticket of the order selected in function A(). In function B(), we can check from which list the order is selected and then decide where to go and what to return back to function A()...
You've got me all wrong. So do half of the people for some reason. I don't need in function B() to process that order, which is selected in function A(). Function B() works with other orders, no matter which ones, it has nothing to do with function A(); function B() has its own logic. It can count the number of orders, their total profit, look through their comments, TP SL, etc. The task is to return from function B() back to function A() such that no matter what function B() has done with the orders, the logic of function A() at the point of call of function B() from it would not be violated due to the fact that the order selected by function A() before function B() was called is not selected anymore and the selected order is another random order processed by function B() that most probably also searches orders in the loop.
Now let's imagine what will happen to the last_select variable after restarting the terminal (the lights are turned off by nasty guys)
After restarting last_select variable will be initialized to 0, as required.
There's 10 pages of blah, blah, blah. Here is the code that provides for the function to work with another (not highlighted) order:
this is just an example. A person who understands the point will catch on.There's 10 pages of blah, blah, blah. Here is the code that provides for the function to work with another (not allocated) order:
this is just an example. A person who understands the point will catch on.That's not the point. There are variables, local or global, in the EA and there are terminal variables. As far as the program is concerned, these variables are interactive, and their value can change in an absolutely inexplicable way for the EA at any moment. The order selection sign is just such a variable. If Metaquotes allowed access to the "select" attribute of a graphic object, it would be the same as well. This would inevitably lead to the following conclusion: we should select an order whenever we need to know the number of the selected order or remember the selected order if and only if it is required by the logic of the Expert Advisor. So it goes like this...
This is not the point. There are variables, local or global, in the EA and there are variables of the terminal. These variables are interactive from the program's point of view, and their value can change in an inexplicable way for the EA at any moment. The order selection sign is just such a variable. If Metaquotes allowed access to the "select" attribute of a graphic object, it would be the same as well. This would inevitably lead to the following conclusion: we should select an order whenever we need to know the number of the selected order or remember the selected order if and only if it is required by the logic of the Expert Advisor. So it goes like this...
I totally agree with you:
P.S. And I do the above check in the code "just in case"... :)
:)
Happy Holidays! For me - 20 years, not the worst in my life.
There's 10 pages of blah, blah, blah. Here's the code that provides for the function to work with a different (not highlighted) order:
This is just an example. A person who understands the point will catch on.Yup. right there:
int li_LastTicket = OrderTicket();
Your code will generate a 4105 execution error if there was no OrderSelect call before it was made. Just put a GetLastError check at the end of each tick and detect this error.
:)
Happy Holidays! For me - 20 years, not the worst in my life.
Congratulations! Have you served Faith and Truth for 20 years?
Her, my dear.
So over-enlisted, as they used to call me in my day, or maybe even now, a piece of...? :)