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
What about slippage?
Yes, it's what I was saying. I did it so, and it worked, but if you modify the initial Stop Loss, it generates a new order WITHOUT the same POSITION_ID. I don't know why. I think, it is a bug. Regards,.
No need to look slippage, because the order has been close, and close price is on HystoryDealGetDouble(ticket, DEAL_PRICE).
If the order has not been in close, and you make an order to close, then you should consider how much slip, so that no error requotes.
No need to look slippage, because the order has been close, and close price is on HystoryDealGetDouble(ticket, DEAL_PRICE).
If the order has not been in close, and you make an order to close, then you should consider how much slip, so that no error requotes.
I'm not sure I follow.
HistoryOrderGetDouble(ticket,ORDER_SL) is the stop loss
When the SL is triggered, you can get slippage.
HistoryDealGetDouble(ticket, DEAL_PRICE) will show the actual price, which may or may not have encountered slippage.
If there was slippage, a simple comparison of ORDER_SL == DEAL_PRICE will fail, no?
Yes, it's what I was saying. I did it so, and it worked, but if you modify the initial Stop Loss, it generates a new order WITHOUT the same POSITION_ID. I don't know why. I think, it is a bug. Regards,.
An order to modify SL/TP is not saved in the history at all. So not sure what you mean here ?
And the order which actually results from the SL/TP triggered doesn't contain the SL/TP.
<= for Buys and >= for Sells.
I'm not sure I follow.
HistoryOrderGetDouble(ticket,ORDER_SL) is the stop loss
When the SL is triggered, you can get slippage.
HistoryDealGetDouble(ticket, DEAL_PRICE) will show the actual price, which may or may not have encountered slippage.
If there was slippage, a simple comparison of ORDER_SL == DEAL_PRICE will fail, no?
If I understand you correctly, that's not exact. On a real market, an order can be closed by SL (or TP) at a different price that the position SL (or TP).
Yes Alain, what if Bid > close_price+spread or Ask < close_price-spread
spread != deviation (slippage)
It is a shame it is not possible to retrieve the deviation parameter.
Probably a reasonable compromise is (presuming the EA placed the order) to check whether DEAL_PRICE was within a window of ORDER_SL ± deviation
Yes Alain, what if Bid > close_price+spread or Ask < close_price-spread