I will set EA to stop trading daily profit target ?

 

What commands do I need to add?

For example, I want to close the EA that day when the profit is 10USD.

 
  1. At the start of the day, remember the balance. Compare balance now vs. then. What's the problem?

    1. New date, same as new bar test, but using date.

      static datetime currentDay=0;
      datetime previousDay = currentDay; currentDay = date();
      bool isNewDay = currentDay != previousDay;
                Find bar of the same time one day ago - Simple Trading Strategies - MQL4 programming forum

    2. You could also use D1 timeframe, but then you have to deal with 4066/synchronization issue.

  2. You haven't stated a problem, you stated a want. Show us your attempt (using the CODE button) and state the nature of your problem.
              No free help 2017.04.21

    Or pay someone. Top of every page is the link Freelance.
              Hiring to write script - General - MQL5 programming forum 2018.05.12

 
Pinit Toonyanukoon :

What commands do I need to add?

For example, I want to close the EA that day when the profit is 10USD.

Code: Daily Target

The adviser checks the current profit on the trading account: if the profit has reached the target valueTarget profit   (set in money) - all positions are closed and the adviser does not work anymore on that day.
Daily Target
Daily Target
  • www.mql5.com
Советник проверяет текущую прибыль на торговом счёте: если прибыль достигла заданного значения  Target profit (задаётся в деньгах) - все позиции закрываются и больше в этот день советник не работает.