You try to place a buy stop below the Ask, that wont work. A buy order below the ask is a buy limit.
- You can't move stops (or set pending prices) closer to the market than the minimum (MODE_STOPLEVEL *
_Point.)
Requirements and Limitations in Making Trades - Appendixes - MQL4&Tutorial
For a buy stop the market is the Ask. - The price must be normalized to tick sizePrint out your values to the precision you want. 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.
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
I run an EA through the Strategy Analyzer and I keep getting this error:
failed buy stop 1.00 EURUSD at 1.18958 tp: 1.18988 [Invalid price]
The Ask at this moment is 1.18970, and the Bid is 1.18938
Is there a minimum distance required to place orders? I don't understand why this BuyStop keeps getting rejected.
Any help would be greatly appreciated.