avatar
AutoLot

Guest 622 1st May, 2020

CSHARP 0.65 KB
                                           
                         int LotDigits;
double LOT()
  {
   double lotsi;
   double ilot_max =MarketInfo(Symbol(),MODE_MAXLOT);
   double ilot_min =MarketInfo(Symbol(),MODE_MINLOT);
   double tick=MarketInfo(Symbol(),MODE_TICKVALUE);
//---
   double  myAccount=AccountBalance();
//---
   if(ilot_min==0.01)
      LotDigits=2;
   if(ilot_min==0.1)
      LotDigits=1;
   if(ilot_min==1)
      LotDigits=0;
//---
   if(AutoLot)
     {
      lotsi=NormalizeDouble((myAccount*Risk)/20000,LotDigits);
     }
   else
     {
      lotsi=IniTradeLot;
     }
//---
   if(lotsi>=ilot_max)
     {
      lotsi=ilot_max;
     }
//---
   return(lotsi);
  }
                      
                                       
To share this paste please copy this url and send to your friends
RAW Paste Data

Comments

Authentication required

You must log in to post a comment.

Log in
    There are no comments yet.