Download MetaTrader 5
To add comments, please log in or register
Log in to MQL5.community using OpenID. It is convenient!
Thomas Ellison
18
Thomas Ellison 2014.06.11 11:53 
I'm working on an EA and I want it to be able to check if there are any closed orders on the current symbol within the past so many periods. The amount of periods would be a variable. Is this possible?
whroeder1
13656
whroeder1 2014.06.11 12:12  
deuce4884: check if there are any closed orders on the current symbol within the past so many periods. The amount of periods would be a variable. Is this possible?
Of course it possible. It's not even hard.
Do an OrderSelect loop on history, filter by magic number and pair, check if the OrderCloseTime is within your window.
Thomas Ellison
18
Thomas Ellison 2014.06.11 18:09  
WHRoeder:
deuce4884: check if there are any closed orders on the current symbol within the past so many periods. The amount of periods would be a variable. Is this possible?
Of course it possible. It's not even hard.
Do an OrderSelect loop on history, filter by magic number and pair, check if the OrderCloseTime is within your window.

Thanks WHRoeder for the reply. I read through the info at the link you gave me. I'm very new to this type of programming so forgive my ignorance. The code I reviewed is a little confusing to me. What I would like is a function that would return a true or false value based on whether or not it finds a closed order for the current market symbol within the past X amount of bar periods. What I reviewed may be what I need exactly, but I'm not sure...could you help by explaining it better to me or giving me another example. Thanks for your help.
/
To add comments, please log in or register