Normalize your lot correctly :
Forum on trading, automated trading systems and testing trading strategies
Help with a recurring OrderClose function error
Alain Verleyen, 2016.11.30 14:57
You have either to use OrderLots() to close a full position or
to normalize your lot size this way :
double lotStep=SymbolInfoDouble(_Symbol,SYMBOL_VOLUME_STEP);
lots=MathRound(lots/lotStep)*lotStep;
lots=MathRound(lots/lotStep)*lotStep;
Do NOT use NormalizeDouble, EVER. For ANY Reason. It's a kludge, don't
use it. It's use is always
wrong
- SL/TP (stops) need to be normalized to tick size (not Point.) (On 5Digit Broker Stops are only allowed to be placed on full pip values. How to find out in mql? - MQL4 forum) and abide by the limits Requirements and Limitations in Making Trades - Appendixes - MQL4 Tutorial and that requires understanding floating point equality Can price != price ? - MQL4 forum
- Open price for pending orders need to be adjusted. On Currencies, Point == TickSize, so you will get the same answer, but it won't work on Metals. So do it right: Trailing Bar Entry EA - MQL4 forum or Bid/Ask: (No Need) to use NormalizeDouble in OrderSend - MQL4 forum
- Lot size must also be adjusted to a multiple of LotStep. If that is not a power of 1/10 then NormalizeDouble is wrong. Do it right.

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Dear,
I wrote the code below.
sLots = 0.02;
Multi = 1.83;
double mLot = NormalizeDouble(sLots * Multi,LOT_PRECISION);
So actually calculation is 0.02*1.83=0.0366 and i want only 2 digit without round the number like = 0.03 just leave "66"
but above coding mLots show 0.04 coding make it round. i don't want round. is anyone help me how i make code function return double value with 2 digit without round the number.
Thank in Advanced