#### Topic: Autolot calculation

Can someone please assist me in how to change the EA to do autolot calculation.

Eg, start with 0.1 and for every \$3000 profit, automatically increase the lot by 0.1.

I will really appreciate any feedback.
Thanks

#### Re: Autolot calculation

Hello,

you can try this

find and replace

``````      double stopLoss   = signal.StopLossPips>0 ? GetStopLoss(command, signal.StopLossPips) : 0;
double takeProfit = signal.TakeProfitPips>0 ? GetTakeProfit(command, signal.TakeProfitPips) : 0;
string comment    = IntegerToString(signal.MagicNumber);
color  arrowColor = command==OP_BUY ? clrGreen : clrRed;``````

with

``````      if(!Auto_Lot){amount=Entry_Amount;}else
if(Auto_Lot){
amount=((AccountBalance()*Lot_per_10000)/100)/1000;

int Decimals=1;
double ModeLotStep = MarketInfo(Symbol(), MODE_LOTSTEP);
if (ModeLotStep == 0.01) Decimals = 2;
if (ModeLotStep == 0.001) Decimals = 3;
amount=NormalizeDouble(amount,Decimals);
}

double stopLoss   = signal.StopLossPips>0 ? GetStopLoss(command, signal.StopLossPips) : 0;
double takeProfit = signal.TakeProfitPips>0 ? GetTakeProfit(command, signal.TakeProfitPips) : 0;
string comment    = IntegerToString(signal.MagicNumber);
color  arrowColor = command==OP_BUY ? clrGreen : clrRed;

if(amount<=MarketInfo(_Symbol,MODE_MINLOT)){amount=MarketInfo(_Symbol,MODE_MINLOT);Comment("______ Use MIN LOT ______");}else
if(amount>=MarketInfo(_Symbol,MODE_MAXLOT)){amount=MarketInfo(_Symbol,MODE_MAXLOT);Comment("______ Use MAX LOT ______");}else
Comment("");

return;``````

then find and replace

``static input double Entry_Amount      = 0.01; // Entry lots``

with

``````extern bool Auto_Lot               = true;
extern double Lot_per_10000      = 1;
static input double Entry_Amount   = 0.01;  // Entry lots``````

It'll give you 1 lot per 10000 or 0.01 lot per 1000

Best regards.

do or do not there is no try