![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
The task I want to complete is to get the credit of all orders opened by my EA. Not the total for the account, which you can get by calling AccountCredit(). I couldn't find any easy way, so I wrote in, my opinion, rather complex code for the matter. Here it is:
This won't work for example with idexes. Also if my account currency does not match in a currency pair with all base currencies, that are in opened orders, it will fail. I even thought about path finding in gaphs, where every node is a currencyPair, so I can find what exchanges are to be made to link two currencies. But that's waaaaay too complex.
So, do you know any easier way to get a order's credit?