lots optimization

 

I'm looking an optimization of "Expert Advisors".

My system automatically chooses the number of LOTS to play according to the criteria.
I ask you an idea in my EA to limit the number of lots.


Example:

double LOT7 ( automatically calculate optimal lot size from my EA)
extern double MaxLOT (limit not to exceed)

if (LOT7>MaxLOT)
{
// my account balance must be less then 0, so as not to appears in my "Optimization Results"

}


Note: I use MetaTrader

Thanks in advance
Reason: