Very Helpful
Thank you
How to select history orders/ deals/ position by incremental indexing.
Such as:
for(uint i = uint(HistoryDealsTotal()-1); i >= 0; i--) { if(deal.SelectByIndex(i) == true) { //--my data } }
Is it possible?
Thanks for your interesting article
Forum on trading, automated trading systems and testing trading strategies
Discussion of article "Orders, Positions, and Deals in MetaTrader 5"
Tanvir Ahmed, 2017.10.21 16:52
for(uint i = uint(HistoryDealsTotal()-1); i >= 0; i--) { if(deal.SelectByIndex(i) == true) { //--my data } }
Infinite loop!
New article Orders, Positions, and Deals in MetaTrader 5 is published:
Author: MetaQuotes
very helpful!!!!!!!thanks!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!1
Thanks for such an informative article. @MetaQuotes
Query: How can I collectively loop through both : open orders and open positions in a single for() loop (in a similar way how we loop all orders in MQL4 and then check if an order is already executed or a pending order) ?
Thanks for such an informative article. @MetaQuotes
Query: How can I collectively loop through both : open orders and open positions in a single for() loop (in a similar way how we loop all orders in MQL4 and then check if an order is already executed or a pending order) ?
To calculate POSITIONS and PENDING ORDERS you must use two independent cycles. One cycle enumerates POSITIONS, and the second cycle enumerates PENDED ORDERS. Example: Calculate Positions and Pendong Orders
![How to start with MQL5 How to start with MQL5](https://c.mql5.com/36/43/how-to-start-with-mql5__6.jpg)
- 2020.12.19
- www.mql5.com
Hi, folks!
It would be helpful that @MetaQuotes upgrade this article with Trade Classes (CAccountInfo, CSymbolInfo, COrderInfo, CHistoryOrderInfo, CPositionInfo, CDealInfo, CTrade, CTerminalInfo). Develop EA under Object-Oriented paradigm could modify (and simplify) this operations of synchronize cache and to get data over symbols, orders, positions, deals, trades, etc.
Am I right?
![Documentation on MQL5: Standard Library / Trade Classes / CAccountInfo Documentation on MQL5: Standard Library / Trade Classes / CAccountInfo](https://c.mql5.com/36/51/documentation-on-mql5-standard.png)
- www.mql5.com
if you please how to calculate order commision with profit to be like this
" Profit += profit + swap + commision "
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
New article Orders, Positions, and Deals in MetaTrader 5 is published:
Creating a robust trading robot cannot be done without an understanding of the mechanisms of the MetaTrader 5 trading system. The client terminal receives the information about the positions, orders, and deals from the trading server. To handle this data properly using the MQL5, it's necessary to have a good understanding of the interaction between the MQL5-program and the client terminal.
Author: MetaQuotes