keen lum tham: I am currently using the attached script to open multiple pending orders.
It can also be used as market orders, but is it possible for me to specify the slippage? something like "enable maximum deviation" in pips size in mt4 new orders box?
It can also be used as market orders, but is it possible for me to specify the slippage? something like "enable maximum deviation" in pips size in mt4 new orders box?
- Move the slippage to an extern, like your other parameters.
- Slippage is only valid for buy/sell orders and only on those brokers that use it. For buyStop/sellStop, they become market orders when hit, slippage is irrelevant.
double SLB = Entry - StopLoss*Point, TPB = Entry + TakeProfit*Point;
These values are given in points not in pips. You are not adjusting SL, TP, and slippage; for 4/5 digit brokers and for JPY pairs.Lots = NormalizeDouble( AccountBalance()*Risk/StopLoss/(MarketInfo(Symbol(), MODE_TICKVALUE)),2);
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 and check against min and max. If that is not a power of 1/10 then NormalizeDouble is wrong. Do it right.
- 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
-
i tried the buy pending orders script and it is amazing can you send me or attach the other one that for sell multi pending orders .
thanks in advance.

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
Goodday.
I am currently using the attached script to open multiple pending orders.
It can also be used as market orders, but is it possible for me to specify the slippage? something like "enable maximum deviation" in pips size in mt4 new orders box?
Thanks.