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?
- open just one order??
- How will the order be closed after a certain period of time?
- [ARCHIVE]Any rookie question, so as not to clutter up the forum. Professionals, don't pass it by. Can't go anywhere without you - 5.
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. |
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.
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register