Help with lot calculation in MQL5??? Problem with code in metaeditor 5

 

Hello! I would like to change martingale function to make my EA open lots adding just 0.01 (0.01, 0.02, 0.03, 0.04...).

Could somebody help me with my code? 

   int f=0;
   if(Martin==true)
     {
      if(total==0)
        {
         f=1;
        }
      if(total>=1)
        {
         f=total;
        }
      LotB=Lots_New*f;
      LotS=Lots_New*f;
     }

Thank you! 

 

Better to bind to the minimum lot. Like that:

      LotB=m_symbol.LotsMin()*f;
      LotS=m_symbol.LotsMin()*f;
 
Thank you for your kind response! But what if I want to start with 0.02 lot? And I want it to continue with 0.03, 0.04, 0.05... ? 
 

Well I think I got it - I just added this:

      LotB=m_symbol.LotsMin()*f+0.01;
      LotS=m_symbol.LotsMin()*f+0.01;

But thank you very much, you helped a lot! 

 
Lukas Kozubik :

Well I think I got it - I just added this:

But thank you very much, you helped a lot! 

You are welcome :)

Reason: