mql question to handle mini-forext account

 
I have a demo mini-forex $3000 account with the following lots allocation logic:

vLots= Ceil(Balance * 3.0/10000)/10;
if vLots < 0.1 then vLots=lots;
if vLots > 1 then vLots=Ceil(vlots);
if vLots > 5 then vLots=5;

Keep getting this error in the journal:

05:05:33 '69451': order buy stop 0.10 USDCAD at 1.2486 sl: 1.2468 tp: 1.2502
05:05:33 '69451': order failed [invalid prices]

But when I manully place an order to buy .10 lots, it works!

Any idea?