[Archive!] Any rookie question, so as not to clutter up the forum. Professionals, don't pass it by. Couldn't go anywhere without you - 2. - page 175

 
Do you know how?Have you evenlooked at the trading functions ? If so, how can you not see OrderCloseTime, or are you too lazy to read these functions?
 

Maybe there is an example of how to insert a magic number into a simple EA.

So that it only trades the 1st market order and there is a second EA which opens up to 5 orders on the same instrument?

Need to attach to a simple EA from this site...

Files:
macd.mq4  7 kb
 
sergeev:

+ before uploading (if you have such holes), it is advisable to delete the existing history

+ set the history depth in the settings at least for 10000000 bars

+ after downloading the history you need to click "Download" again and confirm the recalculation of all the TFs.

Thanks, I will try it ))

 
eddy:
If so, how can you fail to see the OrderCloseTime, or are you too lazy to read the functions?


datetime OrderCloseTime( )

Returns the close time for the selected order.

Seen it, seen it already. The only problem is for the selected order. I'm asking how to select? As far as I know, you can select through OrderSelect .Open orders have already been selected and modified. How about a closed order? How do I select the last closed order?

 
Reaktiv:


datetime OrderCloseTime( )

Returns the closing time for the selected order.

Seen it, seen it already. The only problem is for the selected order. And I asked how to select? As far as I know, it is possible to select via OrderSelect .I have already selected and modified the open orders. How about a closed order? How do I select the last closed order?

RTFM on OrderSelect. Is it really not clear about MODE_HISTORY ?

Secondly, SELECT_BY_TICKET selects an order, whether it is history or non-history.

 
sergeev:

RTFM on OrderSelect. is it not clear about MODE_HISTORY ?

Secondly, SELECT_BY_TICKET - selects a response, regardless of history or non-history.


MODE_HISTORY is also written about, but I can't figure out how to select the most recent one.
 
Reaktiv:

how to choose the most recent one.
you are too lazy to think.
 
sergeev:
You're too lazy to think.


Well, for example, I've been thinking about how to make

double pro;

double z;

int start()

{

z=OrdersHistoryTotal();
OrderSelect(z,SELECT_BY_POS,MODE_HISTORY);
pro=OrderClosePrice();
Alert(pro);

return(0);

}

I wanted to check if the close price of the first order in the history was 1 instead of z. But now it shows 0 and 0.

 
Reaktiv:


Well, for example, I've been thinking about how to make



you have been thinking wrong, you have an error in the principles of use.
Start with the help and then the tutorial.
It will unfortunately not work in a sketchbook.

 
Reaktiv:

I can't figure out how to select the latest one.
Well, how do you determine which is the last? by time. Well, in the code, see which order is the most recent by time
Reason: