Sorry, but there isn't any code which help me in this article...
is it so hard to define previous day balance and current day profit ?
I looked for in many EA with Money Management, but didn't see anything like I need...
Please, if someone have a piece of code to calculate this...
Thank you...
1. Get and store AccountBalance
2. Make HistoryTotal loop
3. Check close time of every trade in the history
4. If close time is more or equal today 0:00:00 calculate its profit
5. Subtract calculated profit from stored balance
You can find all this code (except close time checking) by my reference above
Hello Stringo,
Thank you for your answer...
About the link you provide, there is an error in the code :
OP_BALANCE and OP_CREDIT don't work in the CalculateInitialDeposit function.
I think the code is too old and don't work with newer MetaTrader versions.
If you have the correct code for this function, it could be interesting.Thank you.
there are macro definitions somewhere in sources
#define OP_BALANCE 6
#define OP_CREDIT 7
![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
Hello,
I had yet ask this question, but the answer didn't work.
I'm making Money Managment for my EA and I need to know/calculate total profits for the current day only and total profits for all previous days (from the begining of the month)
I need also know/calculate total balance day per day for the current month (current day and previous days from the begining of the month)
Have you got any idea or piece of code please ?
Thank you,
Have a nice day.