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

 
EVGENII SHELIPOV #:

To see it, you have to make the orders close, but in this EA it doesn't happen. And the whole problem happens after the max order is closed

Once again, the way you framed the question is misleading.

You could have just written "the whole problem happens after the max order is closed ".

Try adding a line to OnTick()

   if(prev_ticket==GetTicketMaxOrder())prev_ticket=prev_ticket-1;
 

you cannot compare object identifiers to <> . only equal / unequal (it / not it)

the ticket number is unique in some frames, but nobody, nowhere and in no way guarantees or even promises their priority

if you want newer orders to get a bigger ticket, then you are only writing to the tester (and even that is questionable)

 
Maxim Kuznetsov #:

you cannot compare object identifiers to <> . only equal / unequal (it / not it)

the ticket number is unique in some frames, but nobody, nowhere and in no way guarantees or even promises their priority

if you say that newer orders get a bigger ticket, then you are only writing to the tester (and even that is questionable)

It has already been said and here is the answer

Forum on trading, automated trading systems and strategy testing.

Any MQL4 and MQL5 beginners questions, help and discussion on algorithms and codes

MakarFX, 2021.11.03 21:01

It doesn't have any pending orders but you're right anyway.

For that it has a function to search for the last open


 
Hello. Do I understand correctly that an EA/indicator via onBookEvent can only work on one symbol? And there is no human way to make it take into account the changes of another symbol's stack?
 
Scarick #:
Hello. Do I correctly understand that an EA/indicator via onBookEvent can only work for one symbol? And there's no human way to make it take into account the changes of another symbol's stack?

You've got it wrong.

bool  MarketBookAdd( 
   string  symbol      // символ 
   );

What characters you subscribe to, OnBookEvent() will work for them. You just need to check which character the event came for.

void OnBookEvent (const string& symbol);
 
MakarFX #:

Once again the question is misleading.

You could have just written that " the whole problem happens after the max order is closed ".

Try adding a line to OnTick()

Yeah, I don't know what to say.

 
EVGENII SHELIPOV #:

I don't know what to say, Makar.

I think we should start again tomorrow, so to speak, from the beginning.

 
EVGENII SHELIPOV #:

Yeah, I don't know what to say, Makar.

Или так https://www.mql5.com/ru/forum/160683/page1715#comment_25632530

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

You've got it wrong.

What characters you subscribe to, OnBookEvent() will work for them. You just need to check for which symbol the event has arrived.

So, if I subscribe to 5 symbols in the indicator, I can work with all 5 symbols only with one OnBookEvent()? The main thing is only to filter by which symbol the change occurred?

 
EVGENII SHELIPOV #:

Или так https://www.mql5.com/ru/forum/160683/page1715#comment_25632530

Maxim Kuznetsov #:

the ticket number is unique within some limits, but no one, nowhere and in no way guarantees or even promises their lineup

You need to take into account what knowledgeable people write.

You are better off looking by opening times, i.e. the lowest ticket is opened first and the highest is opened later.

Reason: