Trying to get first order value from the loop - page 2

 
David Diez:

First question, if OpenPrice gives the pos 0 this is first open price, why does not the same with ticket or/and profit? Why does it continue iteration looking for higher values?

Second question, why if I compare OpenPrice, OpenTime or OrderTicket by < to find the earlier within the iteration it leads me to an unexistent ticket(0)?

Third question if OP is first OP, don't actually know why this if returning the right value whenever it doesn't to Ticket an Profit, but in that case, if I'm getiting the right OP value and then if this value is correct condition may be give its Ticket and Profit.

I don't know what you are asking as you are showing different code every time.

 
Keith Watford:

I don't know what you are asking as you are showing different code every time.

Go on Keith show the trick.

 
David Diez:

Go on Keith show the trick.

What trick are you referring to?

You have been given enough information in this and other threads to do what you need to.

 
Keith Watford:

What trick are you referring to?

You have been given enough information in this and other threads to do what you need to.

I got it. Now misteriously have another problem, order that never close and/or give an error. Non-sense.
Reason: