0

I have an MT4 EA, trying to modify it, I'll share the part I need to modify it below:

void exit()
  {
   for(int i=OrdersTotal()-1; i>=0; i--)
     {
      if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES))
        {
         if(OrderSymbol()==Symbol() && OrderMagicNumber()==Magic)
           {
            if(OrderProfit()<0) //LOSS
              {
               amountloss=amountloss+OrderProfit();
               TotalLotLoss=TotalLotLoss+OrderLots();
               lot=lots;
               wincount=0;
              }
            else  //profit
              {
               if(wincount==0)
                 {
                  TotalLotLoss=TotalLotLoss+OrderLots();
                  amountloss=amountloss+OrderProfit();
                  lot=TotalLotLoss*multi;
                  wincount=1;
                 }
               else
                 {
                  TotalLotLoss=TotalLotLoss+OrderLots();
                  amountloss=amountloss+OrderProfit();
                  if(amountloss>0)
                    {
                     TotalLotLoss=0;
                     amountloss=0;
                     lot=lots;
                    }
                  else
                    {
                     lot=OrderLots();
                    }

After 1 win it duplicate all losses by 2 and keep doing this until all losses are recovered, what I want is after 1 recovering win, reset to 0.01

I will give you example: 0.01 loss 0.01 loss 0.01 loss 0.01 loss 0.01 win 0.04 win then reset to 0.01 that's all

I couldn't figure how to do it! any help?

Traveee
  • 1
  • 1

0 Answers0