- Types of Orders - Trading Principles - Trade - MetaTrader 5 for Android
- Types of Orders - Trading Principles - Trade - MetaTrader 5 for iPhone
- Managing Pending Orders - Trade - MetaTrader 5 for Android
Hello, I'm running an EA that places buystop/sellstop pending orders on USDJPY. Sometimes the candle moves too fast and market price passes the stop order level prior to MT5 placing it, resulting in rejection. Are there any settings in MT5 that would help to allow for entry at market in this scenario rather than rejection?
try stop-limit orders instead.
But these may not work any better if price jumps 3 digits in single tick (for example).
if you do not have the source code, then, no, there is no settings on the platform to improve this issue. all possible improvements must be done in the eas coding.try stop-limit orders instead.
But these may not work any better if price jumps 3 digits in single tick (for example).
if you do not have the source code, then, no, there is no settings on the platform to improve this issue. all possible improvements must be done in the eas coding.I'll be happily impressed if anyone has a U.S. FX broker-dealer that allows stop-limit orders. To the best of my knowledge, they don't exist. Per the OP's Profile, the OP is in the U.S.
I do have to wonder, however, what kind of EA gets burned on stops so quickly... and whether the stop is sent with the initial entry order, or later as an order modification.
I do have to wonder, however, what kind of EA gets burned on stops so quickly... and whether the stop is sent with the initial entry order, or later as an order modification.
It depends on your FX broker-dealer's order execution type. There are market execution FX broker-dealers, and then there are instant execution FX broker-dealers.
Forum on trading, automated trading systems and testing trading strategies
May I set a deviation of 0 when requesting a market trade with my EA?
Alain Verleyen, 2018.05.08 14:29
Execute such code to check with trade execution mode is used :
ENUM_SYMBOL_TRADE_EXECUTION executionMode=(ENUM_SYMBOL_TRADE_EXECUTION)SymbolInfoInteger(_Symbol,SYMBOL_TRADE_EXEMODE); printf("Trade execution mode for %s is %s",_Symbol,EnumToString(executionMode));If it returns SYMBOL_TRADE_EXECUTION_INSTANT (or SYMBOL_TRADE_EXECUTION_REQUEST) then you can use "deviation" with OrderSend. Otherwise you can't.
Because OrderSend() is a generic function, used with all kind of trading environment.
Regarding pending orders, no, there is no deviation parameter for pending orders.
The workaround would be to offset an open position using an equal, opposite, and instant Buy/Sell order─if you have an instant execution FX broker-dealer, and because the U.S. is a FIFO jurisdiction (no Hedge).
The EA relies on an external signal...
Ah ha. Without laying eyes on, I bet that your remote signal delay is at issue.
[W]hen I switch to live commission, I think a lot of these issues will resolve themselves.
That would be nice, but I make it a habit not to rely on anything fixing itself.
But I'm trying to cover all my bases in the meantime-
Definitely.
thanks for the replies. I was looking through Tools/Options/Trade and found the deviation setting. Would adjusting this help in my scenario at all or does it only apply to market and instant execution orders and not pending stop orders?
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use