-
Please edit your (original) post and use the CODE button (Alt-S)! (For large amounts of code, attach it.)
General rules and best pratices of the Forum. - General - MQL5 programming forum 2019.05.06
Messages Editor -
datetime closetime = OrderCloseTime();
You can not use any Trade Functions until you first select an order. -
Do not assume history has only closed orders.
OrderType() == 6, 7 in the history pool? - MQL4 programming forum -
Do not assume history is ordered by date, it's not.
Could EA Really Live By Order_History Alone? (ubzen) - MQL4 programming forum 2012.04.21
Taking the last profit and storing it in a variable | MQL4 - MQL4 programming forum #3 2020.06.08
Hi Keith and William,
Thanks for the prompt reply!
-
Please edit your (original) post and use the CODE button (Alt-S)! (For large amounts of code, attach it.)
General rules and best pratices of the Forum. - General - MQL5 programming forum 2019.05.06
Messages Editor - You can not use any Trade Functions until you first select an order.
-
Do not assume history has only closed orders.
OrderType() == 6, 7 in the history pool? - MQL4 programming forum -
Do not assume history is ordered by date, it's not.
Could EA Really Live By Order_History Alone? (ubzen) - MQL4 programming forum 2012.04.21
Taking the last profit and storing it in a variable | MQL4 - MQL4 programming forum #3 2020.06.08
-
Please edit your (original) post and use the CODE button (Alt-S)! (For large amounts of code, attach it.)
General rules and best pratices of the Forum. - General - MQL5 programming forum 2019.05.06
Messages Editor - You can not use any Trade Functions until you first select an order.
-
Do not assume history has only closed orders.
OrderType() == 6, 7 in the history pool? - MQL4 programming forum -
Do not assume history is ordered by date, it's not.
Could EA Really Live By Order_History Alone? (ubzen) - MQL4 programming forum 2012.04.21
Taking the last profit and storing it in a variable | MQL4 - MQL4 programming forum #3 2020.06.08
if (OrderSelect(i, SELECT_BY_POS,MODE_HISTORY)) continue;
This doesn't make sense. It should be
if (!OrderSelect(i, SELECT_BY_POS,MODE_HISTORY)) continue;
- No need to sort, you just have to remember the latest.
- You can't select the most recent anything. You have to go through history and find it.
- Remember it when you find a trade (not a deleted pending, not an accounting entry.)
- Test your 15 minutes after the loop, when you have your result.

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
hi,
I would like to find the order close time for my last closed order. Subsequently, there will be a signal ('More than 15 mins") when it has been more than 15 mins since the order was last closed.
There is no error with my code, but there is no signal after 15 mins.
Here is my code
It will be great if someone can help!!!
THANKS!