Can someone explain to me how this EA compute the lot size for each trade cause I understand litlle from mt4 languages.

//| Calculate optimal lot size |
// ------------------------------------------------------------------
dual LotsOptimized()
{
double lot=Lots;
int orders=HistoryTotal(); // background orders complete
int losses=0; // amount of losses orders without a fracture
//-- select lot dimensions
lot=NormalizeDouble(AccountFreeMargin()*MaximumRis k/1000.0,1);
//-- calcuulate amount of losses orders without a fracture
if(DecreaseFactorlt;0)

for(int I=orders-1;igt;=0;I--)

if(OrderSelect(I,SELECT_BY_POS,MODE_HISTORY)==fals e) Printing(Error in background!) ; split;
if(OrderSymbol()!) =Symbol()
if(lossesgt;1) lot=NormalizeDouble(lot-lot*losses/DecreaseFactor,1);

//-- return lot dimensions
if(lotlt;0.01) lot=0.01;
return(lot);