Download MetaTrader 5
To add comments, please log in or register
Find out how your rating can be improved
doorWindows
13
doorWindows 2016.08.28 18:38 
Hi,


When the requirements and limitations (https://book.mql4.com/appendix/limits) are checked in MT4? When the OrderSend is executed in MetaEditor or when the pending order actually becomes a BUY or SELL order?

This has to do when you set a SL/TP in a pending OrderSend taking into account the current spread but maybe in the future the spread will be different. If the validation is only happen when you execute OrderSend you might have some successful declared SL/TP that not executed in the future.

Can someone clarify? How you can be accurate on your SL/TP with pending orders? What approach is the best for declaring accurate SP/TP in pending orders as you do not know the future spread/distance levels?


Thank you

whroeder1
13656
whroeder1 2016.08.28 21:28  
  1. Nothing is executed in the Editor, perhaps you meant the terminal.
  2. Don't go anywhere close to the limits. When I tried pending orders (many years ago) it seemed like it was checking SL against the current market - never could get them to work.
  3. Humans can't watch 24/7, so they use pending orders. EA's can, just wait until the market reaches your entry price.
Fernando Carreiro
1571
Fernando Carreiro 2016.08.28 22:25  
doorWindows: When the requirements and limitations (https://book.mql4.com/appendix/limits) are checked in MT4? When the OrderSend is executed in MetaEditor or when the pending order actually becomes a BUY or SELL order?

This has to do when you set a SL/TP in a pending OrderSend taking into account the current spread but maybe in the future the spread will be different. If the validation is only happen when you execute OrderSend you might have some successful declared SL/TP that not executed in the future.

Can someone clarify? How you can be accurate on your SL/TP with pending orders? What approach is the best for declaring accurate SP/TP in pending orders as you do not know the future spread/distance levels?

  • StopLevel is checked when the order is placed (with OrderSend) be that a Market order or a Pending order.
  • FreezeLevel is checked when
    • a Market order is Closed or Partially Closed (with OrderClose)
    • a Pending Order is Deleted (with OrderDelete).
    • Stops are Modified (with OrderModify) on a Market or Pending order.
  • Spread (Ask & Bid rules) and Slippage happen
    • when a Market order is  placed (with OrderSend) or when a Pending order is triggered and becomes a Market Order.
    • when a Market order is Closed or Partially Closed (with OrderClose).
    • when a Market order hits either the Stop-Loss or Take-Profit.

Some users, try to compensate for the changing spread and slippage, by continually updating the Pending orders. However, in my opinion, that generates too much network traffic and some brokers don't like it very much.

I personally prefer to "emulate" Pending orders by the use of Market orders in order to have better control of when they are triggered. This is also what WHRoeder has suggested.

In some cases, I also emulate Stop-Loss and Take-Profit in order to have better control over it, as well as circumvent the StopLevel limitations. In these cases I set a wider real Stop-Loss and Take-Profit to serve as a security measure in case my EA stops responding and is unable to apply the emulated stops.

doorWindows
13
doorWindows 2016.08.29 18:30  
Many thanks WHRoeder and FMIC for your responses.
/
To add comments, please log in or register