EA Stop Trade till Next Day, if Account Balance is UP 2% or Down 2%

To add comments, please log in or register
Sanbach21
42
Sanbach21  

Hi , I need help Stop EA till Next Day, if Account Balance is UP 2% or Down 2%

i have this 

 int Contador = 0;
   for(int i=OrdersHistoryTotal()-1; i>=0; i--)
     {
      OrderSelect(i,SELECT_BY_POS,MODE_HISTORY); 
      datetime T = OrderCloseTime();

      if(TimeDayOfYear(T)!=DayOfYear())  //since the last order was closed on a different day, there is no need to check further.
         break;

      if(OrderProfit()<1)  //with the above time check, you can continue to check for the 2nd last order as well.
         continue;
      else 
         Contador++;

      if(Contador==2)
         break;
     }
   return(Contador);

  }


 if put win 2 trade consecutive don't work because if the first trade is lose and the netx two trade are winner then  stop the EA but I Lose 1 and win 2 that is +1  ,

same to stop the EA with 2 Lose consecutive , if the firs is winner and the netx 2 trade are loser stop the EA  but don't work because the first trade is +1 the netx 2 are -2 equal to -1 trade loser

 then i want to try with account Balance UP or DOWN 2% 

But i don't know How to Found the Account balance For Yesterday !




I also want to know if entry signal is  correct because  don't work 


if( MACD1>0.03)
if( MACD2>0.1 )


             if(Close[3]<MA1)
             if(Close[2]<MA1) 
               if(Close[1]> MA1)


                 {
                  Buy();
                 }

if( MACD1< -0.03)
if( MACD2<-0.1)


            if(Close[3]>MA1)
            if(Close[2]>MA1)
               if(Close[1] < MA1)


                 

                 {
                  Sell();
                 }


  }

ok 

Thank you very much For all help!!!!

Sergey Golubev
Moderator
113966
Sergey Golubev  

Forum on trading, automated trading systems and testing trading strategies

When you post code please use the CODE button (Alt-S)!

Use the CODE button


Keith Watford
Moderator
19396
Keith Watford  
Sanbach21:

Hi , I need help Stop EA till Next Day, if Account Balance is UP 2% or Down 2%

Do not double post!

I have deleted your other topic.

To add comments, please log in or register