[ARCHIVE] Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 3. - page 6
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
Recalculate with each tick the number of pending orders.
If there are fewer of them, it means that one pending order has become a market order.
All remaining ones (which have become unnecessary) can be deleted.
At the time of deletion, both orders are market orders. But even if the last pending order is deleted or triggered, its ticket is still triggered and generates an error. And the penultimate one is still pending.
Thanks for the link!!! Will look into it :) With time, as well as magic number and by order type (bylimit or selllimit) is a good idea. But you probably didn't quite understand me. My problem is not marking the order, but HOW TO REMOVE IT. I am only able to delete the last pending order no matter how I define the penultimate one.
As I understood from your first post "I use the following example for definition, but it closes only the last pending order instead of the first one, though all conditions are fulfilled for the first pending order. Help me find error!!!!!!!!!!!!!" - you need to delete all remaining pending orders, after turning some of them into market orders - this code should be entered into your trading conditions and go ahead...
Thanks!!! Did not expect it to be so complicated :)))
As I understood from your first post "I use the following example for definition, but it closes only the last pending order instead of the first one, though all conditions are fulfilled for the first pending order. Help me find error!!!!!!!!!!!!!" - you need to delete all remaining pending orders, after turning some of them into market orders - this code should be entered into your trading conditions and go ahead...
Thought it might take a couple of lines ... :)
At the moment of deletion, both orders are marketable. But even if the last pending order is deleted or triggers, the ticket that triggered it will still show an error. The penultimate one will still be there.
I can't even imagine how this is possible.
If after recalculating the pending orders the Expert Advisor fails to find one order, it immediately issues a command to delete the rest.
The operation of deleting the pending orders not needed must necessarily precede (precede) any opening operation.
As I understood from your first post "I use the following example for definition, but it closes only the last pending order instead of the first one, though all conditions are fulfilled for the first pending order. Help me find error!!!!!!!!!!!!!" - you need to delete all remaining pending orders, after turning some of them into market orders - this code should be written in your trading conditions and go ahead...
Here is your code:
Thought it might be possible to fit in a couple of lines ... :)
Well. artmedia70 (24.07.2011 20:01) has packed everything into almost two lines. Just as you wanted)))
Please help me, where am I making a mistake? The idea is that on the bar where the order was closed, the order should not open
But in the tester, after the order is closed, the conditions are still fulfilled and 1 more order is opened in the same direction
Have you never tried writing codes compactly?
Here is your own code:
Please help me, where am I making a mistake? The idea is that on the bar where the order was closed, the order should not open
But in the tester, after the order is closed, the conditions are still fulfilled and 1 more order is opened in the same direction
To help, google this and search for something like: open and close one order on one bar site:mql4.com - and you will be in luck.