Moved to right section.
- Why did you post your MT4 question in the
Root / N/A section instead of the
MQL4 section, (bottom of the Root page?)
General rules and best pratices of the Forum. - General - MQL5 programming forum
Next time post in the correct place. The moderators will likely move this thread there soon. BCondCalc = NormalizeDouble((CondPips * pips),Digits);
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 and MetaTrader 4 - MQL4 programming 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 and MetaTrader 4 - MQL4 programming 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 and MetaTrader 4 - MQL4 programming forum or Bid/Ask: (No Need) to use NormalizeDouble in OrderSend - MQL4 and MetaTrader 4 - MQL4 programming forum
- Lot size must also be adjusted to a multiple of LotStep and check against min and max. If that is not a power of 1/10 then NormalizeDouble is wrong. Do it right.
if (SOpenPrice > SModPrice || SOpenPrice < SModPrice)
Doubles are rarely equal. So when will that if statement ever be false?
The == operand. - MQL4 and MetaTrader 4 - MQL4 programming forumif(OrderType()==OP_SELL) : bool stat = OrderModify(OrderTicket(),SModPrice,OrderStopLoss(),OrderTakeProfit(),0,clrBlue);
You can't modify an open order's price and since the stop aren't being moved ERR_NO_RESULTYou Server Change the SL to X It is at X! Change the SL to X It is at X! Change the SL to X You are insane
Hi whroeder1
Thank you for your inputs.
I have read the forum rules. Next time i will post in the correct place...

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
Hi
I am a newbie to the forex coding...
I have been trying to modify the open price of an order when the pre defined conditions are met. But while executing the order modify function, it is returning false and the error code is showing as 1.
I have observed that order open price and modified open price are different. But still the error code 1 is displaying.
I have also normalized the prices for comparison.
The code is as follows.... Please