[ARCHIVE] Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 3. - page 61

 

to artmedia70:

If the order is closed, it should pass a condition to check its closing time using OrderCloseTime(). I've already found another suitable option, but I'm wondering why OrderCloseTime() doesn't work (returns zero)?

 
After closing, place OrderSelect again.
 

to Roger:

Why then does OrderProfit() work without this? Is it some kind of data update?

 
Roger:
After closing, place OrderSelect again.

I wonder why?
 
Vinin:
Roger:
Place OrderSelect again after closing.

I wonder why?
Apparently it's a guess. But I wondered what the answer was too...
 
I'll check Roger's suggestion just for fun. It's going to take time :(
 
Vinin:

I wonder why?

When it first makes a selection, each variable is assigned a value and OrderCloseTime() is still zero. After closing, to update this variable you have to make another selection. Or am I wrong?
 
Roger:

When it first makes a selection, each variable is assigned a value and OrderCloseTime() is still zero. After closing, to update this variable you have to do the select once again. Or am I wrong?

Aren't the deals taken from history? The history is some kind of array. Why would you allocate extra memory space for these variables and assign values to them (which also takes time)... Take the necessary information directly from the history of deals and work with it.

The deal history, in my interpretation, is the closed and deleted orders, as well as the open and pending ones. Since you, for example, open an order, and the price, the time of opening, etc. - is already a history! :))))) Each trade has its own unique number = Ticket. That's a nice array you get! :D

But this is just speculation. The technical side of selecting and working with deals I've never been interested in.

 
Roger is right, it's fine if you select the order again after closing.
 
Thank you all for listening! :3
Reason: