In the extern parameters, add :

Code:
extern double MinLots=0.01;
extern double MaxLots=100;
Before the OrderSend functions add :

Code:
if(Lots<MinLots)Lots=MinLots;
if(Lots>MaxLots)Lots=MaxLots;
Of course, Lots should be replaced by your Lots parameter's name.