I have a function for all modifications such as setting SL and TP, transferring to B/S, trawling positions and orders with attempts and error checks.
I only need to prescribe position selection, conditions and warnings in the start. Here is the function:
Small but clever!
By the way, your function only modifies orders. And the conditions are already all in the start. And I have all the conditions in the function. It turns out that there will be a lot of conditions placed in the start and it would be very unreasonable to overload it, wouldn't it? After all, the essence of function is mostly in conditions, not only in bare modification function, of course with displaying errors. But somehow you have a strange approach. I have not yet encountered it. I look and I am surprised.
By the way, your function only modifies orders. And the conditions are already all in the start. And I have all conditions in the function. It turns out that there will be a lot of conditions placed in the start and it would be very unreasonable to overload it, wouldn't it? After all, the essence of function is mostly in conditions, not only in bare modification function, of course with displaying errors. But it is a strange approach. I have never seen such an approach. I look at it and wonder.
Everyone chooses what is convenient to him! I have the advantage that one function precisely fulfills all possible modifications of a pending and open position. I specify all necessary conditions in the start line that may change frequently depending on the market whims. This gives me great flexibility in my work. In contrast, you need to have a lot of functions and still have to prescribe all of the conditions in the Start and in the Functions. You will gradually come to your own comfortable manner. But the main thing is to achieve a clear logic and error-free operation of the program. I wish you success!
Variable e is the variable (for order, see OrderModify() doc), which I must specify, if I want to use arrow_color, one for bai and another for sell, and I can vary colour for orderModify()). After all, the program doesn't go into such details at once, as we do, but one by one, defining parameters by their place of presentation in the standard OrderModify() function.
borilunad: Variable e is an expiration (for orders, see Doc OrderModify()), which I must specify if I want to use arrow_color, for bai one, and for sell another, and for orders I can diversify the colour). After all, the program doesn't go into such details at once, as we do, but one by one, defining parameters by their place of presentation in the standard OrderModify() function.
You can set it to 0(zero), since usually the expiration is not required. But you probably have it in case of emergency, so that you don't have to return to this point.
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
... I've put it in for you. You can do the same in your post.
Sorry, it won't work! Not the first one, not the last one!
Why? Because the last order is OrdersTotal()- 1, and the first order has an index of 0 . Why then it won't work?
I have a function for all modifications such as setting SL and TP, transferring to B/S, trawling positions and orders with attempts and error checks.
I only need to prescribe position selection, conditions and warnings in the start. Here is the function:
Small but clever!By the way, your function only modifies orders. And the conditions are already all in the start. And I have all the conditions in the function. It turns out that there will be a lot of conditions placed in the start and it would be very unreasonable to overload it, wouldn't it? After all, the essence of function is mostly in conditions, not only in bare modification function, of course with displaying errors. But somehow you have a strange approach. I have not yet encountered it. I look and I am surprised.
By the way, your function only modifies orders. And the conditions are already all in the start. And I have all conditions in the function. It turns out that there will be a lot of conditions placed in the start and it would be very unreasonable to overload it, wouldn't it? After all, the essence of function is mostly in conditions, not only in bare modification function, of course with displaying errors. But it is a strange approach. I have never seen such an approach. I look at it and wonder.
Why? Because the last order is OrdersTotal() - 1, and the first order has index 0 . Why then it won't be?
For the last order there is a function at Kim's where he compares by time to avoid errors, and for the first order.
You think of everything at once, but the computer thinks one at a time, say 0 or 1, then again, 0 or 1, and again 0 or 1, etc.
So you have to do by the logic of the machine, not ours. And the reward will be an error-free program! Good luck!
Use theSRC button at the top to insert code! No one will poke around like that. I've pasted it for you. You can do the same in your post.
I have a function for all modifications such as setting SL and TP, transferring to B/S, trawling positions and orders with attempts and error checks.
I only need to prescribe position selection, conditions and warnings in the start. Here is the function:
The little one!Boris. Why do you have the variable e here ?
Boris. Why do you have variable e here ?
Variable e is an expiration (for orders, see Doc OrderModify()), which I must specify if I want to use arrow_color, for bai one, and for sell another, and for orders I can diversify the colour). After all, the program doesn't go into such details at once, as we do, but one by one, defining parameters by their place of presentation in the standard OrderModify() function.
You can set it to 0(zero), since usually the expiration is not required. But you probably have it in case of emergency, so that you don't have to return to this point.