Problem changing input parameter in code

 

Hi, 

In mql5 EA i have this problem when modifying LotSize, which is initially set as input. i want to use this code 

   if(LotSize > maxvol) LotSize = maxvol;
   if(LotSize < minvol) LotSize = minvol;  

 But returns constant cannot be changed!

Thanks in advance

 

Assign it to your own variable.

input double LotSize = 0.10;
void OnStart()
{
    double myLotSize = LotSize;
    if(myLotSize > maxvol) myLotSize = maxvol;
    if(myLotSize < minvol) myLotSize = minvol; 
}
 
Anthony Garot:

Assign it to your own variable.

I tried something similar, but ill try it this way

 
thanks worked
Reason: