Your code doesn't work because your conditions are wrong.
You are basically saying
"If less than 5 positions are open, use 1 lot, if more than 6 positions are open, use 2 lots".
Your code does not handle the case when you have exactly 5 or 6 open positions, same goes for 10 and 11.

Your probably use an else statement at the end also to handle the case when there are more than 15 open positions.
And use else if to make the code more efficient.
Something along these lines:

Code:
if(NumOpenTotal <= 5) {
	Lots = 1;
} else if((NumOpenTotal >= 6) and (NumOpenTotal <= 10)) {
	Lots = 2;
} else if((NumOpenTotal >= 11) and (NumOpenTotal <= 15)) {
	Lots = 3;
} else {
        Lots = 4;
}



Last edited by Dalla; 05/15/17 19:09.