Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 1847

 
EVGENII SHELIPOV #:

What do you think, if I add the condition of profit calculation > 0 to the function of all orders closing, will it change?

I have this condition in the command to close orders

We need to add a check
 
EVGENII SHELIPOV #:

What do you think, if I add the condition of profit calculation > 0 to the function of all orders closing, will it change?

I have this condition in my command to close orders

Judging by your question, orders are not closed by the broker. If you send a request to the server to close an order (OrderClose) and it is not closed as a result of this request, you cannot change anything here using the code.

Любые вопросы новичков по MQL4 и MQL5, помощь и обсуждение по алгоритмам и кодам
Любые вопросы новичков по MQL4 и MQL5, помощь и обсуждение по алгоритмам и кодам
  • 2022.01.05
  • www.mql5.com
В этой ветке я хочу начать свою помощь тем, кто действительно хочет разобраться и научиться программированию на новом MQL4 и желает легко перейти н...
 
EVGENII SHELIPOV #:

What do you think, if I add the condition of profit calculation > 0 to the function of all orders closing, will it change?

I have this condition in the command to close orders

Add a flag to close until it closes and any broker will work.
 
Tretyakov Rostyslav #:
Add the flag to close until it closes and any broker will work.

Now we are having a constructive conversation.

Rostislav, if you can elaborate on the flag.

Or not so for dumb people, spell it out.

 
EVGENII SHELIPOV #:

Now we are having a constructive conversation.

Rostislav, if you can elaborate on the flag.

Or not so spell it out for the dumb ones.

Would you post the code OnTick() ...

Not the entire code, just those parts where CountTrade() is checked

 
Tretyakov Rostyslav #:

Post the OnTick() code ...

Not all of it, just the parts where CountTrade() is checked.

Inbox

 
EVGENII SHELIPOV #:

In private

OK
 
EVGENII SHELIPOV #:

In private

Check
 
Tretyakov Rostyslav #:
Check

Honestly, it's not clear
What can this expression change
if(flag_close==1)ClosseAll();
If you can explain

 
EVGENII SHELIPOV #:

Personal correspondence is recommended in private messages.