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
Would it make it easier if I said it did?)
Yep. 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 you will find this error.
In my code this error will not occur, as this function is called AFTER OrderSelect(). This check is inherited from the time when codes were written without a common structure of all executable EA functions.
In addition, most of my functions contain error handling functions and I am very careful to avoid them. And there are also a number of functions that generate an error, like the answer you were looking for:"Order selected earlier, or not?"
P.S. By the way, I remembered one peculiarity (may be useful for someone) of working with OrderSelect() functions from compiled libraries: we have selected an order (how - not principally), OrderTicket() - returns number of selected order. But if we want to get the properties of this selected order from the function which is located in the compiled library, we will get nothing. We have to select that order again (again).
I don't know if it's easier or not, but they took me from my first year, such was the time, or I would never have served!
Are ticket and magik no longer identifiers? Or is it principled to work with two or three orders at once? There are arrays, there are functions that process and update these arrays. Or is it principled not to get caught in the mistake? So, do not get into mistakes. But do not whine that excessive order selections slow down testing. Everything has its time and place. When getting from one function to another, be a priori sure that you will have to select the order once again, while storing the processing data from the previous function in an array.
I liked it:)
Dimitri, even without leaving the confines of one function, you cannot be sure that the order selection sign will not change.
That's what I mean. My functions have no universality, each one is strictly engaged in its own business. Even buy and sell are separate. Slosewall does not leave the function until the entire order is executed. So, let the order numbers change, let the stops creep, but the ticket and the magician will stay.