Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
Thanks again, but you're really not understanding the issue. Thanks anyway.
How do I filter from all the closed orders, only those that were closed today?
Clearly I have to use something like
if (OrderCloseTime() == TimeCurrent()
But that doesn't work. How do I modify that, so it does work?
There will be hundreds of closed trades with this magic number, and for this symbol........I only want to find those closed today.
i don't know if i understand your nature of problem well.
here is my approach.
i don't know if i understand your nature of problem well.
here is my approach.
Thank you, appreciate the reply.
Yes, that might work. I'll give it go.
Can you explain what that number is. It's coming out as 1520467200 at the moment.
and
how could that be compared to OrderCloseTime()?
Thanks, appreciate any help.
That "number" is datetime start of today. E.G. 2018.03.14 00:00:00 (it cut hours, minutes and seconds)
If you do the same with OrderCloseTime() => OrderCloseTime()-OrderCloseTime()%86400 you get start of day that the order was closed.
And you can compare these two datetime. If the values are equal the order belong to today.
That "number" is datetime start of today. E.G. 2018.03.14 00:00:00 (it cut hours, minutes and seconds)
If you do the same with OrderCloseTime() => OrderCloseTime()-OrderCloseTime()%86400 you get start of day that the order was closed.
And you can compare these two datetime. If the values are equal the order belong to today.
Thanks, that helps. I think I've got it working now.
Try this code to find out which trades are closed today