NewBie Question: What is MODE_LOTSTEP

 

I just start learning mql4, got stuck on one of hte sample code.


what does MODE_LOTSTEP mean ? Step for changing lots. I am still confused.


here's the code


int start()                                     // Special function start
  {
   int Dist_SL =10;                             // Preset SL (pt)
   int Dist_TP =3;                              // Preset TP (pt)
   double Prots=0.35;                           // Percentage of free margin
   string Symb=Symbol();                        // Symbol
//-------------------------------------------------------------------------- 2 --
   while(true)                                  // Cycle that opens an order
     {
      int Min_Dist=MarketInfo(Symb,MODE_STOPLEVEL);// Min. distance
      double Min_Lot=MarketInfo(Symb,MODE_MINLOT);// Min. volume
      double Step   =MarketInfo(Symb,MODE_LOTSTEP);//Step to change lots
      double Free   =AccountFreeMargin();       // Free Margin
      double One_Lot=MarketInfo(Symb,MODE_MARGINREQUIRED);//Cost per 1 lot
      //-------------------------------------------------------------------- 3 --
      double Lot=MathFloor(Free*Prots/One_Lot/Step)*Step;// Lots

Last line in the code. "Free*Prots/One_Lot" is to get 35% of free margin and divided by cost/lot to get total lot you can buy. but why you have to divided by " Step" then at the end multiply "Step" again.

Please explain to me what "Step" means. explanation in the documenation doens't make any sense.

 

FE

It is the minimum amount by which you can increase lot size, e.g.

Two brokers providing mini accounts as their smallest so MODE_MINLOT would reveal 0.1 as minimum lot size

But broker XXX allows increments of 0.1 only (MODE_LOTSTEP = 0.1), broker YYY allows 0.01 increments

Good Luck

-BB-

 
BarrowBoy, thank you so much.
Reason: