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 that's my point. My functions have no versatility, each is strictly dedicated to its own business. Even buy and sell are separate. So, let the order numbers change, let the stops creep up, but the ticket and the magician will remain.
Well, you got carried away with the slosoll:)
Well, you got carried away with the clobbering:)
There have been no misses yet. I'm a tyrant in that respect:)
No, not like cheese in butter, but I did my fair share of service as a lieutenant colonel. Sorry if I offended you :(
No, no reason to be offended, you don't have to commit if I said something wrong, but sincerely. :)
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 orders, the logic of function A() operation at the point of call of function B() from it will 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.
You keep forgetting that only one order can be selected at any one time. Exit = store the list of orders in a savings pool (your array). one global variable lastorder is not enough. a better option would be lastords[ticket][function].
In my code, this error will not occur, because this function is called AFTER OrderSelect(). And the check in the code is left from the times 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).
In fact, I encountered a situation where the error was caused by one of the general-purpose functions that could be used both within the order processing loops and outside those loops, i.e. before the order was selected, which led to the error. If we want to make universal service functions working with orders that can be used both after an order has been selected and before that, both when there are open orders and when there are none, we should use a mechanism like the one I cited to make sure we don't get this error.
I already wrote earlier in this thread about the fact that order selection is not passed to library modules and back.
In fact, I encountered a situation where the error was caused by one of the general-purpose functions that could be used both inside and outside the order processing loops, i.e. before an order was selected, which caused the error. If we want to make universal service functions that work with orders and can be used both after an order has been selected and before that, both when there are open orders and when there are no orders at all, we should use such mechanism as I mentioned on the previous page to avoid this error.
I already wrote earlier in this thread about the fact that order selection is not passed to library modules and back.
You should make yourself accustomed to the fact that each trade operation has its own select order and you won't have any problems. And, yes, you have been correctly written, only one order can be selected. Everything else is solved by arrays.