This does not work. I tried this code multiple times and the specified price is not getting respected. res=trade.OrderOpen("MESH23", ORDER_TYPE_BUY_LIMIT, 1, 0, 4022.75, 0, 0); Actual filled price: 4023. I'm using AMP Demo account and for some reason limit orders are not real limit orders, they're triggered as a market order when the order is touched. I even tried MqlTradeRequest with deviation 0, no difference. Tried BuyLimit/SellLimit, no difference. This does not happen when trading on TradingView with the same broker and it does not happen when trading on MotiveWave, there they're always filled at the specified price as they should be. Why on earth can't MT5 place real limit orders? A limit order should not be filled at a price that isn't SPECIFIED, then it isn't a limit order. I don't know if this is a problem with AMP or MT5 actually. Can anyone confirm if this happens with other brokers on MT5? I'm super close to changing platform completely but I don't actually want to change broker unless I really have to, so if anyone has a solution for this problem I would love to hear it. I already emailed AMP futures support but of course they just gave the link to their support page which explains nothing about what's going on MT5 specifically, just talking about bracket orders, I haven't even touched a bracket order.
You might want to update your FAQ because the information there is false. Even if you don't connect it to a bracket order the ENTRY limit order will be filled at a worse price than specified which defeats the purpose of a limit order. Unless it for some reason works differently on an AMP MT5 live account? I'm using AMP MT5 Demo account. When scalping on a low timeframe even a 1 tick offset can make a huge difference so it's actually a pretty big issue.
Bingo, you hit the nail on the head. I just confirmed, much to my surprise, that this is indeed the case with the Demo account. Needless to say, this will NOT occur in live trading.
That is good news if that's the case. I really hope it's just on the demo. I might need to open a live account and do some testing there before I decide to give up on this platform.
For a live account, comment out OnTick() and just put an OpenOrder for 1 micro lot in OnInit(). Only then will you be satisfied.
Can confirm that. It's pretty stupid actually. I'm using EA on live, all limits work as it's supposed to. Make sure you use return fill mode