OrdersHistory is not guaranteed to be in chronological order. If you want to filter by time, then filter by only checking trades that opened or closed after a particular time.
Thank you for this (to me) new info :)
I will use this logic to try a few things, hopefully I can sort this out from here!
OrdersHistory is not guaranteed to be in chronological order. If you want to filter by time, then filter by only checking trades that opened or closed after a particular time.
Thanks to your pointers I think I worked it out using:
timeWindowLimitBackwards = 8760; //One year
OrderOpenTime() > iTime(NULL,0,timeWindowLimitBackwards)
Is there anything that doesnt make sense to you with this solution? Just dont want to run errors I cant see due to lack of experience with MQL4 :)
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.
OrdersHistory is not guaranteed to be in chronological order. If you want to filter by time, then filter by only checking trades that opened or closed after a particular time.
Thank you for this (to me) new info :)
I will use this logic to try a few things, hopefully I can sort this out from here!
OrdersHistory is not guaranteed to be in chronological order. If you want to filter by time, then filter by only checking trades that opened or closed after a particular time.
Thanks to your pointers I think I worked it out using:
Is there anything that doesnt make sense to you with this solution? Just dont want to run errors I cant see due to lack of experience with MQL4 :)
Thanks again mate!