double DailyProfit() { double profit = 0; int cnt = OrdersHistoryTotal(); for (int i=0; i < cnt; i++) { if (!OrderSelect(i, SELECT_BY_POS, MODE_HISTORY)) continue; if (TimeDayOfYear(OrderCloseTime()) == DayOfYear() && TimeYear(OrderCloseTime()) == Year()) profit += OrderProfit(); } return (profit); }
if that's the only thing trading on your terminal then watch balance vs equity.
opentradesprofit=AccountEquity()-AccountBalance();
opentradesprofit=AccountEquity()-AccountBalance();
Thx for your answers

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
maybe someone can help me.
My EA has to stop trading if a certain daily profit amount is reached and starts trading on the next day again. How can I program this? I have problems with "daily profit"
Thx