Read the Help: Basic Principles . You must distinguish between concepts such as 'deal' and 'position'. If the position was closed, then you need to refer to the trading history and look for a deal with the 'DEAL_ENTRY_OUT' (or 'DEAL_ENTRY_INOUT') type
Basic Principles - Trading Operations - MetaTrader 5 Help
- www.metatrader5.com
Before you proceed to study the trade functions of the platform, you must have a clear understanding of the basic terms: order, deal and position...
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
I have this function that checks the closest open sales order.
My current need is to search for the closest sell order that the order has already been opened and closed (same day).