OrderModify() and pending orders

Viewing 2 posts - 1 through 2 (of 2 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

    #18003
    Robert
    Participant

    For successful forex trading it is very much important to make the profit consistently and reducing the loss as much as possible. Making profit is the main motto of every trader. As a trader, I am trading with Tpglobalfx. I choose them because they help me to do successful forex trading. By giving low spreads, high leverage, 24X5 customer support and easy trading methods, they help me to make profit consistently.

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.
 

Related Articles

Login

Our website uses cookies and thereby collects information about your visit to improve our website (by analyzing), show you Social Media content and relevant advertisements. Please see our cookies page for furher details or agree by clicking the 'Accept' button.