Minimum lot size below 0.01?
error
Shawn Ong :
Hi all,
If my EA decides that based on my money management, my lot size should be 0.003, what will happen as my minimum is 0.01 lots?
Thanks
There will be an error. Before sending a sales order, you need to check the volume, for example:
//+------------------------------------------------------------------+ //| Lot Check | //+------------------------------------------------------------------+ double LotCheck(double lots) { //--- calculate maximum volume double volume=NormalizeDouble(lots,2); double stepvol=m_symbol.LotsStep(); if(stepvol>0.0) volume=stepvol*MathFloor(volume/stepvol); //--- double minvol=m_symbol.LotsMin(); if(volume<minvol) volume=0.0; //--- double maxvol=m_symbol.LotsMax(); if(volume>maxvol) volume=maxvol; return(volume); }
Here m_symbol is the CSymbolInfo object.
- You place the stop where it needs to be - where the reason for the trade is no longer valid. E.g. trading a support bounce the stop goes below the support.
- Account Balance * percent/100 = RISK = OrderLots * (|OrderOpenPrice - OrderStopLoss| * DeltaPerLot + CommissionPerLot) (Note OOP-OSL includes the SPREAD, and DeltaPerLot is usually around $10/pip but it takes account of the exchange rates of the pair vs. your account currency.)
- Do NOT use TickValue by itself - DeltaPerLot
- You must normalize lots properly and check against min and max.
- You must also check FreeMargin to avoid stop out
- If your size is below minimum, then either you can't take the trade, must risk more than you want, or find a broker that has mini/micro lot sizes (10K/1K.)
Hi all,
If my EA decides that based on my money management, my lot size should be 0.003, what will happen as my minimum is 0.01 lots?
Thanks