[ARCHIVE]Any rookie question, so as not to clutter up the forum. Professionals, don't pass it by. Can't go anywhere without you - 5. - page 211

 
polycomp:
That's what I do, but here's some advice from Vinin with the exact opposite meaning.

We don't understand each other, apparently.
 
hoz:

The OrderSend() help states:

" Returns the ticket number assigned to the order by the trade server or -1 in case of failure. "

When testing the Expert Advisor, the tickets start from 1 and above. Why is there no ticket number 0 (zero) ?


Victor, this is not a ticket, the index(i)! It starts with the earliest of the open positions with index 0. And you can recognize the ticket too, and it doesn't change, because it is saved by the server. And when testing, tickets start from 1 and have nothing to do with the server's ticket.
 
hoz:

The OrderSend() help states:

" Returns the ticket number assigned to the order by the trade server or -1 in case of failure. "

When testing the Expert Advisor, the tickets start from 1 and above. Why is there no ticket number 0 (zero) ?


And that's what I wanted, to make it easier to count. Why do you need the ticket № 0? Besides, this is a tester, your ticket will be something like #2284873738.
 
borilunad:

And you can find out the ticket too, and it does not change, because it is saved by the server. And in testing, the ticket starts from 1 and has nothing to do with the server's ticket.

Boris, the ticket of a specific orderdoes not change. And every subsequent order opened gets a new ticket. That's why I asked why the tickets start with 1 and not 0. At least in the tester. Because on the real account, tickets have the form as Alexei said above such as 6023449...

I asked this question because I've studied one Expert Advisor and it has such a feature:

if (Buy_ticket != 0)
{
// Что-н. делаем дальше..
}

If the Expert Advisor is for a real account, then ... how will the ticket be equal to zero? I did not notice that.

 
For any account it will be positive. And there is an error in the expert you have studied.
 
tara:
For any account it will be positive. And there is an error in Expert Advisor that you have studied.


!= 0, it does not mean negative, it can be from 1 to infinity. In fact, here's what I'm looking at:

https://www.mql5.com/ru/articles/1524

I can see that the writing is somehow crooked. But it is interesting, just to learn how to work with graphics. I want to place pauses on an object. I don't see it anywhere else.

 
hoz:


!= 0, it doesn't mean negative, it can be from 1 to infinity. Actually, this is what I'm looking at:

https://www.mql5.com/ru/articles/1524

I can see that the writing is somehow crooked. But it is interesting, just to learn how to work with graphics. I want to place pauses on an object. I don't see it anywhere else.


The graphics are simple. And Puck is a great craftsman.
 
hoz:

Boris, the ticket of a specific orderdoes not change. And every subsequent order opened gets a new ticket. That's why I asked why the tickets start with 1 and not 0. At least in the tester. Because on the real account, tickets have the form as Alexei said above such as 6023449...

I asked this question because I've studied one Expert Advisor and it has such a feature:

if (Buy_ticket != 0)
{
// Что-н. делаем дальше..
}

If the Expert Advisor is for a real account, then ... how will the ticket be equal to zero? I haven't noticed that.

I haven't looked into the code. If Buy_ticket is an int variable, it's an error, if it's a bool, the expression looks like this: if (Buy_ticket == true)
 
artmedia70:
I haven't looked into the code. If Buy_ticket is an int variable, this is an error, and if it is a bool, this expression looks like this: if (Buy_ticket == true)

Yes, I already realised that. Such crooked experts sometimes publish, it's a wonder...

And as for my question. I still think someone made a mistake here. It's not described anywhere. But I think the ticket numbering starts with 1, not zero. It doesn't really matter, but it's just a thought.

 
hoz:

Yes, I already realised that. Such crooked experts sometimes publish, it's a wonder...

And as for my question. I still think someone made a mistake here. It's not described anywhere. But I think the ticket numbering starts with 1, not zero. It doesn't really matter, but it's just a thought.

I have never seen a ticket that equals zero. Nowhere and never...
Reason: