[Archive!] Any rookie question, so as not to clutter up the forum. Professionals, don't pass it by. Couldn't go anywhere without you - 2. - page 61

 
How many orders can you have open?
 
sergeev:
How many orders can you have open?

I trade in one order (e.g. buy) and one more is possible as a counter position (safe) for a lock.
 
if (OrdersTotal()>1) return;
if (!OrderSelect(0, SELECT_BY_POS)) return;
if (OrderType()==OP_BUY)
{
// ...
}
 
The situation is such that when this very lock occurs, the EA must be prohibited from trading (monitor the occurrence of other conditions)
 
nemo811:
The situation is such that when this very lock occurs, the EA must be prohibited from trading (to monitor the occurrence of other conditions)
written above.
 
sergeev:

Thank you, not a programmer myself - it took me 24 hours of digging. Thank you.
 
sergeev:

If it didn't, it would swear that it doesn't, but it does.

check the MAIN name - maybe Russian A stands...


Thanks for the reply!

Checked everything, it's all written in English, and there's no error when transferring the declarations of these variables to the main file...

Bigot! I don't know how it worked, I moved the files from the include folder to libariries and back and everything worked...

sergeev, what could be the problem here?

 
sergeev:


This code counts both market and pending orders and therefore automatically prohibits taking a profit on a market (open) order. Can we make it so that the pending order is not taken into account, and only those orders that have already become market orders are counted?

I am sorry if I have misled you.

 
nemo811:


This code counts both market and pending orders and therefore automatically prohibits taking a profit on a market (open) order. Can we make it so that the pending order is not taken into account, and only those orders that have already become market orders are counted?

Sorry, if I misled you.

Then instead of OrdersTotal(), make your own counter for market orders only.

 
sergeev:

then instead of OrdersTotal(), make your counter a market oreder only.

Thanks for the tip, let's work and study ))))