OrderModify() and pending orders

This topic contains 0 replies, has 1 voice, and was last updated by  Kiaria Yoshida 3 months, 3 weeks ago.

Viewing 1 post (of 1 total)
  • Author
    Posts
  • #2104

    Kiaria Yoshida
    Keymaster

    The question was whether this function can be used to modify the opening prices of pending orders, or if these orders have to be deleted and re-created at a new price every time. The answer is YES, of course you can change the opening price of a pending order using OrderModify().

    Here is a quote from the MQL4 website:

    bool OrderModify( int ticket, double price, double stoploss, double takeprofit, datetime expiration, color arrow_color=CLR_NONE)
    Modification of characteristics for the previously opened position or pending orders. If the function succeeds, the returned value will be TRUE. If the function fails, the returned value will be FALSE. To get the detailed error information, call GetLastError() function.
    Notes: Open price and expiration time can be changed only for pending orders.
    If unchanged values are passed as the function parameters, the error 1 (ERR_NO_RESULT) will be generated.
    Pending order expiration time can be disabled in some trade servers. In this case, when a non-zero value is specified in the expiration parameter, the error 147 (ERR_TRADE_EXPIRATION_DENIED) will be generated.

    http://docs.mql4.com/trading/OrderModify

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.

 

Related Articles